Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

native线程hook不到 #2

Open
oboolean opened this issue Apr 30, 2019 · 1 comment
Open

native线程hook不到 #2

oboolean opened this issue Apr 30, 2019 · 1 comment

Comments

@oboolean
Copy link

oboolean commented Apr 30, 2019

9.0Android下,Java线程hook到了,很好.
但是我在jni代码中创建的native线程hook不到,代码如下:
`
pthread_t pthread;//线程对象

void *threadDoThings(void *data)
{
ALOG("jni thread do things");
pthread_exit(&pthread);
}

extern "C"
JNIEXPORT void JNICALL
Java_com_dodola_thread_ThreadHook_createNativeThread(JNIEnv *env, jclass type) {

pthread_create(&pthread, NULL, threadDoThings, NULL);

}
`
请问有啥办法能hook到native线程的创建吗 并且能拿到bakctrace最好.

@coolegos
Copy link

因为只hook 了libart.so,你改成hook_plt_method("libthreadhook.so", "pthread_create", (hook_func) &pthread_create_hook);就可以了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants