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

函数跨页边界时崩溃 #159

Open
mskmkt0704 opened this issue Jun 17, 2021 · 0 comments
Open

函数跨页边界时崩溃 #159

mskmkt0704 opened this issue Jun 17, 2021 · 0 comments

Comments

@mskmkt0704
Copy link

文件: source/UserMode/ExecMemory/code-patch-tool-posix.cc
函数: MemoryOperationError CodePatch(void *address, uint8_t *buffer, uint32_t buffer_size)

例子:
address = 0x760c09fff8
buffer_size = 16
page_align_address = 0x760c09f000
page_size = 4096
address + buffer_size = 0x760c0a0008, 超过了 mprotect 处理的范围,导致了崩溃

处理办法:
判断是否超过边界,决定是否额外处理另一页。

只测试了android arm64, 另外对整个项目不熟悉,不知道是否需要处理其他地方

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