Skip to main content

mem_shellcode_load

Function mem_shellcode_load 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn mem_shellcode_load( code: *const u8, code_len: usize, reloc_offsets: *const usize, reloc_symbols: *const *const c_char, reloc_count: usize, near_address: usize, _auto_free: i32, address_out: *mut usize, ) -> i32
Expand description

Loads shellcode into a code cave and returns its address.

Parameters:

  • code : pointer to the raw machine code bytes (required, non-null)
  • code_len : number of bytes at code (must be > 0)
  • reloc_offsets : parallel array of byte offsets for symbol relocations
  • reloc_symbols : parallel array of null-terminated C strings naming the symbols
  • reloc_count : length of both relocation arrays (0 = no relocations)
  • near_address : hint for cave allocation; pass 0 for no preference
  • auto_free : ignored by this implementation — shellcode is always stored in the registry so mem_shellcode_free controls the lifetime
  • address_out : receives the address of the loaded shellcode (required, non-null)