@@ -12,7 +12,7 @@ static void uc_common_setup(uc_engine **uc, uc_arch arch, uc_mode mode,
|
||||
OK(uc_mem_write(*uc, code_start, code, size));
|
||||
}
|
||||
|
||||
static void test_arm_nop()
|
||||
static void test_arm_nop(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x00\xf0\x20\xe3"; // nop
|
||||
@@ -34,7 +34,7 @@ static void test_arm_nop()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_arm_thumb_sub()
|
||||
static void test_arm_thumb_sub(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x83\xb0"; // sub sp, #0xc
|
||||
@@ -52,7 +52,7 @@ static void test_arm_thumb_sub()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_armeb_sub()
|
||||
static void test_armeb_sub(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] =
|
||||
@@ -83,7 +83,7 @@ static void test_armeb_sub()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_armeb_be8_sub()
|
||||
static void test_armeb_be8_sub(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] =
|
||||
@@ -114,7 +114,7 @@ static void test_armeb_be8_sub()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_arm_thumbeb_sub()
|
||||
static void test_arm_thumbeb_sub(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\xb0\x83"; // sub sp, #0xc
|
||||
@@ -140,7 +140,7 @@ static void test_arm_thumb_ite_count_callback(uc_engine *uc, uint64_t address,
|
||||
(*count) += 1;
|
||||
}
|
||||
|
||||
static void test_arm_thumb_ite()
|
||||
static void test_arm_thumb_ite(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
uc_hook hook;
|
||||
@@ -200,7 +200,7 @@ static void test_arm_thumb_ite()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_arm_m_thumb_mrs()
|
||||
static void test_arm_m_thumb_mrs(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] =
|
||||
@@ -225,7 +225,7 @@ static void test_arm_m_thumb_mrs()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_arm_m_control()
|
||||
static void test_arm_m_control(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
int r_control, r_msp, r_psp;
|
||||
@@ -274,7 +274,7 @@ static void test_arm_m_exc_return_hook_interrupt(uc_engine *uc, int intno,
|
||||
OK(uc_emu_stop(uc));
|
||||
}
|
||||
|
||||
static void test_arm_m_exc_return()
|
||||
static void test_arm_m_exc_return(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x6f\xf0\x02\x00\x00\x47"; // mov r0, #0xFFFFFFFD; bx r0;
|
||||
@@ -302,7 +302,7 @@ static void test_arm_m_exc_return()
|
||||
}
|
||||
|
||||
// For details, see https://github.com/unicorn-engine/unicorn/issues/1494.
|
||||
static void test_arm_und32_to_svc32()
|
||||
static void test_arm_und32_to_svc32(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
// # MVN r0, #0
|
||||
@@ -343,7 +343,7 @@ static void test_arm_und32_to_svc32()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_arm_usr32_to_svc32()
|
||||
static void test_arm_usr32_to_svc32(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
int r_cpsr, r_sp, r_spsr, r_lr;
|
||||
@@ -392,7 +392,7 @@ static void test_arm_usr32_to_svc32()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_arm_v8()
|
||||
static void test_arm_v8(void)
|
||||
{
|
||||
char code[] = "\xd0\xe8\xff\x17"; // LDAEXD.W R1, [R0]
|
||||
uc_engine *uc;
|
||||
@@ -416,7 +416,7 @@ static void test_arm_v8()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_arm_thumb_smlabb()
|
||||
static void test_arm_thumb_smlabb(void)
|
||||
{
|
||||
char code[] = "\x13\xfb\x01\x23";
|
||||
uint32_t r_r1, r_r2, r_r3;
|
||||
@@ -441,7 +441,7 @@ static void test_arm_thumb_smlabb()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_arm_not_allow_privilege_escalation()
|
||||
static void test_arm_not_allow_privilege_escalation(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
int r_cpsr, r_sp, r_spsr, r_lr;
|
||||
@@ -488,7 +488,7 @@ static void test_arm_not_allow_privilege_escalation()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_arm_mrc()
|
||||
static void test_arm_mrc(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
// mrc p15, #0, r1, c13, c0, #3
|
||||
@@ -502,7 +502,7 @@ static void test_arm_mrc()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_arm_hflags_rebuilt()
|
||||
static void test_arm_hflags_rebuilt(void)
|
||||
{
|
||||
// MRS r6, apsr
|
||||
// BIC r6, r6, #&1F
|
||||
@@ -575,7 +575,7 @@ static bool test_arm_mem_access_abort_hook_insn_invalid(uc_engine *uc,
|
||||
return false;
|
||||
}
|
||||
|
||||
static void test_arm_mem_access_abort()
|
||||
static void test_arm_mem_access_abort(void)
|
||||
{
|
||||
// LDR r0, [r0]
|
||||
// Undefined instruction
|
||||
@@ -623,7 +623,7 @@ static void test_arm_mem_access_abort()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_arm_read_sctlr()
|
||||
static void test_arm_read_sctlr(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
uc_arm_cp_reg reg;
|
||||
@@ -646,7 +646,7 @@ static void test_arm_read_sctlr()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_arm_be_cpsr_sctlr()
|
||||
static void test_arm_be_cpsr_sctlr(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
uc_arm_cp_reg reg;
|
||||
@@ -695,7 +695,7 @@ static void test_arm_be_cpsr_sctlr()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_arm_switch_endian()
|
||||
static void test_arm_switch_endian(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x00\x00\x91\xe5"; // ldr r0, [r1]
|
||||
|
||||
@@ -12,7 +12,7 @@ static void uc_common_setup(uc_engine **uc, uc_arch arch, uc_mode mode,
|
||||
OK(uc_mem_write(*uc, code_start, code, size));
|
||||
}
|
||||
|
||||
static void test_arm64_until()
|
||||
static void test_arm64_until(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x30\x00\x80\xd2\x11\x04\x80\xd2\x9c\x23\x00\x91";
|
||||
@@ -52,7 +52,7 @@ static void test_arm64_until()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_arm64_code_patching()
|
||||
static void test_arm64_code_patching(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x00\x04\x00\x11"; // add w0, w0, 0x1
|
||||
@@ -82,7 +82,7 @@ static void test_arm64_code_patching()
|
||||
}
|
||||
|
||||
// Need to flush the cache before running the emulation after patching
|
||||
static void test_arm64_code_patching_count()
|
||||
static void test_arm64_code_patching_count(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x00\x04\x00\x11"; // add w0, w0, 0x1
|
||||
@@ -113,7 +113,7 @@ static void test_arm64_code_patching_count()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_arm64_v8_pac()
|
||||
static void test_arm64_v8_pac(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x28\xfd\xea\xc8"; // casal x10, x8, [x9]
|
||||
@@ -138,7 +138,7 @@ static void test_arm64_v8_pac()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_arm64_read_sctlr()
|
||||
static void test_arm64_read_sctlr(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
uc_arm64_cp_reg reg;
|
||||
@@ -170,7 +170,7 @@ static uint32_t test_arm64_mrs_hook_cb(uc_engine *uc, uc_arm64_reg reg,
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void test_arm64_mrs_hook()
|
||||
static void test_arm64_mrs_hook(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
uc_hook hk;
|
||||
|
||||
@@ -73,7 +73,7 @@ static void uc_common_setup(uc_engine **uc, uc_arch arch, uc_mode mode,
|
||||
}
|
||||
|
||||
#define GEN_SIMPLE_READ_TEST(field, ctl_type, arg_type, expected) \
|
||||
static void test_uc_ctl_##field() \
|
||||
static void test_uc_ctl_##field(void) \
|
||||
{ \
|
||||
uc_engine *uc; \
|
||||
arg_type arg; \
|
||||
@@ -88,7 +88,7 @@ GEN_SIMPLE_READ_TEST(arch, UC_CTL_UC_ARCH, int, 4)
|
||||
GEN_SIMPLE_READ_TEST(page_size, UC_CTL_UC_PAGE_SIZE, uint32_t, 4096)
|
||||
GEN_SIMPLE_READ_TEST(time_out, UC_CTL_UC_TIMEOUT, uint64_t, 0)
|
||||
|
||||
static void test_uc_ctl_exits()
|
||||
static void test_uc_ctl_exits(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
// cmp eax, 0;
|
||||
@@ -141,7 +141,7 @@ double time_emulation(uc_engine *uc, uint64_t start, uint64_t end)
|
||||
#define TCG_MAX_INSNS (512) // from tcg.h
|
||||
#define CODE_LEN TB_COUNT *TCG_MAX_INSNS
|
||||
|
||||
static void test_uc_ctl_tb_cache()
|
||||
static void test_uc_ctl_tb_cache(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[CODE_LEN + 1];
|
||||
@@ -174,7 +174,7 @@ static void test_uc_ctl_tb_cache()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_uc_ctl_change_page_size()
|
||||
static void test_uc_ctl_change_page_size(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
uc_engine *uc2;
|
||||
@@ -192,7 +192,7 @@ static void test_uc_ctl_change_page_size()
|
||||
}
|
||||
|
||||
// Copy from test_arm.c but with new API.
|
||||
static void test_uc_ctl_arm_cpu()
|
||||
static void test_uc_ctl_arm_cpu(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
int r_control, r_msp, r_psp;
|
||||
|
||||
@@ -13,7 +13,7 @@ static void uc_common_setup(uc_engine **uc, uc_arch arch, uc_mode mode,
|
||||
OK(uc_mem_write(*uc, code_start, code, size));
|
||||
}
|
||||
|
||||
static void test_move_to_sr()
|
||||
static void test_move_to_sr(void)
|
||||
{
|
||||
|
||||
uc_engine *uc;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "unicorn_test.h"
|
||||
|
||||
static void test_map_correct()
|
||||
static void test_map_correct(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
|
||||
@@ -24,7 +24,7 @@ static void test_map_correct()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_map_wrapping()
|
||||
static void test_map_wrapping(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
|
||||
@@ -35,7 +35,7 @@ static void test_map_wrapping()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_mem_protect()
|
||||
static void test_mem_protect(void)
|
||||
{
|
||||
uc_engine *qc;
|
||||
int r_eax = 0x2000;
|
||||
@@ -60,7 +60,7 @@ static void test_mem_protect()
|
||||
OK(uc_close(qc));
|
||||
}
|
||||
|
||||
static void test_splitting_mem_unmap()
|
||||
static void test_splitting_mem_unmap(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
|
||||
@@ -85,7 +85,7 @@ static uint64_t test_splitting_mmio_unmap_read_callback(uc_engine *uc,
|
||||
return 0x19260817;
|
||||
}
|
||||
|
||||
static void test_splitting_mmio_unmap()
|
||||
static void test_splitting_mmio_unmap(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
// mov ecx, [0x3004] <-- normal read
|
||||
@@ -118,7 +118,7 @@ static void test_splitting_mmio_unmap()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_mem_protect_map_ptr()
|
||||
static void test_mem_protect_map_ptr(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
uint64_t val = 0x114514;
|
||||
|
||||
@@ -11,7 +11,7 @@ static void uc_common_setup(uc_engine **uc, uc_arch arch, uc_mode mode,
|
||||
OK(uc_mem_write(*uc, code_start, code, size));
|
||||
}
|
||||
|
||||
static void test_mips_el_ori()
|
||||
static void test_mips_el_ori(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x56\x34\x21\x34"; // ori $at, $at, 0x3456;
|
||||
@@ -30,7 +30,7 @@ static void test_mips_el_ori()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_mips_eb_ori()
|
||||
static void test_mips_eb_ori(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x34\x21\x34\x56"; // ori $at, $at, 0x3456;
|
||||
@@ -49,7 +49,7 @@ static void test_mips_eb_ori()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_mips_stop_at_branch()
|
||||
static void test_mips_stop_at_branch(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] =
|
||||
@@ -71,7 +71,7 @@ static void test_mips_stop_at_branch()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_mips_stop_at_delay_slot()
|
||||
static void test_mips_stop_at_delay_slot(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] =
|
||||
@@ -93,7 +93,7 @@ static void test_mips_stop_at_delay_slot()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_mips_lwx_exception_issue_1314()
|
||||
static void test_mips_lwx_exception_issue_1314(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x0a\xc8\x79\x7e"; // lwx $t9, $t9($s3)
|
||||
|
||||
@@ -11,7 +11,7 @@ static void uc_common_setup(uc_engine **uc, uc_arch arch, uc_mode mode,
|
||||
OK(uc_mem_write(*uc, code_start, code, size));
|
||||
}
|
||||
|
||||
static void test_ppc32_add()
|
||||
static void test_ppc32_add(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x7f\x46\x1a\x14"; // ADD 26, 6, 3
|
||||
@@ -35,7 +35,7 @@ static void test_ppc32_add()
|
||||
}
|
||||
|
||||
// https://www.ibm.com/docs/en/aix/7.2?topic=set-fadd-fa-floating-add-instruction
|
||||
static void test_ppc32_fadd()
|
||||
static void test_ppc32_fadd(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\xfc\xc4\x28\x2a"; // fadd 6, 4, 5
|
||||
@@ -69,7 +69,7 @@ static void test_ppc32_sc_cb(uc_engine *uc, uint32_t intno, void *data)
|
||||
return;
|
||||
}
|
||||
|
||||
static void test_ppc32_sc()
|
||||
static void test_ppc32_sc(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x44\x00\x00\x02"; // sc
|
||||
|
||||
@@ -11,7 +11,7 @@ static void uc_common_setup(uc_engine **uc, uc_arch arch, uc_mode mode,
|
||||
OK(uc_mem_write(*uc, code_start, code, size));
|
||||
}
|
||||
|
||||
static void test_riscv32_nop()
|
||||
static void test_riscv32_nop(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x13\x00\x00\x00"; // nop
|
||||
@@ -33,7 +33,7 @@ static void test_riscv32_nop()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_riscv64_nop()
|
||||
static void test_riscv64_nop(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x13\x00\x00\x00"; // nop
|
||||
@@ -55,7 +55,7 @@ static void test_riscv64_nop()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_riscv32_until_pc_update()
|
||||
static void test_riscv32_until_pc_update(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x93\x02\x10\x00\x13\x03\x00\x02\x13\x01\x81\x00";
|
||||
@@ -96,7 +96,7 @@ static void test_riscv32_until_pc_update()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_riscv64_until_pc_update()
|
||||
static void test_riscv64_until_pc_update(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x93\x02\x10\x00\x13\x03\x00\x02\x13\x01\x81\x00";
|
||||
@@ -136,7 +136,7 @@ static void test_riscv64_until_pc_update()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_riscv32_3steps_pc_update()
|
||||
static void test_riscv32_3steps_pc_update(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x93\x02\x10\x00\x13\x03\x00\x02\x13\x01\x81\x00";
|
||||
@@ -177,7 +177,7 @@ static void test_riscv32_3steps_pc_update()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_riscv64_3steps_pc_update()
|
||||
static void test_riscv64_3steps_pc_update(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x93\x02\x10\x00\x13\x03\x00\x02\x13\x01\x81\x00";
|
||||
@@ -372,7 +372,7 @@ static void test_riscv64_fp_move_to_int(void)
|
||||
uc_close(uc);
|
||||
}
|
||||
|
||||
static void test_riscv64_code_patching()
|
||||
static void test_riscv64_code_patching(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x93\x82\x12\x00"; // addi t0, t0, 0x1
|
||||
@@ -402,7 +402,7 @@ static void test_riscv64_code_patching()
|
||||
}
|
||||
|
||||
// Need to flush the cache before running the emulation after patching
|
||||
static void test_riscv64_code_patching_count()
|
||||
static void test_riscv64_code_patching_count(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x93\x82\x12\x00"; // addi t0, t0, 0x1
|
||||
@@ -439,7 +439,7 @@ static void test_riscv64_ecall_cb(uc_engine *uc, uint32_t intno, void *data)
|
||||
return;
|
||||
}
|
||||
|
||||
static void test_riscv64_ecall()
|
||||
static void test_riscv64_ecall(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x73\x00\x00\x00"; // ecall
|
||||
@@ -469,7 +469,7 @@ static uint64_t test_riscv32_mmio_map_read_cb(uc_engine *uc, uint64_t offset,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void test_riscv32_mmio_map()
|
||||
static void test_riscv32_mmio_map(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
// 37 17 02 40 lui a4, 0x40021
|
||||
@@ -487,7 +487,7 @@ static void test_riscv32_mmio_map()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_riscv32_map()
|
||||
static void test_riscv32_map(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
// 37 17 02 40 lui a4, 0x40021
|
||||
@@ -519,7 +519,7 @@ static uint64_t test_riscv64_mmio_map_read_cb(uc_engine *uc, uint64_t offset,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void test_riscv64_mmio_map()
|
||||
static void test_riscv64_mmio_map(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
// 37 17 02 40 lui a4, 0x40021
|
||||
|
||||
@@ -11,7 +11,7 @@ static void uc_common_setup(uc_engine **uc, uc_arch arch, uc_mode mode,
|
||||
OK(uc_mem_write(*uc, code_start, code, size));
|
||||
}
|
||||
|
||||
static void test_s390x_lr()
|
||||
static void test_s390x_lr(void)
|
||||
{
|
||||
char code[] = "\x18\x23"; // lr %r2, %r3
|
||||
uint64_t r_pc, r_r2, r_r3 = 0x114514;
|
||||
|
||||
@@ -25,7 +25,7 @@ static void test_x86_in_callback(uc_engine *uc, uint32_t port, int size,
|
||||
result->size = size;
|
||||
}
|
||||
|
||||
static void test_x86_in()
|
||||
static void test_x86_in(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
uc_hook hook;
|
||||
@@ -60,7 +60,7 @@ static void test_x86_out_callback(uc_engine *uc, uint32_t port, int size,
|
||||
result->value = value;
|
||||
}
|
||||
|
||||
static void test_x86_out()
|
||||
static void test_x86_out(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
uc_hook hook;
|
||||
@@ -116,7 +116,7 @@ static bool test_x86_mem_hook_all_callback(uc_engine *uc, uc_mem_type type,
|
||||
return true;
|
||||
}
|
||||
|
||||
static void test_x86_mem_hook_all()
|
||||
static void test_x86_mem_hook_all(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
uc_hook hook;
|
||||
@@ -148,7 +148,7 @@ static void test_x86_mem_hook_all()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_x86_inc_dec_pxor()
|
||||
static void test_x86_inc_dec_pxor(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] =
|
||||
@@ -178,7 +178,7 @@ static void test_x86_inc_dec_pxor()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_x86_relative_jump()
|
||||
static void test_x86_relative_jump(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\xeb\x02\x90\x90\x90\x90\x90\x90"; // jmp 4; nop; nop; nop;
|
||||
@@ -196,7 +196,7 @@ static void test_x86_relative_jump()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_x86_loop()
|
||||
static void test_x86_loop(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x41\x4a\xeb\xfe"; // inc ecx; dec edx; jmp $;
|
||||
@@ -219,7 +219,7 @@ static void test_x86_loop()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_x86_invalid_mem_read()
|
||||
static void test_x86_invalid_mem_read(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x8b\x0d\xaa\xaa\xaa\xaa"; // mov ecx, [0xAAAAAAAA]
|
||||
@@ -233,7 +233,7 @@ static void test_x86_invalid_mem_read()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_x86_invalid_mem_write()
|
||||
static void test_x86_invalid_mem_write(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x89\x0d\xaa\xaa\xaa\xaa"; // mov ecx, [0xAAAAAAAA]
|
||||
@@ -247,7 +247,7 @@ static void test_x86_invalid_mem_write()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_x86_invalid_jump()
|
||||
static void test_x86_invalid_jump(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\xe9\xe9\xee\xee\xee"; // jmp 0xEEEEEEEE
|
||||
@@ -270,7 +270,7 @@ static void test_x86_64_syscall_callback(uc_engine *uc, void *user_data)
|
||||
TEST_CHECK(rax == 0x100);
|
||||
}
|
||||
|
||||
static void test_x86_64_syscall()
|
||||
static void test_x86_64_syscall(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
uc_hook hook;
|
||||
@@ -288,7 +288,7 @@ static void test_x86_64_syscall()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_x86_16_add()
|
||||
static void test_x86_16_add(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x00\x00"; // add byte ptr [bx + si], al
|
||||
@@ -310,7 +310,7 @@ static void test_x86_16_add()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_x86_reg_save()
|
||||
static void test_x86_reg_save(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
uc_context *ctx;
|
||||
@@ -349,7 +349,7 @@ test_x86_invalid_mem_read_stop_in_cb_callback(uc_engine *uc, uc_mem_type type,
|
||||
return false;
|
||||
}
|
||||
|
||||
static void test_x86_invalid_mem_read_stop_in_cb()
|
||||
static void test_x86_invalid_mem_read_stop_in_cb(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
uc_hook hook;
|
||||
@@ -400,7 +400,7 @@ static void test_x86_x87_fnstenv_callback(uc_engine *uc, uint64_t address,
|
||||
}
|
||||
}
|
||||
|
||||
static void test_x86_x87_fnstenv()
|
||||
static void test_x86_x87_fnstenv(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
uc_hook hook;
|
||||
@@ -447,7 +447,7 @@ static void test_x86_mmio_write_callback(uc_engine *uc, uint64_t offset,
|
||||
return;
|
||||
}
|
||||
|
||||
static void test_x86_mmio()
|
||||
static void test_x86_mmio(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
int r_ecx = 0xdeadbeef;
|
||||
@@ -485,7 +485,7 @@ static bool test_x86_missing_code_callback(uc_engine *uc, uc_mem_type type,
|
||||
return true;
|
||||
}
|
||||
|
||||
static void test_x86_missing_code()
|
||||
static void test_x86_missing_code(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
uc_hook hook;
|
||||
@@ -510,7 +510,7 @@ static void test_x86_missing_code()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_x86_smc_xor()
|
||||
static void test_x86_smc_xor(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
/*
|
||||
@@ -559,7 +559,7 @@ static void test_x86_mmio_uc_mem_rw_write_callback(uc_engine *uc,
|
||||
return;
|
||||
}
|
||||
|
||||
static void test_x86_mmio_uc_mem_rw()
|
||||
static void test_x86_mmio_uc_mem_rw(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
int data = 0xdeadbeef;
|
||||
@@ -582,7 +582,7 @@ static void test_x86_sysenter_hook(uc_engine *uc, void *user)
|
||||
*(int *)user = 1;
|
||||
}
|
||||
|
||||
static void test_x86_sysenter()
|
||||
static void test_x86_sysenter(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x0F\x34"; // sysenter
|
||||
@@ -611,7 +611,7 @@ static int test_x86_hook_cpuid_callback(uc_engine *uc, void *data)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void test_x86_hook_cpuid()
|
||||
static void test_x86_hook_cpuid(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x40\x0F\xA2"; // INC EAX; CPUID
|
||||
@@ -657,7 +657,7 @@ static void test_x86_486_cpuid(void)
|
||||
}
|
||||
|
||||
// This is a regression bug.
|
||||
static void test_x86_clear_tb_cache()
|
||||
static void test_x86_clear_tb_cache(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x83\xc1\x01\x4a"; // ADD ecx, 1; DEC edx;
|
||||
@@ -691,7 +691,7 @@ static void test_x86_clear_tb_cache()
|
||||
}
|
||||
|
||||
// This is a regression bug.
|
||||
static void test_x86_clear_empty_tb()
|
||||
static void test_x86_clear_empty_tb(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
// lb:
|
||||
@@ -746,7 +746,7 @@ static void test_x86_hook_tcg_op_cb(uc_engine *uc, uint64_t address,
|
||||
result->arg2 = arg2;
|
||||
}
|
||||
|
||||
static void test_x86_hook_tcg_op()
|
||||
static void test_x86_hook_tcg_op(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
uc_hook h;
|
||||
@@ -808,7 +808,7 @@ static void test_x86_cmpxchg_mem_hook(uc_engine *uc, uc_mem_type type,
|
||||
}
|
||||
}
|
||||
|
||||
static void test_x86_cmpxchg()
|
||||
static void test_x86_cmpxchg(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x0F\xC7\x0D\xE0\xBE\xAD\xDE"; // cmpxchg8b [0xdeadbee0]
|
||||
@@ -846,7 +846,7 @@ static void test_x86_nested_emu_start_cb(uc_engine *uc, uint64_t addr,
|
||||
OK(uc_emu_start(uc, code_start + 1, code_start + 2, 0, 0));
|
||||
}
|
||||
|
||||
static void test_x86_nested_emu_start()
|
||||
static void test_x86_nested_emu_start(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
char code[] = "\x41\x4a"; // INC ecx; DEC edx;
|
||||
@@ -881,7 +881,7 @@ static void test_x86_nested_emu_stop_cb(uc_engine *uc, uint64_t addr,
|
||||
OK(uc_emu_stop(uc));
|
||||
}
|
||||
|
||||
static void test_x86_nested_emu_stop()
|
||||
static void test_x86_nested_emu_stop(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
// INC ecx; DEC edx; DEC edx;
|
||||
@@ -915,7 +915,7 @@ static void test_x86_nested_emu_start_error_cb(uc_engine *uc, uint64_t addr,
|
||||
uc_emu_start(uc, code_start + 2, 0, 0, 0));
|
||||
}
|
||||
|
||||
static void test_x86_64_nested_emu_start_error()
|
||||
static void test_x86_64_nested_emu_start_error(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
// "nop;nop;mov rax, [0x10000]"
|
||||
@@ -932,7 +932,7 @@ static void test_x86_64_nested_emu_start_error()
|
||||
OK(uc_close(uc));
|
||||
}
|
||||
|
||||
static void test_x86_eflags_reserved_bit()
|
||||
static void test_x86_eflags_reserved_bit(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
uint32_t r_eflags;
|
||||
@@ -958,7 +958,7 @@ static void test_x86_nested_uc_emu_start_exits_cb(uc_engine *uc, uint64_t addr,
|
||||
OK(uc_emu_start(uc, code_start + 5, code_start + 6, 0, 0));
|
||||
}
|
||||
|
||||
static void test_x86_nested_uc_emu_start_exits()
|
||||
static void test_x86_nested_uc_emu_start_exits(void)
|
||||
{
|
||||
uc_engine *uc;
|
||||
// cmp eax, 0
|
||||
|
||||
Reference in New Issue
Block a user