Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Header {
- FOURCC magic; //00: 'WAD4'
- U32 numlumps; //04: Number of lumps in the directory.
- U32 diroffs; //08: Offset of Directory
- U32 hashoffs; //0C: Offset of Directory Hash.
- U32 bmpoffs; //10: Offset of Allocation Bitmap.
- U32 resv3; //14: Reserved
- U32 resv4; //18: Reserved
- U32 resv5; //1C: Reserved
- //...
- }
- An allocation bitmap may be present to allow basic Read/Write access.
- This format will focus primarily on a read-only use-case though.
- DirEntW4 {
- U32 offs; //00: offset of lump data
- U32 csize; //04: compressed size of lump
- U32 dsize; //08: uncompressed size of lump
- BYTE ety; //0C: entry type
- BYTE cmp; //0D: compression method
- U16 chain; //0E: lump chain (hash)
- U16 dirid; //10: Directory ID (Parent Directory)
- U16 dirnext; //12: Next in Directory
- U16 uid; //14: UID
- U16 gid; //16: GID
- U16 mode; //18: Mode Flags (---Srwxrwxrwx)
- U16 hibits; //1A: Some extra bits
- U32 mtime; //1C: File timestamp
- BYTE name[32]; //20: name
- }
- Offsets will be scaled by 64 bytes.
- Thus, the maximum theoretical WAD4 image size will be 256GB.
- ety:
- * 0: Normal File / Unused Dirent
- * 1: Directory
- * 2: Symlink
- cmp:
- * 0: Uncompressed
- * 1: Fragmented File (Large File)
- * 2: Merged / Packed File (Small File)
- * 3: RP2 Compressed
- * 4: LZ4 Compressed
- hibits:
- * ( 3:0): chain-hi
- * ( 7:4): dirnext-hi
- * (11:8): mtime-hi
- ** Extend timestamp to 3062.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement