Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道您可以使用ptrace来捕获系统调用。但我想做的是忽略系统调用。ptrace是否有可能捕获系统调用,查看其编号,如果该编号是必须忽略的系统调用的编号,则ptrace会阻止系统调用继续进行或让系统调用立即返回。
关键是我们应该通过使用ptrace让应用程序忽略特定的系统调用。
你可以试试PTRACE_GETREGS和PTRACE_SETREGS。 如果更改eip为在系统调用之后,eax并使返回值有效,则可能会跳过该调用。 但我没有尝试过,如果它不起作用也不会感到惊讶。
PTRACE_GETREGS
PTRACE_SETREGS
eip
eax