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

hook 系统 AudioTrack 的 write 函数,提示成功,但是 hook 的函数没有被调用(建议留个QQ可以沟通) #3

Open
JarYe opened this issue Jul 3, 2020 · 1 comment

Comments

@JarYe
Copy link

JarYe commented Jul 3, 2020

#ifdef arm
void *dl = dlopen_compat("/system/lib/libmedia.so", RTLD_NOW);
#elif defined(aarch64)
void *dl = dlopen_compat("/system/lib64/libmedia.so", RTLD_NOW);
#else
#error "Arch unknown, please port me"
#endif

LE("libdl.so=%p", dl);
void* write = dlsym_compat(dl, "_ZN7android10AudioTrack5writeEPKvmb");
const RetInfo info = dump_replace((void*)write, (void *) (my_write), NULL,
NULL, "write");
if (info.status != success) {
LE("hook write error=%d", info.status);
}

@zhuotong
Copy link
Owner

1:给出日志输出。
2:确定函数是否被调用,可主动调用测试。
3:你使用的第三方的函数查找so、函数,确定该第三方函数返回的so和函数是否是已经存在内存中的,而不是新加载到内存中的。
4:看看这个函数的汇编代码,看看运行日志,一步一步定位问题。

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