From deeca1f722f82b87fb8e9fec6b65683c843c301a Mon Sep 17 00:00:00 2001 From: Hors Date: Fri, 19 Aug 2016 11:19:06 +0200 Subject: [PATCH 1/3] Create mem_map_0x100000000.c --- tests/regress/mem_map_0x100000000.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/regress/mem_map_0x100000000.c diff --git a/tests/regress/mem_map_0x100000000.c b/tests/regress/mem_map_0x100000000.c new file mode 100644 index 00000000..a89ee83e --- /dev/null +++ b/tests/regress/mem_map_0x100000000.c @@ -0,0 +1,29 @@ +#include +#include + +int main() { + uc_engine *u; + uc_err err; + + printf("mem_map_0x100000000.c \n"); + + if ((err = uc_open(UC_ARCH_X86, UC_MODE_32, &u)) != UC_ERR_OK) { + printf("uc_open() failed: %s\n", uc_strerror(err)); + } + + if ((err = uc_mem_map(u, 0x100000000, 0x002c0000, UC_PROT_ALL)) != UC_ERR_OK) { + printf("uc_mem_map() failed: %s\n", uc_strerror(err)); + return -1; + } + if ((err = uc_mem_map(u, 0x0018D000, 0x00006000, UC_PROT_ALL)) != UC_ERR_OK) { + printf("uc_mem_map() failed: %s\n", uc_strerror(err)); + return -1; + } + + if ((err = uc_close(u)) != UC_ERR_OK) { + printf("uc_close() failed: %s\n", uc_strerror(err)); + } + + printf("Success.\n"); + return 0; +} From 0fc3861699d9ac49a7daf2e68bc58c7df8677071 Mon Sep 17 00:00:00 2001 From: Hors Date: Fri, 19 Aug 2016 23:32:19 +0200 Subject: [PATCH 2/3] Update Makefile --- tests/regress/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/regress/Makefile b/tests/regress/Makefile index 9fc1f39c..532f6da0 100644 --- a/tests/regress/Makefile +++ b/tests/regress/Makefile @@ -45,6 +45,7 @@ TESTS += 004-segmentation_fault_1 TESTS += 005-qemu__fatal__illegal_instruction__0000___00000404 TESTS += 006-qemu__fatal__illegal_instruction__0421___00040026 TESTS += mem_64_c +TESTS += mem_map_0x100000000 TESTS += memleak_x86 TESTS += memleak_arm From 90fb03cf5ce7706847f274bd755f1d9dd31f6259 Mon Sep 17 00:00:00 2001 From: Hors Date: Fri, 19 Aug 2016 23:33:04 +0200 Subject: [PATCH 3/3] Update mem_map_0x100000000.c --- tests/regress/mem_map_0x100000000.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/regress/mem_map_0x100000000.c b/tests/regress/mem_map_0x100000000.c index a89ee83e..766577af 100644 --- a/tests/regress/mem_map_0x100000000.c +++ b/tests/regress/mem_map_0x100000000.c @@ -9,6 +9,7 @@ int main() { if ((err = uc_open(UC_ARCH_X86, UC_MODE_32, &u)) != UC_ERR_OK) { printf("uc_open() failed: %s\n", uc_strerror(err)); + return -1; } if ((err = uc_mem_map(u, 0x100000000, 0x002c0000, UC_PROT_ALL)) != UC_ERR_OK) { @@ -22,6 +23,7 @@ int main() { if ((err = uc_close(u)) != UC_ERR_OK) { printf("uc_close() failed: %s\n", uc_strerror(err)); + return -1; } printf("Success.\n");