Mem hook should return a bool
This commit is contained in:
@@ -196,7 +196,7 @@ static void test_arm64_mrs_hook(void)
|
||||
}
|
||||
|
||||
|
||||
static void test_arm64_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_arm64_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_x0 = 0x0;
|
||||
@@ -209,6 +209,8 @@ static void test_arm64_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_arm64_correct_address_in_small_jump_hook(void)
|
||||
@@ -237,7 +239,7 @@ static void test_arm64_correct_address_in_small_jump_hook(void)
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_arm64_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_arm64_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_x0 = 0x0;
|
||||
@@ -250,6 +252,8 @@ static void test_arm64_correct_address_in_long_jump_hook_callback(uc_engine *uc,
|
||||
// Check address
|
||||
// printf("%lx\n", address);
|
||||
TEST_CHECK(address == 0x7FFFFFFFFFFFFF00);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void test_arm64_correct_address_in_long_jump_hook(void)
|
||||
|
||||
@@ -538,7 +538,7 @@ static void test_riscv64_mmio_map(void)
|
||||
}
|
||||
|
||||
|
||||
static void test_riscv_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_riscv_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_x5 = 0x0;
|
||||
@@ -551,6 +551,8 @@ static void test_riscv_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_riscv_correct_address_in_small_jump_hook(void)
|
||||
@@ -579,7 +581,7 @@ static void test_riscv_correct_address_in_small_jump_hook(void)
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_riscv_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_riscv_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_x5 = 0x0;
|
||||
@@ -592,6 +594,8 @@ static void test_riscv_correct_address_in_long_jump_hook_callback(uc_engine *uc,
|
||||
// Check address
|
||||
// printf("%lx\n", address);
|
||||
TEST_CHECK(address == 0x7FFFFFFFFFFFFF00);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void test_riscv_correct_address_in_long_jump_hook(void)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user