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

请教两个问题 #94

Open
Mr-JingShi opened this issue Nov 12, 2021 · 0 comments
Open

请教两个问题 #94

Mr-JingShi opened this issue Nov 12, 2021 · 0 comments

Comments

@Mr-JingShi
Copy link

Mr-JingShi commented Nov 12, 2021

char line[512];

你好,大佬,最近我在学习PLT hook的相关知识,所以找到了xhook。
xhook写的太好了,让我学到了好多知识。

(1)Line49 line[512]够大吗?如果一行读不完,恰好在动态库名称或者路径的地方被截断了,strstr(line, pathname)一直等于NULL,那岂不永远找不到相应的内存页。
为什么不用getLine或者加上\n的判断,或者去掉对pathname的判断。
android对动态库的路径或者动态库的名称长度有严格限制吗,所以512够用?

(2)为什么要特殊处理跨内存页,实际应用中有遇到重定位函数表/GOT内容跨页的现象吗?
不是有严格的内存对齐要求(要么4要么8)?
这种PLT-GOT相关的条目不是程序刚运行时就分配地址了吗?
内存碎片对变量地址,可能导致变量跨页存储。
我实在不理解这个地方为什么要处理跨页。

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