GithubHelp home page GithubHelp logo

curve / lime Goto Github PK

View Code? Open in Web Editor NEW
13.0 1.0 2.0 916 KB

๐Ÿ‹ A cross-platform modding library

License: MIT License

C++ 65.02% CMake 34.98%
modding-framework modding cpp-library cpp hooking hooking-library cpp20 cpp20-library cross-platform detours memory-hacking modding-library game-hacking

lime's Introduction

๐Ÿ‘‹ Introduction

Lime is a cross-platform library that is focused on game modding and tries to provide you with useful features for your journey.

๐Ÿ—’๏ธ Features

  • Detours
    • x86/x86-64
    • Lambda support
    • (Cross-Platform) Calling Convention support (for lambdas!)
  • Instruction
    • Get next / prev instruction
    • Get immediates, displacement, size, mnemonic
    • Calculate absolute target (follow relative instructions...)
  • Memory Pages
    • Allocate pages
      • Anywhere
      • Exactly at specified address
      • In ยฑ2GB range of specified address
    • Read / Write / Restore protection
  • Module
    • Iterate Loaded Modules
    • Iterate Symbols
    • Load Modules
  • Address
    • Read / Write Data
  • Signature Scanner
    • Supports Traditional & IDA Signatures
  • Cross-Platform Entrypoint
  • [MinGW] Proxy-DLL Generation

Note

Lime follows RAII so you won't have to care about manually cleaning anything up (i.e. when allocating a page).

โš™๏ธ Configuration

Static Entrypoint

set(lime_static_entrypoint ON)

Default is: OFF

Use a platform-independent method for the entrypoint implementation.
You do not need to enable this to make use of the cross-platform entrypoint!

VirtualAlloc2

set(lime_no_alloc2 ON)

Default is: OFF

Can be used to disable the usage of VirtualAlloc2.

This should be used for compatibility with wine as it currently does not support the LowestStartingAddress requirement.
Should work since wine 8.11 ๐ŸŽ‰

๐Ÿ“ฆ Installation

  • Using CPM

    CPMFindPackage(
      NAME           lime
      VERSION        5.0
      GIT_REPOSITORY "https://github.com/Curve/lime"
    )
  • Using FetchContent

    include(FetchContent)
    
    FetchContent_Declare(lime GIT_REPOSITORY "https://github.com/Curve/lime" GIT_TAG v5.0)
    FetchContent_MakeAvailable(lime)
    
    target_link_libraries(<target> cr::lime)

๐Ÿ“– Examples

lime/tests/hook.test.cpp

Lines 46 to 52 in 7de073b

lime::make_hook(test_fn,
[](auto *hook, int param) -> int
{
auto rtn = hook->original()(param + 10);
delete hook;
return rtn;
});

lime/tests/hook.test.cpp

Lines 44 to 52 in 9ee66d3

using hook_t = lime::hook<int(void *, int), lime::convention::c_fastcall>;
hook_t::create(0xDEADBEEF,
[&](auto *hook, void *thiz, int param) -> int
{
auto ret = hook->original()(thiz, param);
delete hook;
return ret;
});

For more examples see tests

๐ŸŒ Who's using Lime

Extend the list!

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.