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 c++里某个类的方法,怎么写呢 #14

Closed
wuyuhang opened this issue Aug 16, 2018 · 1 comment
Closed

如果要hook c++里某个类的方法,怎么写呢 #14

wuyuhang opened this issue Aug 16, 2018 · 1 comment

Comments

@wuyuhang
Copy link

把要hook的目标.so反编译后,里面的目标函数是一个c++的类的成员方法,但是xhook好像没有提供一个参数是被hook函数的类名

@caikelun
Copy link
Collaborator

C++ 方法名在编译时会被 mangle 成一个字符串(其中包含了 namespace, class, 参数和返回类型等信息)。可以用 readelf 查看一下你要hook的目标so。请 google: “c++ symbol mangle demangle”。

https://en.wikipedia.org/wiki/Name_mangling
http://demangler.com/

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