Android shared library injector based on ptrace with help of KittyMemoryEx.
Requires C++11 or above.
Inject from /data for Android
- Tested on Android 5.0 ~ 14
- ABI arm, arm64, x86, x86_64
- Inject emulated arm64 & arm32 via libhoudini.so or libndk_translation.so
- Bypass android linker namespace restrictions
- memfd dlopen support
- App launch monitor
- Hide lib segments from /maps
- Hide lib from linker solist ( dladdr & dl_iterate_phdr )
Make sure to chmod +x or 755
Usage: ./path/to/AndKittyInjector [-h] [-pkg] [-pid] [-lib] [ options ]
Required arguments:
-pkg Target app package.
-lib Library path to inject.
Optional arguments:
-h, --help show available arguments.
-pid Target app pid.
-dl_memfd Use memfd_create & dlopen_ext to inject library, useful to bypass path restrictions.
-hide_maps Try to hide lib segments from /proc/[pid]/maps.
-hide_solist Try to remove lib from linker or NativeBridge solist.
-watch Monitor process launch then inject, useful if you want to inject as fast as possible.
-delay Set a delay in microseconds before injecting.
- Do not start a thread in library constructor, instead use JNI_OnLoad:
extern "C" jint JNIEXPORT JNI_OnLoad(JavaVM* vm, void *key)
{
// key 1337 is passed by injector
if (key != (void*)1337)
return JNI_VERSION_1_6;
KITTY_LOGI("JNI_OnLoad called by injector.");
JNIEnv *env = nullptr;
if (vm->GetEnv((void**)&env, JNI_VERSION_1_6) == JNI_OK)
{
KITTY_LOGI("JavaEnv: %p.", env);
// ...
}
std::thread(thread_function).detach();
return JNI_VERSION_1_6;
}
-
When using -watch to inject as soon as the target app launches, you may need to use -delay as well, especially when injecting emulated lib.
-
When using -dl_memfd and it fails then legacy dlopen will be called.
- Make sure to have NDK, cmake and make installed and added to OS environment path.
- Set NDK_HOME to point to NDK folder
- You can check both ndk-build.bat and cmake-build.bat
git clone --recursive https://github.com/MJx0/AndKittyInjector.git
cd AndKittyInjector/AndKittyInjector
ndk-build.bat
andkittyinjector's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.