memzap

replay memory writes
git clone git://git.2f30.org/memzap
Log | Files | Refs | README | LICENSE

commit 9448d34eeb67827d84dd1b46a0c972513add361f
parent e171481c7662d1b9e830021e81e55255f3e45ebb
Author: sin <sin@2f30.org>
Date:   Fri,  1 Mar 2013 14:45:16 +0000

ops: Change the prototype of readmem()

No need to use stuff like off_t, just use a void pointer.

Diffstat:
Mdata.h | 2+-
Mlinux_ops.c | 4++--
Mmemzap.c | 4++--
3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/data.h b/data.h @@ -136,6 +136,6 @@ void free_mem_region_diff(struct mem_region_diff *rdiff); /* *_ops.c */ int traceme(void); int single_step(pid_t pid); -void readmem(pid_t pid, void *buf, off_t offset, size_t size); +void readmem(pid_t pid, void *buf, void *offset, size_t size); #endif diff --git a/linux_ops.c b/linux_ops.c @@ -25,7 +25,7 @@ single_step(pid_t pid) } void -readmem(pid_t pid, void *buf, off_t offset, size_t size) +readmem(pid_t pid, void *buf, void *offset, size_t size) { char tbuf[PATH_MAX - 1]; int fdmem; @@ -38,7 +38,7 @@ readmem(pid_t pid, void *buf, off_t offset, size_t size) if (fdmem < 0) err(1, "open"); - r = lseek(fdmem, offset, SEEK_SET); + r = lseek(fdmem, (off_t)offset, SEEK_SET); if (r < 0) err(1, "lseek"); diff --git a/memzap.c b/memzap.c @@ -61,7 +61,7 @@ main(int argc, char *argv[]) goto out_mmap; do { - readmem(pid, buf, (off_t)addr, len); + readmem(pid, buf, addr, len); mr_old = build_mem_region(buf, len); if (!mr_old) @@ -79,7 +79,7 @@ main(int argc, char *argv[]) goto out_mmap; } - readmem(pid, buf_new, (off_t)addr, len); + readmem(pid, buf_new, addr, len); mr_new = build_mem_region(buf_new, len); if (!mr_new)