From cd6c98f5dfc0e336b7951803f08b73f5c454454d Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Sun, 10 Jan 2016 23:25:05 +0800 Subject: [PATCH] sample: make hook_out() of sample_x86.c more deterministic --- samples/sample_x86.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/sample_x86.c b/samples/sample_x86.c index c57043d2..b6d55401 100644 --- a/samples/sample_x86.c +++ b/samples/sample_x86.c @@ -148,7 +148,7 @@ static uint32_t hook_in(uc_engine *uc, uint32_t port, int size, void *user_data) // callback for OUT instruction (X86). static void hook_out(uc_engine *uc, uint32_t port, int size, uint32_t value, void *user_data) { - uint32_t tmp; + uint32_t tmp = 0; uint32_t eip; uc_reg_read(uc, UC_X86_REG_EIP, &eip); @@ -605,6 +605,7 @@ static void test_i386_inout(void) uc_err err; uc_hook trace1, trace2, trace3, trace4; + int r_eax = 0x1234; // EAX register int r_ecx = 0x6789; // ECX register