ilammy / ftrace-hook

Using ftrace for function hooking in Linux kernel
GNU General Public License v2.0
253 stars 70 forks source link

can not work on arm64 #11

Open xvim opened 2 years ago

xvim commented 2 years ago

I want to function hooking on arm64 but the code build fail

ilammy commented 2 years ago

Uh... Yeah, I've tested this only on x86_64 since that's the hardware I have. Sorry, I was not an expert at arm64 at the time and I'm not one now either. I believe it has a chance at working on arm64 though, if you let the code compile there, ftrace is a generic framework after all.

Have you tried removing the CONFIG_X86_64 guard check?

https://github.com/ilammy/ftrace-hook/blob/ff7bad4cd3de3d5ed8fe2baf8a1676d1cec7b5d8/ftrace_hook.c#L224-L226

tfoldi commented 2 months ago

hey, I added ARM64 support in #15. some of the flags were not compatible with arm cpu. also, on the ARM64 architecture, the equivalent of regs->ip on x86 would be regs->pc (instruction pointer to program counter).