Search code examples
androiddebuggingjava-native-interfacedalvikida

How to debug *.so in apk with IDA Pro?


I have an apk file using jni. I can pass classes.dex to IDA pro and attach it to the process on the device, but I can't enter into native library *.so. How to do it?

I even don't see C functions in "functions window" field. I see only java methods.

Or maybe there is another way to debug *.so in apk?


Solution

  • You will need two instances of IDA PRO. In the first one, you will have your DEX file attached. In the second one, you will have your native library.

    The DEX file can be attached by using the Davilk debugger. Just bear in mind, if the app wasn't made by you and the manifest doesn't allow to attach the debugger, you must have an engineer device with ro.debuggable=1.

    On the other hand, you can use either GDB or the IDA android_server -which is very good indeed, and attach the instance with the native library already open to it.

    Set breakpoints in each instance and start debugging.