From 8033781d7f33c4e9c0f016fbbadcfe53088aa664 Mon Sep 17 00:00:00 2001 From: Kurtis Miller Date: Thu, 17 Apr 2025 21:51:40 -0500 Subject: [PATCH] ensure Nyx command handler support is more CPU agnostic (#3153) --- libafl_qemu/src/command/nyx.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libafl_qemu/src/command/nyx.rs b/libafl_qemu/src/command/nyx.rs index e854c811af5..6eb982caaa3 100644 --- a/libafl_qemu/src/command/nyx.rs +++ b/libafl_qemu/src/command/nyx.rs @@ -109,8 +109,8 @@ macro_rules! define_nyx_command_manager { #[deny(unreachable_patterns)] fn parse(&self, qemu: Qemu) -> Result { let arch_regs_map: &'static EnumMap = get_exit_arch_regs(); - let nyx_backdoor = qemu.read_reg(Regs::Rax)? as c_uint; - let cmd_id = qemu.read_reg(Regs::Rbx)? as c_uint; + let nyx_backdoor = qemu.read_reg(arch_regs_map[ExitArgs::Ret])? as c_uint; + let cmd_id = qemu.read_reg(arch_regs_map[ExitArgs::Cmd])? as c_uint; // Check nyx backdoor correctness debug_assert_eq!(nyx_backdoor, 0x1f);