Apply fix for big endian hosts per #1710

This commit is contained in:
mio 2022-10-28 16:20:20 +02:00
parent 98980c904c
commit 4b961a8ef6
No known key found for this signature in database
GPG Key ID: DFF27E34A47CB873
5 changed files with 11 additions and 11 deletions

View File

@ -164,9 +164,9 @@ static void test_arm_thumb_ite(void)
OK(uc_reg_write(uc, UC_ARM_REG_R3, &r_r3));
OK(uc_mem_map(uc, r_sp, 0x1000, UC_PROT_ALL));
r_r2 = 0x68;
r_r2 = LEINT32(0x68);
OK(uc_mem_write(uc, r_sp, &r_r2, 4));
r_r2 = 0x4d;
r_r2 = LEINT32(0x4d);
OK(uc_mem_write(uc, r_sp + 4, &r_r2, 4));
OK(uc_hook_add(uc, &hook, UC_HOOK_CODE, test_arm_thumb_ite_count_callback,
@ -396,7 +396,7 @@ static void test_arm_v8(void)
{
char code[] = "\xd0\xe8\xff\x17"; // LDAEXD.W R1, [R0]
uc_engine *uc;
uint32_t r_r1 = 0xdeadbeef;
uint32_t r_r1 = LEINT32(0xdeadbeef);
uint32_t r_r0;
uc_common_setup(&uc, UC_ARCH_ARM, UC_MODE_THUMB, code, sizeof(code) - 1,

View File

@ -137,7 +137,7 @@ static void test_arm64_v8_pac(void)
OK(uc_mem_read(uc, 0x40000, (void *)&mem, 8));
TEST_CHECK(mem == r_x8);
TEST_CHECK(LEINT64(mem) == r_x8);
OK(uc_close(uc));
}

View File

@ -55,7 +55,7 @@ static void test_mem_protect(void)
OK(uc_emu_start(qc, 0x1000, 0x1000 + sizeof(code) - 1, 0, 1));
OK(uc_mem_read(qc, 0x2000 + 4, &mem, 4));
TEST_CHECK(mem == 0xdeadbeef);
TEST_CHECK(LEINT32(mem) == 0xdeadbeef);
OK(uc_close(qc));
}
@ -92,7 +92,7 @@ static void test_splitting_mmio_unmap(void)
// mov ebx, [0x4004] <-- mmio read
char code[] = "\x8b\x0d\x04\x30\x00\x00\x8b\x1d\x04\x40\x00\x00";
int r_ecx, r_ebx;
int bytes = 0xdeadbeef;
int bytes = LEINT32(0xdeadbeef);
OK(uc_open(UC_ARCH_X86, UC_MODE_32, &uc));

View File

@ -112,7 +112,7 @@ static void test_mips_lwx_exception_issue_1314(void)
reg = 0;
OK(uc_reg_write(uc, UC_MIPS_REG_1, &reg));
OK(uc_reg_write(uc, UC_MIPS_REG_T9, &reg));
reg = 0xdeadbeef;
reg = LEINT32(0xdeadbeef);
OK(uc_mem_write(uc, 0x10000, &reg, 4));
reg = 0x10000;
OK(uc_reg_write(uc, UC_MIPS_REG_S3, &reg));

View File

@ -422,7 +422,7 @@ static void test_x86_x87_fnstenv(void)
OK(uc_mem_read(uc, base, fnstenv, sizeof(fnstenv)));
// But update FCS:FIP for fld.
TEST_CHECK(fnstenv[3] == last_eip);
TEST_CHECK(LEINT32(fnstenv[3]) == last_eip);
OK(uc_close(uc));
}
@ -530,7 +530,7 @@ static void test_x86_smc_xor(void)
OK(uc_mem_read(uc, code_start + 3, (void *)&result, 4));
TEST_CHECK(result == (0x3ea98b13 ^ 0xbc4177e6));
TEST_CHECK(LEINT32(result) == (0x3ea98b13 ^ 0xbc4177e6));
OK(uc_close(uc));
}
@ -562,7 +562,7 @@ static void test_x86_mmio_uc_mem_rw_write_callback(uc_engine *uc,
static void test_x86_mmio_uc_mem_rw(void)
{
uc_engine *uc;
int data = 0xdeadbeef;
int data = LEINT32(0xdeadbeef);
OK(uc_open(UC_ARCH_X86, UC_MODE_32, &uc));
@ -572,7 +572,7 @@ static void test_x86_mmio_uc_mem_rw(void)
OK(uc_mem_write(uc, 0x20004, (void *)&data, 4));
OK(uc_mem_read(uc, 0x20008, (void *)&data, 4));
TEST_CHECK(data == 0x19260817);
TEST_CHECK(LEINT32(data) == 0x19260817);
OK(uc_close(uc));
}