Expand description
Type interpretation for reading and converting bytes from file buffers.
This module exposes the public type-reading API and dispatches to focused submodules for numeric and string handling.
Enums§
- Type
Read Error - Errors that can occur during type reading operations.
Functions§
- coerce_
value_ to_ type - Coerces a rule value to the signed width implied by
type_kind. - read_
byte - Safely reads a single byte from the buffer at the specified offset.
- read_
date - Safely reads a 32-bit Unix timestamp from the buffer at the specified offset and formats it as a human-readable date string.
- read_
double - Safely reads a 64-bit IEEE 754 double from the buffer at the specified offset.
- read_
float - Safely reads a 32-bit IEEE 754 float from the buffer at the specified offset.
- read_
long - Safely reads a 32-bit integer from the buffer at the specified offset.
- read_
pstring - Reads a Pascal-style length-prefixed string from the buffer.
- read_
qdate - Safely reads a 64-bit Unix timestamp from the buffer at the specified offset and formats it as a human-readable date string.
- read_
quad - Safely reads a 64-bit integer from the buffer at the specified offset.
- read_
regex - Scan
bufferstarting atoffsetfor the first match ofpattern. - read_
search - Scan a bounded window of
bufferfor the first occurrence ofpattern. - read_
short - Safely reads a 16-bit integer from the buffer at the specified offset.
- read_
string - Safely reads a null-terminated string from the buffer at the specified offset.
- read_
string16 - Reads a UCS-2 string from the buffer with the given endianness.
- read_
string_ exact - Read exactly
lengthbytes from the buffer atoffset, with NO NUL truncation. Used for libmagic-compatiblestring PATTERNcomparison where the magic value’s full byte length must be compared byte-for-byte against the file (including any embedded NULs in the pattern). - read_
typed_ value - Reads bytes according to the specified
TypeKind. - read_
typed_ value_ with_ pattern - Reads bytes according to the specified
TypeKind, threading apatternoperand through for pattern-bearing types (Regex,Search).