czqasngit / objc_msgsend_hook Goto Github PK
View Code? Open in Web Editor NEWobjc_msgSend之精简且完整的hook核心功能,并且还有详细注释
objc_msgSend之精简且完整的hook核心功能,并且还有详细注释
你好,使用的你代码时,我发现了一个问题,dump_method 如果出现OC 的方法就会崩溃,不知底层是什么原因呢
#define save()
__asm volatile (
"stp x8, x9, [sp, #-16]!\n"
"stp x6, x7, [sp, #-16]!\n"
"stp x4, x5, [sp, #-16]!\n"
"stp x2, x3, [sp, #-16]!\n"
"stp x0, x1, [sp, #-16]!\n"
);
#define call(b, value)
__asm volatile ("stp x8, x9, [sp, #-16]!\n");
__asm volatile ("mov x12, %0\n" :: "r"(value));
__asm volatile ("ldp x8, x9, [sp], #16\n");
__asm volatile (#b " x12\n");
通过 blr 指令 跳转执行 before_objc_msgSend 函数。这里会先保存 x8、x9 寄存器的值,原因是__asm volatile ("mov x12, %0\n" :: "r"(value)) 执行命令过程中会通过 x8 来保存函数地址,再进行跳转,所以这里会先要保存 x8,和步骤1相同,栈指针移动必须满足 SP Mod 16 = 0 的条件,所以 x9 也被保存。执行完之后 x8、x9 恢复。
作者:人类买水精华
链接:https://juejin.im/post/5d29e230f265da1b67213c06
来源:掘金
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
大神你好 我发现无论是戴明的DEMO和你的DEMO都有一个问题,只要调用setFrame:方法 就会莫名其妙的崩溃。我正在调试,但是没什么思路。
如题
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.