readStruct
fn
T readStruct(T)(const(ubyte)[] data, size_t offset, ElfEndian fileEndian)Read a packed struct from a byte array.
This function performs a direct byte copy of a packed struct from raw data. The endianness of multi-byte fields is NOT converted. Callers must handle endianness conversion individually for each field using readValue before or after calling this function, as appropriate for the target struct layout.
Parameters
data | The byte array to read from. |
offset | The offset in bytes to start reading from. |
fileEndian | The endianness of the data (currently unused; reserved for future field-level conversion). |
Returns
The read struct.
Throws
Exception if offset is out of bounds or not enough data to read.