aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index e255ec5..ee33aac 100644
--- a/src/main.c
+++ b/src/main.c
@@ -23,9 +23,23 @@ int main(int argc, char *argv[])
23 waitpid(pid, NULL, __WALL); 23 waitpid(pid, NULL, __WALL);
24 LOG("Attached to process %d\n", pid); 24 LOG("Attached to process %d\n", pid);
25 25
26 /* Do stuff ... */ 26 char *byte_seq = "secret text";
27 parse_vmmap(pid); 27 size_t byte_seq_len = strlen(byte_seq);
28 MemscanResult *head = memscan(pid, (uint8_t*)byte_seq, byte_seq_len);
29 MemscanResult *cur = head;
28 30
31 printf("\n\n\nMemory scan results:\n");
32 printf("%-16s|%-16s|%-10s|%-s\n", "Address", "Base", "Offset", "Name");
33 puts("--------------------------------------------------");
34 while (cur) {
35 printf("%-16p|%-16p|%#-10lx|%-s\n",
36 cur->mapping->begin + cur->offset,
37 cur->mapping->begin,
38 cur->offset,
39 cur->mapping->name);
40 cur = cur->next;
41 }
42 printf("\n\n");
29 ptrace(PTRACE_DETACH, pid, NULL, NULL); 43 ptrace(PTRACE_DETACH, pid, NULL, NULL);
30 LOG("Detached from process %d\n", pid); 44 LOG("Detached from process %d\n", pid);
31 45