Single header ELF loader specifically for a specific Android mobile game, as well as related utilities
- C 88.2%
- Python 10.6%
- Shell 1.2%
| img | Can also haz colour v2 | |
| tests | Support for statically linked and non-PIE executables | |
| tools | Remove outdated tool | |
| .gitignore | Fixes, tests | |
| hookasm.def | more work testing will be hell | |
| leaf.h | Support for statically linked and non-PIE executables | |
| leafhook.h | Fix aarch32 ldr, and probably adr and adrp too | |
| LICENSE | Add LICENSE | |
| README.md | Can also haz colour v2 | |
| test.c | More loading tests | |
| test_hooker.c | Fix rewrite using size in bytes instead of size in instructions | |
Leaf
Leaf is a collection of single header libraries meant for working with programs (mainly video games) at a low level.
- Leaf - The main project, a custom ELF loader, for AArch32 and AArch64 (with untested x86 and x86_64 support). Originally made for bypassing Android Q's restrictions on marking native code pages as RWX. Natrually all segments are loaded as RWX and it provides some replacement for dlsym() lookups.
- LeafHook - Native function hooking library, for AArch32 and AArch64, works similarly to something like Cydia Substrate or comex's Substitute. Might support other hooking methods in the future.
Future Plans
- Thread safe LeafHook with more hooking/detour methods (instruction copy, software break), unhooking support, and even mid-function hooking.
- LeafDebug for debugging programs without a "real" debugger.