来自 the example of hooking C++ methods with MobileSubstrate我发现了这个:
void (*X_ZN20WebFrameLoaderClient23dispatchWillSendRequestEPN7WebCore14DocumentLoaderEmRNS0_15ResourceRequestERKNS0_16ResourceResponseE) (void* something, void* loader, unsigned long identifier, void* request, const void** response);
为什么我们需要 x_zn20...23....7...14 等名称之间?这是什么意思?我认为这不是真名。
最佳答案
C++ 对发送到二进制文件的符号名称进行处理,以区分 void foo(int)
和 void foo(double)
。此外,在许多平台上,它需要以某种方式对 X::Y
进行编码,使其成为字母数字字符串。这会添加额外的字符并且依赖于平台。
关于c++ - 为什么 MobileSubstrate 在 hook C++ 函数时使用这么长的函数名?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9504282/