From 973c4311bb01d67c802b9a2cf4271e981ca17a50 Mon Sep 17 00:00:00 2001 From: Numbers Date: Thu, 16 May 2024 00:09:45 -0400 Subject: [PATCH] . --- src/data.rs | 4 ++++ src/lib.rs | 1 - src/upcast.rs | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) 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);