Rprop / ndk_dlopen

a lightweight ndk utility that helps to bypass Android N's classloader-namespace restriction

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

android n以上通过ndk_dlsym方法获取到的地址问题

WrBug opened this issue · comments

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
commented

尝试通过修改https://github.com/rrrfff/ndk_dlopen/blob/master/dlopen.c#L89

image

修改成图上的参数,无法正常运行

commented

你可以试着调用返回的地址, 如果调用正常就没问题
另外, ndk_dlopen和ndk_dlsym需要配套使用