commit 93fb912618923b2d8756fb55177d1f74d0652285
parent e768db13177889f74d4d37628bc0b5d71ac03f54
Author: sin <sin@2f30.org>
Date: Fri, 1 Mar 2013 12:24:20 +0000
memzap: Some stylistic changes
Diffstat:
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/memzap.c b/memzap.c
@@ -27,12 +27,13 @@ main(int argc, char *argv[])
len = strtoul(argv[3], NULL, 10);
if (verbose > 0)
- printf("[+] Base address: %p, length: %zu\n",
+ printf("Base address: %p, length: %zu\n",
addr, len);
pid = fork();
if (pid < 0)
err(1, "fork");
+
switch (pid) {
case 0:
ret = ptrace(PTRACE_TRACEME, 0, NULL, NULL);
@@ -46,13 +47,13 @@ main(int argc, char *argv[])
}
if (verbose > 0)
- printf("[+] Mapping buffers into memory\n");
+ printf("Mapping buffers into memory\n");
buf = map_buf(len);
buf_new = map_buf(len);
if (verbose > 0)
- printf("[+] Single stepping child with pid %jd\n",
+ printf("Single stepping child with pid %jd\n",
(intmax_t)pid);
ret = ptrace(PTRACE_SINGLESTEP, pid, NULL, NULL);
@@ -68,10 +69,10 @@ main(int argc, char *argv[])
mr_old = build_mem_region(buf, len);
if (!mr_old)
- errx(1, "[-] Failed to build memory region\n");
+ errx(1, "Failed to build memory region\n");
mt_old = build_mem_tree(mr_old);
if (!mt_old)
- errx(1, "[-] Failed to build memory tree\n");
+ errx(1, "Failed to build memory tree\n");
ret = ptrace(PTRACE_SINGLESTEP, pid, NULL, NULL);
if (ret < 0)
@@ -88,7 +89,7 @@ main(int argc, char *argv[])
mr_new = build_mem_region(buf_new, len);
if (!mr_new)
- errx(1, "[-] Failed to build memory region\n");
+ errx(1, "Failed to build memory region\n");
rdiff = diff_mem_region(mt_old, mr_new);
if (rdiff->nmrdiffs) {
apply_diff(mr_old, rdiff);