Merge pull request #619 from horsicq/master
Create mem_map_0x100000000.c
This commit is contained in:
commit
f1cd9308b6
@ -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
|
||||
|
31
tests/regress/mem_map_0x100000000.c
Normal file
31
tests/regress/mem_map_0x100000000.c
Normal file
@ -0,0 +1,31 @@
|
||||
#include <unicorn/unicorn.h>
|
||||
#include <stdio.h>
|
||||
|
||||
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));
|
||||
return -1;
|
||||
}
|
||||
|
||||
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));
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Success.\n");
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user