#include <sys/ptrace.h> #include <sys/types.h> #include <sys/wait.h> #include <sys/user.h> #include <stdio.h> int main(int argc, char *argv[]) { pid_t traced_process; struct user_regs_struct regsl; long ins; if (argc != 2) { printf("PID?"); return 1; } traced_process = atoi(argv[1]); ptrace(PTRACE_ATTACH, traced_process,NULL, NULL); wait(NULL); ptrace(PTRACE_GETREGS, traced_process,NULL, ®sl); /* 这两句编译不通过 ins = ptrace(PTRACE_PEEKTEXT,traced_process, regsl.eip, NULL); printf("EIP: %lx Instruction executed:%lx ", regsl.eip, ins); */ ptrace(PTRACE_DETACH, traced_process,NULL, NULL); return 0; }
[培训]《安卓高级研修班(网课)》月薪三万计划,掌握调试、分析还原ollvm、vmp的方法,定制art虚拟机自动化脱壳的方法