Native hooking in Android Client

你离开我真会死。 提交于 2019-12-06 21:03:47

问题


I am trying to hook the native libraries in Android. Basically I am trying to hook the socket calls in libjavacore.so file.

Similar Approach as mentioned here

For example:

  1. Get socket address (dlsym()) in libc.so.

  2. Then search for the socket address in libjavacore.so file in sections like .got, .plt, .dlsym, .dynamic.

  3. Replace the actual socket address with custom socket address at the location where actual socket address is present in memory.

The above approach is working for me in case of 32 bit Android devices. But is not working for me in case of 64 bit Android devices. Tried using proper data types like uint_ptr so that it will get auto adjusted. But still failing. When I further debugged found that libjavacore.so file is of 32 bit ELF running on 64 bit system. So, tried using uint32_t and uint64_t types as well and trying with both. But still failing.

来源:https://stackoverflow.com/questions/43635415/native-hooking-in-android-client

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!