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

closure_bridge_template LR 寄存器保存错误 #245

Open
ByteSecurity opened this issue Nov 11, 2023 · 0 comments
Open

closure_bridge_template LR 寄存器保存错误 #245

ByteSecurity opened this issue Nov 11, 2023 · 0 comments

Comments

@ByteSecurity
Copy link

ByteSecurity commented Nov 11, 2023

环境:

XR, ios 14.7, arm64

问题

在arm64 closure_bridge_template 实现中, 直接使用 xASM("stp x29, x30, [sp, #(28*8)]"); 来保存LR 寄存器, 对于 common_closure_bridge_handler 来说应该是错误的。

因为这段函数是通过 两次 BLR X17 跳转的, 他保存的是他的上一层跳转函数的, 而不是原始函数的 LR

在 common_closure_bridge_handler 中使用 ctx->lr 也不是 closure_bridge_template 保存的 X30, 是取的 ctx+0x108的位置(x0 是ctx+0x18 是对的),结果很奇怪

@ByteSecurity ByteSecurity changed the title 跳转过程中 LR 寄存器保存错误 closure_bridge_template LR 寄存器保存错误 Nov 11, 2023
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

1 participant