Code Monkey home page Code Monkey logo

m0dular's Introduction

A modular video game modding library

This is a set of commonly used utilities in video game modifications, such as a pattern scanner as well as a high performance vector math library. Some game independant features, such as aimbot are also in this library (does not support physics bullets yet).

This library is intended to be used as the core module of any project project, wrapped in a layer of game engine specific functions and data structures, then wrapped in a game specific implementation (which provides initialization, shutdown, data preparation and execution of features). This way the least code is duplicated, and the most of it is reused. The library was primarilly focused around internal hacks, with direct access to pointer dereferencing, but some tools can be used externally (provided correct memory access functions are implemented by other layers).

Another great focus of the library was efficient data layout (data oriented design), hence SoA style vector structs, SoA style player data structure, etc. This allows for good cache performance and more efficient vectorization (not having to loose 4th value in a SSE register when dealing with 3D vectors and being able to scale up even to AVX512). Out of these 3 compilers tested: LLVM (together with Apple's LLVM), GCC and MSVC, LLVM seems to do the best job at auto vectorization and is naturally the recommended compiler to be used.

TODO
  • Make the HistoryList structure use standard naming

m0dular's People

Contributors

h33p avatar lwss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

m0dular's Issues

Adding to project

I know it's not directly a issue with this project but had a question that I'm stuck on and it's very specific to both projects...

How would I go about adding this to the vmread project?

I've git cloned this project to root and added the following to meson.build in vmread:

Updated standard to cpp_std=c++17

Created new array of files I'll be using modular_files = ['m0dular/utils/threading.cpp', 'm0dular/utils/semaphores.cpp', 'm0dular/utils/atomic_lock.cpp', 'm0dular/utils/mutex.cpp']

then updated the executable to include said files:

example_kmod_src = executable(
	'kmod_src',
	files(base_files + ['src/Main.cpp', 'intmem.c'] + hlapi_files + modular_files),
  c_args : c_compile_args + compile_args + compile_args_external + ['-DKMOD_MEMMAP'],
  cpp_args : cpp_compile_args + compile_args + compile_args_external + ['-DKMOD_MEMMAP'],
  link_args : compile_args + compile_args_external + link_args + link_args_external
)

But I'm getting the following build error when i try compile:

[1/2] Compiling C++ object 'kmod_src@exe/m0dular_utils_threading.cpp.o'.
FAILED: kmod_src@exe/m0dular_utils_threading.cpp.o 
c++  -Ikmod_src@exe -I. -I.. -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -O0 -g -Wno-covered-switch-default -Wno-c++98-compat -Wno-padded -Wno-c++98-compat-pedantic -Wno-weak-vtables -Wno-documentation-unknown-command -Wno-old-style-cast -Wno-float-equal '-Wno-unused-command-line-argument -Wno-reserved-id-macro -Wno-cast-align -Wno-exit-time-destructors -Wno-global-constructors' -fpermissive -Wno-padded -Wno-c++98-compat -Wno-padded -Wno-c++98-compat-pedantic -Wno-weak-vtables -Wno-documentation-unknown-command -Wno-old-style-cast -D_POSIX_C_SOURCE=200809L -pedantic -DMVERBOSE=4 -DMTR_ENABLED -DREAD_CHECK -Wno-padded -Wno-sign-conversion -Wno-padded -Wno-documentation-unknown-command -Wno-missing-variable-declarations -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-weak-vtables -Wno-old-style-cast -DLMODE=MODE_EXTERNAL -fsanitize=address -DKMOD_MEMMAP -MD -MQ 'kmod_src@exe/m0dular_utils_threading.cpp.o' -MF 'kmod_src@exe/m0dular_utils_threading.cpp.o.d' -o 'kmod_src@exe/m0dular_utils_threading.cpp.o' -c ../m0dular/utils/threading.cpp
../m0dular/utils/threading.cpp: In function ‘void Threading::InitThreads()’:
../m0dular/utils/threading.cpp:75:15: error: ‘NUM_THREADS’ was not declared in this scope
  numThreads = NUM_THREADS;
               ^~~~~~~~~~~
../m0dular/utils/threading.cpp:75:15: note: suggested alternative: ‘_SC_THREADS’
  numThreads = NUM_THREADS;
               ^~~~~~~~~~~
               _SC_THREADS

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.