diff --git a/.gitignore b/.gitignore index 7dbba4f1..f6e783e1 100644 --- a/.gitignore +++ b/.gitignore @@ -111,6 +111,7 @@ eflags_nosync 00opcode_uc_crash eflags_noset mem_map_large +invalid_read_in_cpu_tb_exec ################# diff --git a/tests/regress/Makefile b/tests/regress/Makefile index 759adeab..c0c653b6 100644 --- a/tests/regress/Makefile +++ b/tests/regress/Makefile @@ -16,6 +16,7 @@ TESTS += eflags_nosync TESTS += 00opcode_uc_crash TESTS += eflags_noset TESTS += mem_map_large +TESTS += invalid_read_in_cpu_tb_exec all: $(TESTS) diff --git a/tests/regress/invalid_read_in_cpu_tb_exec.c b/tests/regress/invalid_read_in_cpu_tb_exec.c index 8e309caa..c05fc5b7 100644 --- a/tests/regress/invalid_read_in_cpu_tb_exec.c +++ b/tests/regress/invalid_read_in_cpu_tb_exec.c @@ -4,6 +4,11 @@ static void hook_block(uc_engine *uc, uint64_t address, uint32_t size, void *use printf("hook_block(…)\n"); } +/* + * Disassembly according to capstone: + * add byte ptr [rip - 1], 0x30 + * jmp 0x1000000 + */ #define BINARY "\x80\x05\xff\xff\xff\xff\x30\xeb\xf7\x30" #define MEMORY_SIZE 2 * 1024 * 1024 #define STARTING_ADDRESS 0x1000000