Mem hook should return a bool

This commit is contained in:
2022-05-20 13:31:54 +02:00
parent 5d37e21db5
commit dae48aecee
3 changed files with 21 additions and 7 deletions

View File

@@ -826,7 +826,7 @@ static void test_x86_hook_tcg_op(void)
OK(uc_close(uc));
}
static void test_x86_cmpxchg_mem_hook(uc_engine *uc, uc_mem_type type,
static bool test_x86_cmpxchg_mem_hook(uc_engine *uc, uc_mem_type type,
uint64_t address, int size, int64_t val,
void *data)
{
@@ -835,6 +835,8 @@ static void test_x86_cmpxchg_mem_hook(uc_engine *uc, uc_mem_type type,
} else {
*((int *)data) |= 2;
}
return true;
}
static void test_x86_cmpxchg(void)
@@ -1010,7 +1012,7 @@ static void test_x86_nested_uc_emu_start_exits(void)
OK(uc_close(uc));
}
static void test_x86_correct_address_in_small_jump_hook_callback(uc_engine *uc, int type, uint64_t address, int size, int64_t value, void *user_data)
static bool test_x86_correct_address_in_small_jump_hook_callback(uc_engine *uc, int type, uint64_t address, int size, int64_t value, void *user_data)
{
// Check registers
uint64_t r_rax = 0x0;
@@ -1023,6 +1025,8 @@ static void test_x86_correct_address_in_small_jump_hook_callback(uc_engine *uc,
// Check address
// printf("%lx\n", address);
TEST_CHECK(address == 0x7F00);
return false;
}
static void test_x86_correct_address_in_small_jump_hook(void)
@@ -1052,7 +1056,7 @@ static void test_x86_correct_address_in_small_jump_hook(void)
OK(uc_close(uc));
}
static void test_x86_correct_address_in_long_jump_hook_callback(uc_engine *uc, int type, uint64_t address, int size, int64_t value, void *user_data)
static bool test_x86_correct_address_in_long_jump_hook_callback(uc_engine *uc, int type, uint64_t address, int size, int64_t value, void *user_data)
{
// Check registers
uint64_t r_rax = 0x0;
@@ -1065,6 +1069,8 @@ static void test_x86_correct_address_in_long_jump_hook_callback(uc_engine *uc, i
// Check address
// printf("%lx\n", address);
TEST_CHECK(address == 0x7FFFFFFFFFFFFF00);
return false;
}
static void test_x86_correct_address_in_long_jump_hook(void)