turingh / fishhook_analysis Goto Github PK
View Code? Open in Web Editor NEW简单分析了facebook的fishhook源码,结合介绍动态绑定的一篇文章阅读,可以更好的理解这一块的内容
License: BSD 3-Clause "New" or "Revised" License
简单分析了facebook的fishhook源码,结合介绍动态绑定的一篇文章阅读,可以更好的理解这一块的内容
License: BSD 3-Clause "New" or "Revised" License
我断点进入了替换的函数,但是最后结果,还是原来的。并没有hook成功,这种情况是什么原因?
我在用fishhook勾底层socket相关函数,在模拟器上都能正常运行,但是真机上有些函数无法勾到。
debug之后发现libsystem_network.dylib这个函数中调用的地址没有被勾到。
真机调试时的汇编代码如下:
libsystem_network.dylib`netcore_create_control_socket:
0x1903d887c <+0>: stp x26, x25, [sp, #-80]!
0x1903d8880 <+4>: stp x24, x23, [sp, #16]
0x1903d8884 <+8>: stp x22, x21, [sp, #32]
0x1903d8888 <+12>: stp x20, x19, [sp, #48]
0x1903d888c <+16>: stp x29, x30, [sp, #64]
0x1903d8890 <+20>: add x29, sp, #64 ; =64
0x1903d8894 <+24>: sub sp, sp, #352 ; =352
0x1903d8898 <+28>: mov x20, x0
0x1903d889c <+32>: add x23, sp, #56 ; =56
0x1903d88a0 <+36>: adrp x22, 132542
0x1903d88a4 <+40>: ldr x22, [x22, #8]
0x1903d88a8 <+44>: ldr x22, [x22]
0x1903d88ac <+48>: str x22, [x23]
0x1903d88b0 <+52>: orr w0, wzr, #0x20
0x1903d88b4 <+56>: orr w1, wzr, #0x2
0x1903d88b8 <+60>: orr w2, wzr, #0x2
0x1903d88bc <+64>: bl 0x190364fec ; socket
0x1903d88c0 <+68>: mov x19, x0
在 bl 0x190364fec 这条指令中,socket函数不是间接跳转
我猜测是在链接时做的手脚,这个socket函数没有在动态符号表中,
而recv,open这些函数在libsystem_c.dylib是通过动态符号表跳转的,可以勾到。
不知道我这么理解对不对?
如果我的猜测是正确的,是不是意味着socket函数在真机上就是无法勾到?
有时间帮忙看一下, 多谢~
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.