Expand description
RIM archive support. RIM binary reader and writer.
RIM is a compact resource archive format used by KotOR module assets. This module implements strict parsing plus deterministic serialization.
§Format Layout
+------------------------------+ 0x0000
| Header (120 bytes) |
+------------------------------+ keys_offset
| Key table |
| 32 bytes * entry_count |
+------------------------------+ offsets from key entries
| Resource payload blob |
| (concatenated file data) |
+------------------------------+§Header (120 bytes)
0x00..0x04 magic ("RIM ")
0x04..0x08 version ("V1.0")
0x08..0x0C reserved_0x08 (u32, preserved verbatim)
0x0C..0x10 entry_count (u32)
0x10..0x14 keys_offset (u32)
0x14..0x18 reserved_0x14 (u32, preserved verbatim)
0x18..0x78 reserved_0x18 (96 bytes, preserved verbatim)§Key Entry (32 bytes)
0x00..0x10 resref[16] (null padded)
0x10..0x14 type_id (u32; validated to u16 range)
0x14..0x18 resource_id (u32)
0x18..0x1C data_offset (u32)
0x1C..0x20 data_size (u32)Structs§
- Rim
- In-memory RIM archive.
- RimRead
Options - Reader options for RIM parsing.
- RimResource
- One resource entry stored in a RIM archive.
Enums§
- RimBinary
Error - Errors produced while parsing or serializing RIM binary data.
- RimRead
Mode - Input-profile behavior for RIM readers.
Functions§
- read_
rim - Reads a RIM archive from a reader.
- read_
rim_ from_ bytes - Reads a RIM archive from bytes.
- read_
rim_ from_ bytes_ with_ options - Reads a RIM archive from bytes with explicit read options.
- read_
rim_ with_ options - Reads a RIM archive from a reader with explicit read options.
- write_
rim - Writes a RIM archive to a writer.
- write_
rim_ to_ vec - Serializes a RIM archive to bytes.