lazy-re

Crates.iolazy-re
lib.rslazy-re
version0.1.1
sourcesrc
created_at2022-07-07 05:11:13.963062
updated_at2022-07-19 03:41:52.283703
descriptionA library for lazy reverse engineers
homepage
repositoryhttps://github.com/etra0/lazy-re
max_upload_size
id620940
size16,488
Sebastián A. (etra0)

documentation

README

Lazy-RE

A simple proc macro for the lazy reverse engineers. It basically creates the padding for you.

#[repr(C, packed)]
#[lazy_re]
struct Lights {
    #[lazy_re(offset = 0x10)]
    x: f32,
    y: f32,
    z: f32
}

#[repr(C, packed)]
#[lazy_re]
struct PlayerEntity {
    #[lazy_re(offset = 0x48)]
    light: Lights,

    #[lazy_re(offset = 0x90)]
    player_x: f32,
    player_y: f32,
    player_z: f32,
}

That would create the padding for the Light struct at the beginning, i.e. the x field will be at the offset 0x10, and the rest is filled with [u8; 0x10].

Similarly, the PlayerEntity will have padding until the Light struct, and then it'll pad between the light and the player position, doing the math for you.

Commit count: 9

cargo fmt