I'm trying to statically inject code into an android app. The best way would be to use APKStudio and the like, but there are very harsh restrictions on the device and the app itself, so that apk modifying is not feasible, and injecting code into the .so file the apk uses would be pretty much the way to go.

So I've been searching for hours for ARM binary instrumenting tools, and I've come across a lot of dynamic instrumenting tools, but not any static ones. What I'm trying to achieve is, injecting code into a codecave or overwrite ARM code into an existing function in a library that resides in /data/data/com.appname/libs/. So when the app is launched, the corresponding library get loaded and the code gets executed. The device is rooted of course so I can modify the library, but the app requires the device to be unrooted when the app is actually running. I can use SuperSU to modify/overwrite existing app libraries, then unroot the device when before launching the app.

If there are any existing tools or blog posts out there, it would be grateful if you could point me to some links. If there's nothing, then I'd probably just use the code in dynamic instrumentation tools and create a small tool to do the task.

Any help would be appreciated.

Thanks! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.