[ Main Page | SourceForge Project Page | Download Files | Screenshots | FAQ | User's Guide | CVS ] |
Note: all of the long integers used in the Doom WADs are signed 32-bit numbers, in a lo-hi format. So byte values in a file will be need to be transposed before they can be used.
Sample line:
0000000 50 57 41 44 30 02 00 00 58 3c 45 00 f8 09 e8 f8 [PWAD0...X<E.....]
2 byte format: 58 3c 45 00
4 byte format: 00453c58
Final number: 00453c58, the offset to the directory where the lump
information is. A lump is a block of data; some contain sound data, some
contain graphics data, some contain level structure data, etc.
Bytes | Example | Purpose |
---|---|---|
00-03 | 50 57 41 44 [ 44415750 -or- 'PWAD' ] | Identifies whether the WAD is a regular WAD (IWAD), or patch WAD (PWAD) |
04-07 | 30 02 00 00 [ 00000230 ] | Number of lumps in the WAD |
08-11 | 58 3c 45 00 [ 00453c58 ] | Byte offset in the WAD file to the start of the Directory |
Bytes | Example | Purpose |
---|---|---|
00-03 | f4 12 00 00 [ 000012f4 ] | Offset from the beginning of the file to the start of the lump |
04-07 | 8a 58 00 00 [ 0000588a ] | Size of the lump in bytes |
08-15 | 4c 49 4e 45 44 45 46 45 [ 454e494c 53464544 -or- 'LINEDEFS' ] | 8 byte string, name of the lump |
Note that 'marker' and 'label' lump names like "S_START" and "E1M1"
will always be zero length, and have zero offset, as they only serve to
mark the beginning or end of a set of related lumps.
Handy Commands:
[eightball][osiris 520] od -t x1z -N 48 OSIRIS.WAD 0000000 50 57 41 44 30 02 00 00 58 3c 45 00 f8 09 e8 f8 >PWAD0...X<E.....< 0000020 87 00 01 00 07 00 80 09 80 eb 0e 01 0e 00 07 00 >................< 0000040 50 06 a8 ee 00 00 dc 07 17 00 10 0a 28 ea 00 00 >P...........(...< outputs the first 48 bytes of a WAD file, in byte groups [eightball][osiris 522] od -t x4z -N 48 wadfile.wad
outputs the first 48 bytes of the wadfile, in word (4 byte) groups [eightball][osiris 527] od -t x4z -N 48 -j 0x453c58 OSIRIS.WAD
goes to the offset called for in the -j switch, which is the first level in the WAD, display in word groups |
GHex is a good GUI editor to use to view the WAD file
Psuedocode for reading the WAD file and extracting the levels the wad replaces
[ Main Page | SourceForge Project Page | Download Files | Screenshots | FAQ | User's Guide | CVS ] |