mem
Library for doing raw memory accesses and other low-level operations.
Types
std::mem::AlignTo
std::mem::AlignTo
Aligns the cursor to the given alignment
<alignment>
: The alignment to align to
std::mem::Bytes
std::mem::Bytes
A type representing a sequence of bytes without any specific meaning
<Size>
: The size of the sequence
std::mem::Endian
std::mem::Endian
The endianness of a value
std::mem::MagicSearch
std::mem::MagicSearch
Searches for a sequence of bytes and places the given type at that address
<Magic>
: The magic sequence to search for<T>
: The type to place at the address
std::mem::Reinterpreter
std::mem::Reinterpreter
Reinterprets a value as a different one
<From>
: The type to reinterpret from<To>
: The type to reinterpret to
std::mem::Section
std::mem::Section
A Handle for a custom Section
Functions
std::mem::eof
std::mem::eof
Function that returns true if the cursor position is at the end of the memory This is usually used in while-sized arrays in the form of u8 array[while(!std::mem::eof())]
return
: True if the cursor is at the end of the memory
std::mem::reached
std::mem::reached
Function that returns true if the cursor position is at or beyond the given address
address
: The address to compare againstreturn
: True if the cursor is at or beyond the given address
std::mem::align_to
std::mem::align_to
Aligns the given value to the given alignment
alignment
: The alignment to align tovalue
: The value to alignreturn
: The aligned value
std::mem::base_address
std::mem::base_address
Gets the base address of the data
return
: The base address of the memory
std::mem::size
std::mem::size
Gets the size of the data
return
: The size of the memory
std::mem::find_sequence
std::mem::find_sequence
Finds a sequence of bytes in the data
occurrence_index
: The index of the occurrence to findbytes
: The bytes to findreturn
: The address of the sequence
std::mem::find_sequence_in_range
std::mem::find_sequence_in_range
Finds a sequence of bytes in a specific region of the data
occurrence_index
: The index of the occurrence to findoffsetFrom
: The offset from which to start searchingoffsetTo
: The offset to which to searchbytes
: The bytes to findreturn
: The address of the sequence
std::mem::find_string
std::mem::find_string
Finds a string in the data
occurrence_index
: The index of the occurrence to findstring
: The string to findreturn
: The address of the sequence
std::mem::find_string_in_range
std::mem::find_string_in_range
Finds a string in a specific region of the data
occurrence_index
: The index of the occurrence to findoffsetFrom
: The offset from which to start searchingoffsetTo
: The offset to which to searchstring
: The string to findreturn
: The address of the sequence
std::mem::read_unsigned
std::mem::read_unsigned
Reads a unsigned value from the memory
address
: The address to read fromsize
: The size of the value to read[endian]
: The endianness of the value to read. Defaults to nativereturn
: The value read
std::mem::read_signed
std::mem::read_signed
Reads a signed value from the memory
address
: The address to read fromsize
: The size of the value to read[endian]
: The endianness of the value to read. Defaults to nativereturn
: The value read
std::mem::read_string
std::mem::read_string
Reads a string value from the memory
address
: The address to read fromsize
: The size of the value to readreturn
: The value read
std::mem::read_bits
std::mem::read_bits
Reads a number of bits from the specified bit offset within the specified byte
byteOffset
: The byte offset within the databitOffset
: The bit offset to start the read at within the current bytebitSize
: The total number of bits to readreturn
: A u128 containing the value read
std::mem::create_section
std::mem::create_section
Creates a new custom section with the given name
name
: The name of the sectionreturn
: The handle to the section
std::mem::delete_section
std::mem::delete_section
Deletes a custom section
section
: The handle to the section
std::mem::get_section_size
std::mem::get_section_size
Gets the size of a custom section
section
: The handle to the sectionreturn
: The size of the section
std::mem::set_section_size
std::mem::set_section_size
Changes the size of a custom section
section
: The handle to the sectionsize
: The new size of the section
std::mem::copy_section_to_section
std::mem::copy_section_to_section
Copies a range of bytes from one section into another
from_section
: The section to copy fromfrom_address
: The address to copy fromto_section
: The section to copy toto_address
: The address to copy tosize
: The size of the range to copy
std::mem::copy_value_to_section
std::mem::copy_value_to_section
Copies a range of bytes from the main section into a custom section
value
: The pattern whose bytes should be copiedto_section
: The section to copy toto_address
: The address to copy to
std::mem::current_bit_offset
std::mem::current_bit_offset
Returns the current bit offset when inside of a bitfield.
return
: The current bit offset between 0 and 7
Last updated