From 9f6872ac68ac5e3d266d3098d43595b19615b242 Mon Sep 17 00:00:00 2001 From: Evan Richter Date: Mon, 3 Jan 2022 03:41:29 -0600 Subject: [PATCH] [libafl_qemu] fix i386 Regs values (#444) The `Regs` enum was defined out of order, leading to incorrect results from `emu.read_reg`. I found the correct ordering defined here: https://github.com/AFLplusplus/qemu-libafl-bridge/blob/master/target/i386/cpu.h#L46-L54 --- libafl_qemu/src/i386.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libafl_qemu/src/i386.rs b/libafl_qemu/src/i386.rs index c25e1fac64..5f3cea5d4a 100644 --- a/libafl_qemu/src/i386.rs +++ b/libafl_qemu/src/i386.rs @@ -10,13 +10,13 @@ pub use syscall_numbers::x86::*; #[repr(i32)] pub enum Regs { Eax = 0, - Ebx = 1, - Ecx = 2, - Edx = 3, - Esi = 4, - Edi = 5, - Ebp = 6, - Esp = 7, + Ecx = 1, + Edx = 2, + Ebx = 3, + Esp = 4, + Ebp = 5, + Esi = 6, + Edi = 7, Eip = 8, Eflags = 9, }