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

error: ‘PAGE_MASK’ undeclared (first use in this function) #103

Open
darkgirl opened this issue Jan 5, 2023 · 0 comments
Open

error: ‘PAGE_MASK’ undeclared (first use in this function) #103

darkgirl opened this issue Jan 5, 2023 · 0 comments

Comments

@darkgirl
Copy link

darkgirl commented Jan 5, 2023

https://github.com/iqiyi/xHook/blob/master/docs/overview/android_plt_hook_overview.zh-CN.md
按照这个文章中的步骤操作
编译带 hook 的 main.c 报错

`
main_hook.c: In function ‘hook’:
main_hook.c:9:36: error: ‘PAGE_MASK’ undeclared (first use in this function)
9 | #define PAGE_START(addr) ((addr) & PAGE_MASK)
| ^~~~~~~~~
main_hook.c:40:22: note: in expansion of macro ‘PAGE_START’
40 | mprotect((void *)PAGE_START(addr), PAGE_SIZE, PROT_READ | PROT_WRITE);
| ^~~~~~~~~~
main_hook.c:9:36: note: each undeclared identifier is reported only once for each function it appears in
9 | #define PAGE_START(addr) ((addr) & PAGE_MASK)
| ^~~~~~~~~
main_hook.c:40:22: note: in expansion of macro ‘PAGE_START’
40 | mprotect((void *)PAGE_START(addr), PAGE_SIZE, PROT_READ | PROT_WRITE);
| ^~~~~~~~~~
main_hook.c:40:40: error: ‘PAGE_SIZE’ undeclared (first use in this function)
40 | mprotect((void *)PAGE_START(addr), PAGE_SIZE, PROT_READ | PROT_WRITE);
| ^~~~~~~~~

`
PAGE_MASK 和 PAGE_SIZE 是安卓自带的吗?

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