android n以上通过ndk_dlsym方法获取到的地址问题
WrBug opened this issue · comments
WrBug commented
有一个so文件:libtest1.so, 里面提供一个方法:
char *test(char *c) {
return c;
}
dlopen文件:libxx.so
通过dlopen的ndk_dlsym获取到test地址:
void *test_addr = ndk_dlsym(handle,
"_Z4testPc");
配合Android-Inline-Hook,进行hook,发现无法hook,我通过debug调试了,发现 test地址和ndk_dlsym地址不相同,是还需要做其他处理吗
原始地址:
0xd364b301
ndk_dlsym地址:
0xd3604301
WrBug commented
RProp commented
你可以试着调用返回的地址, 如果调用正常就没问题
另外, ndk_dlopen和ndk_dlsym需要配套使用