From c633ac53142196052ff9344c78d1722a97c41b40 Mon Sep 17 00:00:00 2001 From: Ryan Hileman Date: Tue, 25 Aug 2015 07:17:20 -0700 Subject: [PATCH 1/2] add regress/memmap_segfault2.py --- regress/memmap_segfault2.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 regress/memmap_segfault2.py diff --git a/regress/memmap_segfault2.py b/regress/memmap_segfault2.py new file mode 100644 index 00000000..39dd9a64 --- /dev/null +++ b/regress/memmap_segfault2.py @@ -0,0 +1,6 @@ +from unicorn import * +uc = Uc(UC_ARCH_X86, UC_MODE_32) +uc.mem_map(0x0000, 0x2000) +uc.mem_map(0x2000, 0x4000) +uc.mem_write(0x1000, 0x1004 * ' ') +print 'Not reached on x86_64 Linux.' From 6d5a31d13489dae4cb8c0bbe8ed7d82ab9a45452 Mon Sep 17 00:00:00 2001 From: radare Date: Tue, 25 Aug 2015 17:22:19 +0200 Subject: [PATCH 2/2] Fix format string boundary issue As long as the GLIB format value is not available and this test case uses 32bit offsets is fine to cast it down. But maybe we should import glib.h and use the proper portable formatting. --- regress/block_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regress/block_test.c b/regress/block_test.c index 9d74d199..cc372fed 100755 --- a/regress/block_test.c +++ b/regress/block_test.c @@ -18,7 +18,7 @@ void cb_hookblock(uch handle, uint64_t address, uint32_t size, void *user_data) fprintf(stderr, "not ok %d - address != 0x1000000 && address != 0x1000200\n", count++); _exit(1); } - fprintf(stderr, "ok %d - address (0x%x) is start of basic block\n", count++, address); + fprintf(stderr, "ok %d - address (0x%x) is start of basic block\n", count++, (uint32_t)address); if (size != 0x200) { fprintf(stderr, "not ok %d - basic block size != 0x200\n", count++); _exit(1);