pub struct LoadedShellcode {
pub address: usize,
pub size: usize,
/* private fields */
}Expand description
Represents loaded executable shellcode in memory
Fields§
§address: usizeThe base address of the loaded code
size: usizeThe size of the loaded code
Implementations§
Source§impl LoadedShellcode
impl LoadedShellcode
Sourcepub unsafe fn execute(&self) -> usize
pub unsafe fn execute(&self) -> usize
Executes the shellcode as a function with no arguments, returning usize
§Safety
Caller must ensure the shellcode is valid, matches the signature, and respects ABI conventions.
Sourcepub unsafe fn execute_as<F, R>(&self, callback: impl FnOnce(F) -> R) -> Rwhere
F: Copy,
pub unsafe fn execute_as<F, R>(&self, callback: impl FnOnce(F) -> R) -> Rwhere
F: Copy,
Executes the shellcode with a custom function signature
§Safety
Caller must ensure the signature F matches the shellcode’s implementation.
Sourcepub unsafe fn as_function<F>(&self) -> Fwhere
F: Copy,
pub unsafe fn as_function<F>(&self) -> Fwhere
F: Copy,
Gets a function pointer to the shellcode
§Safety
Caller must ensure the signature F matches the shellcode’s implementation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LoadedShellcode
impl RefUnwindSafe for LoadedShellcode
impl Send for LoadedShellcode
impl Sync for LoadedShellcode
impl Unpin for LoadedShellcode
impl UnsafeUnpin for LoadedShellcode
impl UnwindSafe for LoadedShellcode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more