diff options
Diffstat (limited to 'ffi/src/long_mode.rs')
-rw-r--r-- | ffi/src/long_mode.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ffi/src/long_mode.rs b/ffi/src/long_mode.rs index a3fd784..d0d3f22 100644 --- a/ffi/src/long_mode.rs +++ b/ffi/src/long_mode.rs @@ -1,10 +1,11 @@ -use yaxpeax_arch::{Arch, Decoder, LengthedInstruction, AddressBase}; +use yaxpeax_arch::{Arch, Decoder, LengthedInstruction, U8Reader, AddressBase}; use yaxpeax_x86::long_mode; #[no_mangle] -pub unsafe extern "C" fn yaxpeax_x86_64_decode_optimistic(data: *const u8, length: u64, inst: *mut long_mode::Instruction) -> bool { +pub unsafe extern "C" fn yaxpeax_x86_64_decode(data: *const u8, length: u64, inst: *mut long_mode::Instruction) -> bool { let inst: &mut long_mode::Instruction = core::mem::transmute(inst); - <long_mode::Arch as Arch>::Decoder::default().decode_into(inst, core::slice::from_raw_parts(data as *const u8, length as usize).iter().cloned()).is_err() + let mut reader = U8Reader::new(core::slice::from_raw_parts(data as *const u8, length as usize)); + <long_mode::Arch as Arch>::Decoder::default().decode_into(inst, &mut reader).is_err() } #[no_mangle] |