This commit is contained in:
lazymio
2021-11-04 20:59:07 +01:00
parent 1507f90059
commit 01d7e454b7
2 changed files with 10 additions and 10 deletions

View File

@ -496,18 +496,18 @@ typedef enum uc_control_type {
// Current timeout. // Current timeout.
// Read: @args = (uint64_t*) // Read: @args = (uint64_t*)
UC_CTL_UC_TIMEOUT, UC_CTL_UC_TIMEOUT,
// Enable multiple exists. // Enable multiple exits.
// Without this control, reading/setting exists won't work. // Without this control, reading/setting exits won't work.
// This is for API backward compatibility. // This is for API backward compatibility.
// Write: @args = (int) // Write: @args = (int)
UC_CTL_UC_USE_EXITS, UC_CTL_UC_USE_EXITS,
// The number of current exists. // The number of current exits.
// Read: @args = (size_t*) // Read: @args = (size_t*)
UC_CTL_UC_EXITS_CNT, UC_CTL_UC_EXITS_CNT,
// Current exists. // Current exits.
// Write: @args = (uint64_t* exists, size_t len) // Write: @args = (uint64_t* exits, size_t len)
// @len = UC_CTL_UC_EXITS_CNT // @len = UC_CTL_UC_EXITS_CNT
// Read: @args = (uint64_t* exists, size_t len) // Read: @args = (uint64_t* exits, size_t len)
// @len = UC_CTL_UC_EXITS_CNT // @len = UC_CTL_UC_EXITS_CNT
UC_CTL_UC_EXITS, UC_CTL_UC_EXITS,
@ -538,11 +538,11 @@ typedef enum uc_control_type {
uc_ctl(uc, UC_CTL_READ(UC_CTL_UC_TIMEOUT, 1), (ptr)) uc_ctl(uc, UC_CTL_READ(UC_CTL_UC_TIMEOUT, 1), (ptr))
#define uc_ctl_exits_enabled(uc, enabled) \ #define uc_ctl_exits_enabled(uc, enabled) \
uc_ctl(uc, UC_CTL_WRITE(UC_CTL_UC_USE_EXITS, 1), (enabled)) uc_ctl(uc, UC_CTL_WRITE(UC_CTL_UC_USE_EXITS, 1), (enabled))
#define uc_ctl_get_exists_cnt(uc, ptr) \ #define uc_ctl_get_exits_cnt(uc, ptr) \
uc_ctl(uc, UC_CTL_READ(UC_CTL_UC_EXITS_CNT, 1), (ptr)) uc_ctl(uc, UC_CTL_READ(UC_CTL_UC_EXITS_CNT, 1), (ptr))
#define uc_ctl_get_exists(uc, buffer, len) \ #define uc_ctl_get_exits(uc, buffer, len) \
uc_ctl(uc, UC_CTL_READ(UC_CTL_UC_EXITS, 2), (buffer), (len)) uc_ctl(uc, UC_CTL_READ(UC_CTL_UC_EXITS, 2), (buffer), (len))
#define uc_ctl_set_exists(uc, buffer, len) \ #define uc_ctl_set_exits(uc, buffer, len) \
uc_ctl(uc, UC_CTL_WRITE(UC_CTL_UC_EXITS, 2), (buffer), (len)) uc_ctl(uc, UC_CTL_WRITE(UC_CTL_UC_EXITS, 2), (buffer), (len))
#define uc_ctl_get_cpu_model(uc, model) \ #define uc_ctl_get_cpu_model(uc, model) \
uc_ctl(uc, UC_CTL_READ(UC_CTL_CPU_MODEL, 1), (model)) uc_ctl(uc, UC_CTL_READ(UC_CTL_CPU_MODEL, 1), (model))

View File

@ -89,7 +89,7 @@ static void test_uc_ctl_exits()
uc_common_setup(&uc, UC_ARCH_X86, UC_MODE_32, code, sizeof(code) - 1); uc_common_setup(&uc, UC_ARCH_X86, UC_MODE_32, code, sizeof(code) - 1);
OK(uc_ctl_exits_enabled(uc, true)); OK(uc_ctl_exits_enabled(uc, true));
OK(uc_ctl_set_exists(uc, exits, 2)); OK(uc_ctl_set_exits(uc, exits, 2));
r_eax = 0; r_eax = 0;
r_ebx = 0; r_ebx = 0;
OK(uc_reg_write(uc, UC_X86_REG_EAX, &r_eax)); OK(uc_reg_write(uc, UC_X86_REG_EAX, &r_eax));