diff options
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 15 |
1 files changed, 5 insertions, 10 deletions
| @@ -1,17 +1,12 @@ | |||
| 1 | #include <string.h> | ||
| 2 | #include <stdint.h> | ||
| 1 | #include <stdlib.h> | 3 | #include <stdlib.h> |
| 2 | #include <stdio.h> | 4 | #include <stdio.h> |
| 3 | #include <sys/ptrace.h> | 5 | #include <sys/ptrace.h> |
| 4 | #include <sys/wait.h> | 6 | #include <sys/wait.h> |
| 5 | #include <unistd.h> | 7 | #include <unistd.h> |
| 6 | 8 | #include "util.h" | |
| 7 | #define ERROR(...) \ | 9 | #include "vm.h" |
| 8 | do { \ | ||
| 9 | fprintf(stderr, __VA_ARGS__); \ | ||
| 10 | exit(1); \ | ||
| 11 | } while (0) | ||
| 12 | |||
| 13 | #define LOG(...) \ | ||
| 14 | fprintf(stderr, __VA_ARGS__) | ||
| 15 | 10 | ||
| 16 | int main(int argc, char *argv[]) | 11 | int main(int argc, char *argv[]) |
| 17 | { | 12 | { |
| @@ -29,7 +24,7 @@ int main(int argc, char *argv[]) | |||
| 29 | LOG("Attached to process %d\n", pid); | 24 | LOG("Attached to process %d\n", pid); |
| 30 | 25 | ||
| 31 | /* Do stuff ... */ | 26 | /* Do stuff ... */ |
| 32 | sleep(5); | 27 | parse_vmmap(pid); |
| 33 | 28 | ||
| 34 | ptrace(PTRACE_DETACH, pid, NULL, NULL); | 29 | ptrace(PTRACE_DETACH, pid, NULL, NULL); |
| 35 | LOG("Detached from process %d\n", pid); | 30 | LOG("Detached from process %d\n", pid); |
