|
WoW Model Viewer
Your premiere tool for viewing, equipping and animating World of Warcraft models.
|
Standalone utility for parsing WoW chunk-based file formats. More...
Classes | |
| struct | ChunkHeader |
| On-disk chunk header: 4-byte magic + 4-byte size. More... | |
| struct | ChunkInfo |
| Runtime representation of a single parsed chunk. More... | |
Functions | |
| const std::vector< std::string > & | knownFirstChunks () |
| bool | isChunked (const unsigned char *data, size_t dataSize) |
| Determine whether a buffer begins with a known chunked-file header. | |
| std::vector< ChunkInfo > | parse (const unsigned char *data, size_t dataSize) |
| Parse all top-level chunks from a buffer. | |
Standalone utility for parsing WoW chunk-based file formats.
All WoW chunked files (M2, .skel, .bone, .anim, WMO, ADT, etc.) share a common envelope: sequential [4-char magic][uint32 size][data] blocks. This reader walks the buffer and returns the chunk table. Detection of chunked files uses a whitelist of known first-chunk IDs to avoid false positives on non-chunked formats (.skin, .db2, .blp, etc.) that also happen to start with printable ASCII.
|
inline |
Determine whether a buffer begins with a known chunked-file header.
Checks the first 4 bytes against the whitelist of known WoW chunk IDs and verifies the declared size fits within the buffer.
| data | Pointer to the start of the buffer. |
| dataSize | Total size of the buffer in bytes. |
Definition at line 61 of file ChunkReader.h.
|
inline |
Known first-chunk magic values for WoW chunked file formats. Only the magic that can appear as the first chunk in a file needs to be listed here — inner chunks are parsed generically.
Definition at line 39 of file ChunkReader.h.
|
inline |
Parse all top-level chunks from a buffer.
Walks sequential [magic][size][data] blocks until the end of the buffer is reached. No whitelist is required — any valid header that fits within bounds is accepted.
| data | Pointer to the start of the buffer. |
| dataSize | Total size of the buffer in bytes. |
Definition at line 86 of file ChunkReader.h.