diff options
Diffstat (limited to 'ffi/multiarch/src')
-rw-r--r-- | ffi/multiarch/src/long_mode.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ffi/multiarch/src/long_mode.rs b/ffi/multiarch/src/long_mode.rs index c0d422b..7d4367b 100644 --- a/ffi/multiarch/src/long_mode.rs +++ b/ffi/multiarch/src/long_mode.rs @@ -34,10 +34,18 @@ mod fmt { use core::fmt::Write; #[no_mangle] - pub unsafe extern "C" fn yaxpeax_instr_fmt(inst: *mut amd64::Instruction, text: *mut u8, len: usize) { + pub unsafe extern "C" fn yaxpeax_x86_64_instr_fmt_intel(inst: *mut amd64::Instruction, text: *mut u8, len: usize) { let inst: &mut amd64::Instruction = core::mem::transmute(inst); let res = core::slice::from_raw_parts_mut(text, len); - write!(InstructionSink { buf: res, offs: 0 }, "{}", inst).unwrap(); + write!(InstructionSink { buf: res, offs: 0 }, "{}", inst.display_with(DisplayStyle::Intel)).unwrap(); + } + + #[no_mangle] + pub unsafe extern "C" fn yaxpeax_x86_64_instr_fmt_c(inst: *mut amd64::Instruction, text: *mut u8, len: usize) { + let inst: &mut amd64::Instruction = core::mem::transmute(inst); + let res = core::slice::from_raw_parts_mut(text, len); + + write!(InstructionSink { buf: res, offs: 0 }, "{}", inst.display_with(DisplayStyle::C)).unwrap(); } } |