diff --git a/src/data.rs b/src/data.rs index db898d8..91093b7 100644 --- a/src/data.rs +++ b/src/data.rs @@ -84,3 +84,7 @@ mod pointer_iterator { pub fn iterate(pointer: T) -> T::IterType { pointer.into_iter() } + +pub fn fill_with T>(slice: &mut [T], mut func: F) { + slice.iter_mut().enumerate().for_each(|(i,v)|*v = func(i)) +} \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index d9d7199..b6d8532 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -32,7 +32,6 @@ pub mod win32; #[cfg(feature = "win32")] pub use win32::{ image_base, image_header, find_kernel32, process_executable }; - /// re-export the signature macro pub use xgen::signature; diff --git a/src/upcast.rs b/src/upcast.rs index aa35d55..b2e25fc 100644 --- a/src/upcast.rs +++ b/src/upcast.rs @@ -50,9 +50,13 @@ gen_upcast!(i16 => isize); #[cfg(any(target_pointer_width = "64", target_pointer_width = "32"))] gen_upcast!(u32 => usize); +#[cfg(any(target_pointer_width = "64"))] +gen_upcast!(u64 => usize); #[cfg(any(target_pointer_width = "64", target_pointer_width = "32"))] gen_upcast!(i32 => isize); +#[cfg(any(target_pointer_width = "64"))] +gen_upcast!(i64 => isize); gen_upcast!(isize => isize); gen_upcast!(usize => usize);