{"id":17928697,"url":"https://github.com/evilsocket/arminject","last_synced_at":"2025-04-05T22:11:14.634Z","repository":{"id":31355008,"uuid":"34917837","full_name":"evilsocket/arminject","owner":"evilsocket","description":"An application to dynamically inject a shared object into a running process on ARM architectures.","archived":false,"fork":false,"pushed_at":"2016-09-26T01:53:15.000Z","size":49,"stargazers_count":449,"open_issues_count":9,"forks_count":160,"subscribers_count":50,"default_branch":"master","last_synced_at":"2025-03-29T21:09:29.366Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evilsocket.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}},"created_at":"2015-05-01T18:41:10.000Z","updated_at":"2025-03-24T00:17:18.000Z","dependencies_parsed_at":"2022-09-08T07:21:28.423Z","dependency_job_id":null,"html_url":"https://github.com/evilsocket/arminject","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evilsocket%2Farminject","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evilsocket%2Farminject/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evilsocket%2Farminject/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evilsocket%2Farminject/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evilsocket","download_url":"https://codeload.github.com/evilsocket/arminject/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406111,"owners_count":20933806,"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":[],"created_at":"2024-10-28T21:04:47.543Z","updated_at":"2025-04-05T22:11:14.608Z","avatar_url":"https://github.com/evilsocket.png","language":"C++","readme":"ARM Inject\n===\n\nAn application to dynamically inject a shared object into a running process on\nARM architectures and hook API calls.\n\nRead more on:\n\n- [Dynamically inject a shared library into a running process on Android/ARM](http://www.evilsocket.net/2015/05/01/dynamically-inject-a-shared-library-into-a-running-process-on-androidarm/).\n- [Android Native API Hooking with Library Injection and ELF Introspection](http://www.evilsocket.net/2015/05/04/android-native-api-hooking-with-library-injecto/)\n\n## How to Test\n\nIn order to test this, you'll need the Android NDK installed and a device connected to your USB port,\nthen simply run:\n\n    make test\n\nThis will launch a new Chrome browser instance and inject libhook into it. Once injected\nthe library will hook the **open** function and print every call to it to the logcat.\n\n    @ Pushing files to /data/local/tmp ...\n    @ Starting com.android.chrome/com.google.android.apps.chrome.Main ...\n    @ Injection into PID 18233 starting ...\n\n    I/LIBHOOK (18233): LIBRARY LOADED FROM PID 18233.\n    I/LIBHOOK (18233): Found 104 loaded modules.\n    I/LIBHOOK (18233): Installing 12 hooks.\n    I/LIBHOOK (18233): [0xA0861000] Hooking /data/app/com.android.chrome-2/lib/arm/libchrome.so ...\n    I/LIBHOOK (18233): [0xA0A68000] Hooking /data/app/com.android.chrome-2/lib/arm/libchrome.so ...\n    I/LIBHOOK (18233): [0xAB8A9000] Hooking /system/vendor/lib/egl/libGLESv2_adreno.so ...\n    I/LIBHOOK (18233): [0xAB9EC000] Hooking /system/vendor/lib/egl/libGLESv1_CM_adreno.so ...\n    I/LIBHOOK (18233): [0xABA20000] Hooking /system/vendor/lib/libgsl.so ...\n    I/LIBHOOK (18233):   open - 0xb6f31951 -\u003e 0xa446577c\n    I/LIBHOOK (18233):   write - 0xb6f55ec8 -\u003e 0xa4464d5c\n    I/LIBHOOK (18233):   read - 0xb6f56964 -\u003e 0xa4464c70\n    I/LIBHOOK (18233):   close - 0xb6f552e8 -\u003e 0xa4464e54\n    I/LIBHOOK (18233):   connect - 0xb6f30365 -\u003e 0xa44657fc\n    I/LIBHOOK (18233):   sendto - 0xb6f562a0 -\u003e 0xa4465020\n    I/LIBHOOK (18233):   recvfrom - 0xb6f5679c -\u003e 0xa4465318\n    I/LIBHOOK (18233):   shutdown - 0xb6f566ac -\u003e 0xa4465518\n    I/LIBHOOK (18233):   send - 0xb6f33851 -\u003e 0xa4464f28\n    I/LIBHOOK (18233):   recvmsg - 0xb6f560c0 -\u003e 0xa446542c\n    I/LIBHOOK (18233):   sendmsg - 0xb6f55de0 -\u003e 0xa4465134\n    ...\n    ...\n    I/LIBHOOK (18233): [18233] open('/dev/ashmem', 2) -\u003e 18\n    I/LIBHOOK (18233): [18233] close( '/dev/ashmem' ) -\u003e 0\n    I/LIBHOOK (18233): [18233] open('/dev/ashmem', 2) -\u003e 18\n    I/LIBHOOK (18233): [18233] close( '/dev/ashmem' ) -\u003e 0\n    I/LIBHOOK (18233): [18233] open('/data/data/com.android.chrome/shared_prefs/com.google.android.apps.chrome.omaha.xml', 0) -\u003e 18\n    I/LIBHOOK (18233): [18233] open('/dev/ashmem', 2) -\u003e 19\n    I/LIBHOOK (18233): [18233] close( '/dev/ashmem' ) -\u003e 0\n    I/LIBHOOK (18233): [18233] open('/dev/ashmem', 2) -\u003e 19\n    I/LIBHOOK (18233): [18233] close( '/dev/ashmem' ) -\u003e 0\n    I/LIBHOOK (18233): [18233] read( '/data/data/com.android.chrome/shared_prefs/com.google.android.apps.chrome.omaha.xml', 0xb007c00c, 16384 ) -\u003e 655\n    I/LIBHOOK (18233): [18233] close( '/data/data/com.android.chrome/shared_prefs/com.google.android.apps.chrome.omaha.xml' ) -\u003e 0\n    I/LIBHOOK (18233): [18233] write( 'pipe:[4020814]', W, 1, 2147483647 ) -\u003e 1\n    I/LIBHOOK (18233): [18233] write( '(14)', 18306, 5, -1601827487 ) -\u003e 5\n    I/LIBHOOK (18233): [18233] open('/dev/ashmem', 2) -\u003e 22\n    I/LIBHOOK (18233): [18233] close( '/dev/ashmem' ) -\u003e 0\n    I/LIBHOOK (18233): [18233] open('/dev/ashmem', 2) -\u003e 22\n    I/LIBHOOK (18233): [18233] close( '/dev/ashmem' ) -\u003e 0\n    I/LIBHOOK (18233): [18233] close( '(22)' ) -\u003e 0\n    I/LIBHOOK (18233): [18233] read( '(18)', 0xa0860b6c, 16 ) -\u003e 1\n    I/LIBHOOK (18233): [18233] close( '(24)' ) -\u003e 0\n    I/LIBHOOK (18233): [18233] close( '(22)' ) -\u003e 0\n    I/LIBHOOK (18233): [18233] open('/dev/ashmem', 2) -\u003e 22\n    I/LIBHOOK (18233): [18233] recvfrom( 'socket:[4043146]', nysv, 2400, 64, 0x0, 0 ) -\u003e 24\n    I/LIBHOOK (18233): [18233] recvfrom( 'socket:[4043146]', nysv, 2400, 64, 0x0, 0 ) -\u003e -1\n    I/LIBHOOK (18233): [18233] read( '(18)', 0xa0860b6c, 16 ) -\u003e 1\n    I/LIBHOOK (18233): [18233] write( 'pipe:[4020814]', W, 1, 2147483647 ) -\u003e 1\n    I/LIBHOOK (18233): [18233] recvfrom( 'socket:[4043184]', \u001a, 2264, 64, 0x0, 0 ) -\u003e -1\n    I/LIBHOOK (18233): [18233] write( 'pipe:[4043980]', W, 1, -1 ) -\u003e 1\n    ...\n    ...\n    @ CTRL+C detected, killing process ...\n\n## Note\n\nMost of the ELF manipulation code inside the file hook.cpp of libhook was taken from the **Andrey Petrov**'s\nblog post \"[Android hacking: hooking system functions used by Dalvik](http://shadowwhowalks.blogspot.it/2013/01/android-hacking-hooking-system.html\n)\" and fixed by me ( the original source code didn't work due to page align, memory protection, etc ).\n\n## License\n\nReleased under the BSD license.  \nCopyright \u0026copy; 2015, Simone Margaritelli \u003cevilsocket@gmail.com\u003e  \nAll rights reserved.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevilsocket%2Farminject","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevilsocket%2Farminject","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevilsocket%2Farminject/lists"}