Expand description
Bounds-checked integer/byte readers over attacker-controllable image data.
Every accessor returns a value (0 / empty on out-of-range) rather than panicking or indexing out of bounds — a length or offset field taken from the image can be arbitrary, so reads are validated against the slice length first (Paranoid Gatekeeper).
Functions§
- bytes16
- Copies a fixed 16-byte array (a UUID / key half) at
off, zero-filled if the range is out of bounds. - le_u16
- Reads a little-endian
u16atoff, or0if the 2 bytes are out of range. - le_u32
- Reads a little-endian
u32atoff, or0if the 4 bytes are out of range. - le_u48
- Reads a little-endian 6-byte block number at
off(widened tou64), or0if out of range. CoreStorage stores physical-volume block numbers as 48-bit little-endian values. - le_u64
- Reads a little-endian
u64atoff, or0if the 8 bytes are out of range.