#[derive(GameStruct)]
{
// Attributes available to this derive:
#[offset]
#[pointer_chain]
}
Expand description
Derives a read method that maps a remote process’s memory into a Rust struct.
Each field must have an #[offset(N)] attribute specifying its byte offset
from the base address. Fields may optionally have a #[pointer_chain(a, b, ...)]
attribute to follow a chain of pointers before reading the final value.
The generated method signature is:
ⓘ
pub fn read(process: &procmod_layout::Process, base: usize) -> procmod_layout::Result<Self>§Attributes
#[offset(N)]- byte offset from base address (required on every field)#[pointer_chain(a, b, ...)]- intermediate pointer offsets to follow before reading
§Example
ⓘ
use procmod_layout::GameStruct;
#[derive(GameStruct)]
struct Player {
#[offset(0x100)]
health: f32,
#[offset(0x200)]
#[pointer_chain(0x10, 0x8)]
damage_mult: f32,
}