Skip to content

Commit fa5ef95

Browse files
committed
fixup! rust bindings for uc_mem_read_virtual
1 parent 6461b19 commit fa5ef95

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

bindings/rust/src/ffi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use crate::{Unicorn, UnicornInner};
55

6-
use super::unicorn_const::{uc_error, Arch, HookType, MemRegion, MemType, Mode, Query, TlbEntry};
6+
use super::unicorn_const::{uc_error, Arch, HookType, MemRegion, MemType, Mode, Query, TlbEntry, Permission};
77
use alloc::rc::Weak;
88
use core::cell::UnsafeCell;
99
use core::ffi::c_void;

bindings/rust/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ impl<'a, D> Unicorn<'a, D> {
342342
}
343343

344344
/// Return a range of bytes from memory at the specified emulated virtual address as vector.
345-
pub fn mem_read_virtual_as_vec(&self, address: u64, prot: Permission, buf: &mut [u8]) -> Result<Vec<u8>, uc_error> {
345+
pub fn mem_read_virtual_as_vec(&self, address: u64, prot: Permission, size: usize) -> Result<Vec<u8>, uc_error> {
346346
let mut buf = vec![0; size];
347347
unsafe { ffi::uc_mem_read_virtual(self.get_handle(), address, prot, buf.as_mut_ptr(), buf.len()) }.and(Ok(buf))
348348
}

0 commit comments

Comments
 (0)