Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/etra0/lazy-re
https://github.com/etra0/lazy-re
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/etra0/lazy-re
- Owner: etra0
- License: mit
- Created: 2022-06-28T17:48:50.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-07-19T03:40:41.000Z (over 2 years ago)
- Last Synced: 2024-12-30T12:02:31.930Z (about 2 months ago)
- Language: Rust
- Size: 14.6 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Lazy-RE
A simple proc macro for the lazy reverse engineers.
It basically creates the padding for you.```rust
#[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.