{"id":13480802,"url":"https://github.com/MJx0/AndKittyInjector","last_synced_at":"2025-03-27T11:30:58.882Z","repository":{"id":197082773,"uuid":"697575426","full_name":"MJx0/AndKittyInjector","owner":"MJx0","description":"Inject a shared library into a process using ptrace","archived":false,"fork":false,"pushed_at":"2023-11-24T05:22:38.000Z","size":672,"stargazers_count":158,"open_issues_count":5,"forks_count":63,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-30T14:42:35.796Z","etag":null,"topics":["android","injector","linux","ptrace","reverse-engineering"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MJx0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-09-28T02:56:30.000Z","updated_at":"2024-10-29T15:41:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"cf81e36e-a6aa-48ad-9041-b17ec75db298","html_url":"https://github.com/MJx0/AndKittyInjector","commit_stats":null,"previous_names":["mjx0/andkittyinjector"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MJx0%2FAndKittyInjector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MJx0%2FAndKittyInjector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MJx0%2FAndKittyInjector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MJx0%2FAndKittyInjector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MJx0","download_url":"https://codeload.github.com/MJx0/AndKittyInjector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245835966,"owners_count":20680300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","injector","linux","ptrace","reverse-engineering"],"created_at":"2024-07-31T17:00:45.197Z","updated_at":"2025-03-27T11:30:56.793Z","avatar_url":"https://github.com/MJx0.png","language":"C++","readme":"# AndKittyInjector\n\nAndroid shared library injector based on ptrace with help of [KittyMemoryEx](https://github.com/MJx0/KittyMemoryEx).\n\nRequires C++11 or above.\u003c/br\u003e\nInject from /data for Android\n\n\u003ch2\u003e Support: \u003c/h2\u003e\n\n- [x] Tested on Android 5.0  ~ 14\n- [x] ABI arm, arm64, x86, x86_64\n- [x] Inject emulated arm64 \u0026 arm32 via libhoudini.so or libndk_translation.so\n- [x] Bypass android linker namespace restrictions\n- [x] memfd dlopen support\n- [x] App launch monitor\n- [x] Hide lib segments from /maps\n- [x] Hide lib from linker solist ( dladdr \u0026 dl_iterate_phdr )\n\n\u003ch2\u003e How to use: \u003c/h2\u003e\n\nMake sure to chmod +x or 755\n\n```text\nUsage: ./path/to/AndKittyInjector [-h] [-pkg] [-pid] [-lib] [ options ]\n\nRequired arguments:\n   -pkg                Target app package.\n   \n   -lib                Library path to inject.\n\nOptional arguments:\n   -h, --help          show available arguments.\n   \n   -pid                Target app pid.\n   \n   -dl_memfd           Use memfd_create \u0026 dlopen_ext to inject library, useful to bypass path restrictions.\n\n   -hide_maps          Try to hide lib segments from /proc/[pid]/maps.\n\n   -hide_solist        Try to remove lib from linker or NativeBridge solist.\n   \n   -watch              Monitor process launch then inject, useful if you want to inject as fast as possible.\n   \n   -delay              Set a delay in microseconds before injecting.\n   ```\n\n\u003ch2\u003eNotes: \u003c/h2\u003e\n\n- Do not start a thread in library constructor, instead use JNI_OnLoad:\n\n```cpp\nextern \"C\" jint JNIEXPORT JNI_OnLoad(JavaVM* vm, void *key)\n{\n    // key 1337 is passed by injector\n    if (key != (void*)1337)\n        return JNI_VERSION_1_6;\n\n    KITTY_LOGI(\"JNI_OnLoad called by injector.\");\n\n    JNIEnv *env = nullptr;\n    if (vm-\u003eGetEnv((void**)\u0026env, JNI_VERSION_1_6) == JNI_OK)\n    {\n        KITTY_LOGI(\"JavaEnv: %p.\", env);\n        // ...\n    }\n    \n    std::thread(thread_function).detach();\n    \n    return JNI_VERSION_1_6;\n}\n```\n\n- 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.\n\n- When using -dl_memfd and it fails then legacy dlopen will be called.\n\n\u003ch2\u003e Compile: \u003c/h2\u003e\n\n- Make sure to have NDK, cmake and make installed and added to OS environment path.\n- Set NDK_HOME to point to NDK folder\n- You can check both [ndk-build.bat](AndKittyInjector/ndk-build.bat) and [cmake-build.bat](AndKittyInjector/cmake-build.bat)\n\n```shell\ngit clone --recursive https://github.com/MJx0/AndKittyInjector.git\ncd AndKittyInjector/AndKittyInjector\nndk-build.bat\n```\n\n\u003ch2\u003eCredits: \u003c/h2\u003e\n\n[arminject](https://github.com/evilsocket/arminject)\n\n[injectvm-binderjack](https://github.com/Chainfire/injectvm-binderjack)\n\n[TinyInjector](https://github.com/shunix/TinyInjector)\n\n[am_proc_start](https://gist.github.com/vvb2060/a3d40084cd9273b65a15f8a351b4eb0e#file-am_proc_start-cpp)\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMJx0%2FAndKittyInjector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMJx0%2FAndKittyInjector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMJx0%2FAndKittyInjector/lists"}