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函数的指令跳转到被替换指令的位置有什么通用解决方案吗 #13

Open
zhaoqianli0202 opened this issue Feb 28, 2024 · 1 comment

Comments

@zhaoqianli0202
Copy link

你好,目前遇到这个问题,在回调原始指令后,由于跳转到了已经被替换为跳转指令的代码位置,导致未定义指令crash,请问有什么好的解决方案吗

0x0000aaaac188073c <+0>: stp x29, x30, [sp, #-16]!
0x0000aaaac1880740 <+4>: ldr x17, 0xaaaac1880748
0x0000aaaac1880744 <+8>: blr x17
0x0000aaaac1880748 <+12>: sbfiz x20, x2, #39, #8
=> 0x0000aaaac188074c <+16>: .inst 0x0000ffff ; undefined //undefined inst,crash
0x0000aaaac1880750 <+20>: b 0xaaaac1880788
......
0x0000aaaac1880794 <+88>: b.le 0xaaaac1880754
0x0000aaaac1880798 <+92>: ldr w0, [sp, #4]
0x0000aaaac188079c <+96>: add w0, w0, #0x1
0x0000aaaac18807a0 <+100>: str w0, [sp, #4]
0x0000aaaac18807a4 <+104>: ldr w0, [sp, #4]
0x0000aaaac18807a8 <+108>: cmp w0, #0xf
0x0000aaaac18807ac <+112>: b.le 0xaaaac188074c //这里要跳转回已经被替换指令的位置

@Rprop
Copy link
Owner

Rprop commented Mar 27, 2024

将0x0000aaaac18807ac的跳转目标重定向到修复后的相应位置

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