From 3e5ebc58a0e214a4ed8f1d09b40370466ee0eecc Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Sun, 23 Aug 2015 11:03:18 +0800 Subject: [PATCH] add regress/memmap.py --- regress/memmap.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 regress/memmap.py diff --git a/regress/memmap.py b/regress/memmap.py new file mode 100755 index 00000000..2ac3508e --- /dev/null +++ b/regress/memmap.py @@ -0,0 +1,14 @@ +#!/usr/bin/python +# By Ryan Hileman, issue #9 + +# this prints out 2 lines and the contents must be the same + +from unicorn import * +uc = Uc(UC_ARCH_X86, UC_MODE_64) + +uc.mem_map(0x8048000, 0x2000) +uc.mem_write(0x8048000, 'test') +print 1, str(uc.mem_read(0x8048000, 4)).encode('hex') + +uc.mem_map(0x804a000, 0x8000) +print 2, str(uc.mem_read(0x8048000, 4)).encode('hex')