home *** CD-ROM | disk | FTP | other *** search
/ Gambler 34 A / GAMBLERCD34A.BIN / Utils / GP / Progs / MRipper / UTILS / LIBS.TXT < prev    next >
Text File  |  1996-03-26  |  18KB  |  517 lines

  1. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  2. ▒    ▒ ▒▒ ▒   ▒▒ ▒▒▒ ▒    ▒   ▒▒   ▒▒▒   ▒   ▒▒   ▒ ▒▒ ▒ ▒▒    ▒   ▒▒  ▒▒  ▒  ▒
  3. ▓▓▓▓ ▓ ▓▓ ▓ ▓▓▓▓ ▓▓▓ ▓ ▓▓ ▓ ▓▓ ▓ ▓▓ ▓▓ ▓▓▓ ▓▓ ▓ ▓▓▓ ▓▓ ▓ ▓▓▓▓▓ ▓ ▓▓▓ ▓▓ ▓ ▓ ▓ ▓
  4. ████ █ ██ █ ████ █ █ █ ██ █ ██ █ ███ █ ███ █ ██ ███ ██ █ █████ █ ███ ██ █ █ █ █
  5.     ░ ░░░░ ░░░  ░ ░ ░ ░  ░ ░  ░ ░   ░ ░░░ ░ ░░ ░░░ ░  ░ ░     ░ ░░░ ░░░░ ░ ░ ░
  6.     ▓ ▓  ▓ ▓    ▓ ▓ ▓ ▓  ▓ ▓  ▓ ▓   ▓ ▓   ▓  ▓ ▓   ▓  ▓ ▓     ▓ ▓   ▓  ▓ ▓   ▓
  7.     █ █  █ ███  ██ ██ ████ █  █ ████  ███ █  █ █   ████ ███   █ ███ █  █ █   █
  8. ≡≡≡≡▒≡▒≡≡▒≡▒▒▒≡≡▒▒≡▒▒≡▒▒▒▒≡▒≡≡▒≡▒▒▒▒≡≡▒▒▒≡▒≡≡▒≡▒≡≡≡▒▒▒▒≡▒▒▒≡≡≡▒≡▒▒▒≡▒≡≡▒≡▒≡≡≡▒≡
  9. ====▒=▒▒▒▒=▒====▒=▒=▒=▒==▒=▒==▒=▒===▒=▒===▒==▒=▒===▒==▒=▒=====▒=▒===▒▒▒▒=▒===▒=
  10. ----▒-▒--▒-▒▒---▒-▒-▒-▒--▒-▒--▒-▒---▒-▒▒--▒-▒--▒▒▒-▒--▒-▒-----▒-▒▒--▒--▒-▒-▒-▒-
  11. -▒▒▒▒-▒--▒-▒▒▒--▒---▒-▒▒▒▒-▒▒▒--▒▒▒▒--▒▒▒-▒▒▒▒-▒▒▒-▒--▒-▒--▒▒▒▒-▒▒▒--▒▒--▒▒-▒▒-
  12. ···············································································
  13.  
  14.                                Library Structures
  15.                       Figured out by ·─═■│Æ∩■═─· @ T(/\)T
  16.                                  Revision  1.2
  17.                             Tuesday, March 26, 1996
  18.                             Email: baccan@isanet.it
  19.  
  20.  
  21.  This document has been written only because there isn't any about these
  22.  structures... and writing down things helps remembering them!!
  23.  
  24.  Use these informations in any way you want, e.g. make your own ripper,
  25.  like I have done (MultiRipper 1.30 already extract these!)
  26.  
  27.  Libraries are found on EXE files ,tipically on demos.
  28.  These files are made of several files linked together to form a single EXE.
  29.  The main program searches every part needed inside itself using an index,
  30.  made at least with names and lengths of every single file that forms the
  31.  main EXE.
  32.  Sometimes library are not linked to the main EXE but are separate huge
  33.  data files, actually containing all necessary files. In demos this is
  34.  quite unused, I found only few ones using external libs, and they're almost
  35.  older versions of the EXE type libs. External libs are mostly found on games
  36.  like DOOM and DARK FORCES (ever heard of *.WAD files???)
  37.  Well, not surprisingly, also these external libs contain an index.
  38.  The structure of this index, the Lib structure index, can also be used to
  39.  rip off the single files.
  40.  Unluckily, not all structures all identical, but there are few programmers
  41.  that make standard libraries to reduce the hassle of linking demoparts
  42.  together , so they're quite easy to decode...
  43.  
  44.  Lib Structures described in this document: (11)
  45.  
  46.  1)  Future Crew Lib
  47.  2)  Realtech Lib (EXE)
  48.  2a) Realtech Lib (DAT)
  49.  3)  Psychic Link FLIB
  50.  4)  ElectroMotive Force LIB
  51.  5)  The Coexistence XLink 2.02
  52.  6)  The Coexistence XLink 1.0
  53.  7)  Pelusa Resource Compiler 0.1ß
  54.  8)  ACME Virtual File System 1.0ß
  55.  9)  LucasArts GOB files
  56.  10) iD Software WAD files
  57.  11) Cascada Resource file
  58.  
  59.  
  60.  
  61.  *■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■*
  62.  
  63.                           ┌─· ┌───────────────┐ ·─┐
  64.                           ╘══[┤Future Crew Lib├]══╛
  65.                               └───────────────┘
  66.  
  67.  *■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■*
  68.  
  69. ("Unreal" , "Panic" , "FishTro" , "The Party'92" tested)
  70.  
  71. Last 4 bytes in Future crew's (old) demos are an absolute offset;
  72. if seeking to this offset there is "└/╚ " (C02FC800) we have a Future crew
  73. library structure... and exactly:
  74. ---------------------------------------
  75. 0: Lib Header: (dWord) Magic C02FC800
  76. 4: # of records (dWord)
  77. 8: start of lib (dWord)
  78. { Record structure:
  79.   Filename: 12 Bytes
  80.   Filler  :  4 Bytes
  81.   Start off  dWord (absolute offset)
  82.   Lenght     dWord
  83. } * # of records
  84. start of header (dWord) , absolute offset in file
  85. EOF
  86.  
  87.  
  88.  
  89.  
  90.  *■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■*
  91.  
  92.                      ┌─· ┌───────────────────────────┐ ·─┐
  93.                      ╘══[┤Realtech Lib (in EXE files)├]══╛
  94.                          └───────────────────────────┘
  95.  
  96.  *■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■*
  97.  
  98. ("DX Project" , "Aquaphobia" and "Countdown" tested )
  99.  
  100. Last 4 bytes in RealTech's Demos are a LIB dimension; seeking backwards
  101. with this value will find "REALTECH95" (and now "REALTECH96" maybe...)
  102. ------------------
  103. 00h: Lib Magic "REALTECH95"
  104. 0Ah: "=" 03Dh (unknown)
  105. 0Bh: # of Records (Word)
  106. 0Dh: structure lenght (dWord) (from 00h to start of 1st file)
  107. { Record structure:
  108.   Filename: 12 Bytes
  109.   filler:    1 byte
  110.   Lenght:      dWord
  111. } * # of Records
  112. Start of file pointed by record #1
  113. ....
  114. Start of last file
  115. last4bytes  (lib off)
  116. EOF
  117.  *■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■*
  118.  
  119.                      ┌─· ┌───────────────────────────┐ ·─┐
  120.                      ╘══[┤Realtech Lib (in DAT files)├]══╛
  121.                          └───────────────────────────┘
  122.  
  123.  *■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■*
  124.  
  125. ("Megamix" and "Dimension" tested)
  126.  
  127. The structure is the same but the file starts with "REALTECH94", so it's a
  128. kinda older version of the EXE type (REALTECH95)
  129. Please refer to the EXE type structure, assuming that lib magic is found
  130. at offset 0 of file.
  131.  
  132.  
  133.  
  134.  *■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■*
  135.  
  136.                          ┌─· ┌─────────────────┐ ·─┐
  137.                          ╘══[┤Psychic Link FLIB├]══╛
  138.                              └─────────────────┘
  139.  
  140.  *■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■*
  141.  
  142. ("ACT1" and "Juice" tested)
  143.  
  144. Last 8 bytes in Psychic Link's Demos are a dWord + "FLIB"
  145. This dWord is the # of Records , and every rec is 20h bytes long, so lib
  146. start is (nRec*32)+8 bytes from EOF
  147.  
  148. { Record structure:
  149.   Filename: 12 Bytes
  150.   filler:    4 bytes
  151.   Start off  dWord (absolute offset)
  152.   Lenght     dWord
  153.   Unknown    dWord
  154.   Unknown    dWord
  155. } * # of Records
  156. # of Records
  157. Lib Magic "FLIB"
  158. EOF
  159.  
  160.  
  161.  
  162.  
  163.  *■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■*
  164.  
  165.                       ┌─· ┌───────────────────────┐ ·─┐
  166.                       ╘══[┤ElectroMotive Force LIB├]══╛
  167.                           └───────────────────────┘
  168.  
  169.  *■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■*
  170.  
  171. ("Verses" , "ASM95 InvTro" and "Caero" tested)
  172.  
  173. Last 12 bytes in EMF demos are 2 dWords + "EMF!"
  174. The 1st dWord is the # of Records
  175. The 2nd dWord is Abs offset of start of lib
  176.  
  177. { Record structure:
  178.   Filename: 12 Bytes
  179.   filler:    4 bytes                        ┌
  180.   Start off  dWord (absolute offset)────────┤not very accurate!!
  181.   Lenght     dWord                          │sometimes is 1 byte
  182.   Filler     dWord                          │after realstart !!
  183.   Unknown    dWord (Start off duplicate?)   │(at least in Verses)
  184. } * # of Records                            └
  185. # of Records
  186. start of Lib abs Offset
  187. Lib Magic "EMF!"
  188. EOF
  189.  
  190.  
  191.  
  192.  
  193.  *■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■*
  194.  
  195.                      ┌─· ┌──────────────────────────┐ ·─┐
  196.                      ╘══[┤The Coexistence XLink 2.02├]══╛
  197.                          └──────────────────────────┘
  198.  
  199.  *■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■*
  200.  
  201. ("TC-BABES" (T.C.),"Groove" (Fudge),"Hurtless" (TFL-TDV),"BLUES" (sYmptom),
  202.  "The Party 95" and many more tested)
  203.  
  204. First of all, this lib is NOT standard, but having thoughly tested it I can
  205. surely admit it's the best available! (... actually it's the ONLY one
  206. available because other Lib linkers have never been released!)
  207.  
  208. XLC 2.02 adds a standard loader of 2392 Bytes, already pklited+optimized
  209. This loader can be unpacked without problems, so we cannot use fixed offsets.
  210. If exelenght varies from 2300 to 2800 (original=2392; max unpacked=2750)
  211. is worth checking...
  212. Overlay starts with "XLé    " (0x584C0282 0x00000000)
  213. this is the header of lib (off 0)
  214.  
  215. Then a word indicates the # of records (nrec)
  216. another word is the # of exes to be executed (nexe)
  217.  
  218. then at off 16 starts the encrypted part of lib.
  219.  
  220. Decompiling the loader we can see it allocates (nrec << 5 = nrec*32) bytes
  221. then makes a simple decrypting using these instructions:
  222.  
  223. ------------------------------------
  224.            mov     cx,Number_of_rec
  225.            shl     cx,5
  226.            xor     bl,bl
  227.            les     si,Encrypted_data
  228.  
  229. locloop::  sub     es:[si],bl
  230.            inc     bl
  231.            inc     si
  232.            loop    locloop
  233. ------------------------------------
  234.  
  235. after (nrec*32) bytes, (nexe*0x8d) bytes are the executable names that are
  236. executed and can be decrypted also, but we can skip this.
  237.  
  238. Then we have the complete Structure:
  239.  
  240. 00 : 0x584C0282 ("XLé")  Start of lib
  241. 04 : 0x00000000
  242. 08 : # of records (1 word)
  243. 10 : # of exes    (1 word)
  244. 12 : header len?? (1 word) == 0x0010
  245. 14 : Unknown      (1 word)
  246. 16 : Begin of structure:
  247. { Filename: 12 Bytes  (1st entry: "_____XLC@SRT" -> EXE struct)
  248.   filler:    4 bytes
  249.   Lenght     1 dWord  (1st entry: Pointer to EXE struct)
  250.   Start off  1 dWord  (relative offset from Start of lib)
  251.   Filler     2 dWords
  252. } * # of Records
  253. { 0x8d bytes (seems to be fixed) of filenames+parameters
  254.   Filename: 12 bytes
  255.   filler 1 byte
  256.   Parameters: (PASCAL) len+string
  257.  
  258. } * # of exes
  259. Start of file pointed by record #2
  260. ....
  261. EOF
  262.  
  263.  *■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■*
  264.  
  265.                      ┌─· ┌─────────────────────────┐ ·─┐
  266.                      ╘══[┤The Coexistence XLink 1.0├]══╛
  267.                          └─────────────────────────┘
  268.  
  269.  *■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■*
  270.  
  271. ("Contagion" tested)
  272.  
  273. This lib is the Prototype of v2.02, and the structure is simplier...
  274. Overlay starts with 0x584C0081 0x00000000
  275. Then a word indicates the # of records (nrec)
  276. another word is the # of exes to be executed (nexe)
  277. there is no encryption like in 2.02
  278. Then we have the complete Structure:
  279.  
  280. 00 : 0x584C0081  Start of lib
  281. 04 : 0x00000000
  282. 08 : # of records (1 word)
  283. 10 : # of exes    (1 word)
  284. 12 : header len?? (1 word) == 0x0010
  285. 14 : Unknown      (1 word)
  286. 16 : Begin of structure:
  287. { Filename: 12 Bytes  (1st entry: "_____XLC@SRT" -> EXE struct)
  288.   filler:    3 bytes
  289.   Lenght     1 dWord  (1st entry: Pointer to EXE struct)
  290.   Start off  1 dWord  (relative offset from Start of lib)
  291. } * # of Records
  292. { 0x8d bytes (seems to be fixed) of filenames+parameters
  293.   Filename: 12 bytes
  294.   filler 1 byte
  295.   Parameters: (PASCAL) len+string
  296.  
  297. } * # of exes
  298. Start of file pointed by record #2
  299. ....
  300. EOF
  301.  
  302.  
  303.  
  304.  
  305.  *■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■*
  306.  
  307.                     ┌─· ┌─────────────────────────────┐ ·─┐
  308.                     ╘══[┤Pelusa Resource Compiler 0.1ß├]══╛
  309.                         └─────────────────────────────┘
  310.  
  311.  *■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■*
  312.  
  313. ("Fake Demo" tested)
  314.  
  315. Last 4 bytes in Pelusa demo are an absolute offset;
  316. if seeking to this offset there is "REZ■" (52455AFE) we have a Pelusa Res.
  317. library structure... and exactly:
  318. ---------------------------------------
  319. 0: Lib Header: (dWord) Magic 52455AFE
  320. 4: # of records (Word)
  321. { Record structure:
  322.   Filename: 12 Bytes
  323.   Filler  :  4 Bytes
  324.   Start off  dWord (absolute offset)
  325.   Lenght     dWord
  326. } * # of records
  327. start of header (dWord) , absolute offset in file
  328. EOF
  329.  
  330.  
  331.  
  332.  *■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■*
  333.  
  334.                     ┌─· ┌─────────────────────────────┐ ·─┐
  335.                     ╘══[┤ACME Virtual File System 1.0ß├]══╛
  336.                         └─────────────────────────────┘
  337.  
  338.  *■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■*
  339.  
  340. ("BIG Deal","Bug-fixed","Peek-a-Boo" tested; "Bug-fixed" contains only
  341.  encrypted files...)
  342.  
  343. ACME VFS is similar to Xlink. The Header is a loader of variable size, but
  344. never exceeding 2050 bytes. However Overlay starts with some magic bytes:
  345.  
  346. 1 dWord is the Lib offset  (Abs. offset)
  347. 1 Word  is the lib length  (in bytes)
  348. 1 dWord is the # of Records
  349. and 3 bytes are the Lib Magic: "VFS"
  350.  
  351. The lib structure index is encrypted using this method:
  352. ------------------------------------------------------
  353.         mov     cx,Number_of_rec
  354.         les     si,Encrypted_data
  355.         cld
  356. @loop:
  357.         push    cx
  358.  
  359.         mov     cx,0Eh       ; 1st 0Eh bytes = Offset + length
  360.         mov     bl,56h       ; Encr. value
  361. locloop_1:
  362.         xor     es:[si],bl
  363.         inc     si
  364.         loop    locloop_1
  365.  
  366.         mov     cx,0Dh       ; 2nd 0Dh bytes = FileName
  367.         mov     bl,9Dh       ; Encr. value
  368. locloop_2:
  369.         xor     es:[si],bl
  370.         inc     si
  371.         loop    locloop_2
  372.  
  373.         pop     cx
  374.         loop    @loop
  375. ------------------------------------------------------
  376.  
  377. then we have the complete structure:
  378.  
  379. (loader)
  380. 00: Lib offset   1 dWord (Abs. offset)
  381. 04: lib length   1 Word  (in bytes)
  382. 06: # of Records 1 dWord
  383. 0A: Lib Magic "VFS"
  384. [File #1]
  385. ....
  386. [File #x]
  387. {Lib Structure: (Record Len = Liblen / nRec = 27)
  388.  Unknown    1 byte
  389.  Start off  1 dWord (abs)
  390.  Unknown    1 byte  (always 20h, maybe file attribute??)
  391.  Lenght     1 dWord
  392.  Unknown    1 dWord (Maybe file date/time packed ???)
  393.  Filename  12 Bytes
  394.  filler     1 byte
  395. } * # of Rec
  396.  
  397.  *■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■*
  398.  
  399.                             ┌─· ┌─────────────┐ ·─┐
  400.                             ╘══[┤LucasArts GOB├]══╛
  401.                                 └─────────────┘
  402.  
  403.  *■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■*
  404.  
  405.  ("Dark Forces" tested)
  406.  
  407. This is an external lib, files have always a *.GOB extension and at least
  408. can be found in the game "Dark Forces" by LucasArts and his additional
  409. level files.
  410.  
  411. File starts with Magic "GOB"+ LF and a dWord, the Lib Abs. offset
  412. this is the complete structure:
  413.  
  414. 0: Lib Magic: "GOB"+LF (474F4210)
  415. 4: Lib Offset (dWord)
  416. [File #1]
  417. ....
  418. [File #x]
  419. # of records  (dWord) Pointed by Lib offset
  420. {Lib Structure: (Record Len = 21)
  421.  Start off  1 dWord (abs)
  422.  Lenght     1 dWord
  423.  Filename  12 Bytes
  424. }
  425.  
  426.  
  427.  
  428.  *■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■*
  429.  
  430.                            ┌─· ┌───────────────┐ ·─┐
  431.                            ╘══[┤iD Software WAD├]══╛
  432.                                └───────────────┘
  433.  
  434.  *■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■*
  435.  
  436. ("Doom","Doom ][","Heretic","Rise of The Triad" tested)
  437.  
  438. The structure is defined in "The Unofficial DOOM Specs" (DMSPCS10.ZIP)
  439. by Hank Leukart <ap641@cleveland.freenet.edu>
  440. ------------------------------------------------------------------------------
  441. [.......]
  442.  
  443. The first twelve bytes of a Doom *.WAD file (in the shareware version it is
  444. DOOM1.WAD, the registered version's is DOOM.WAD) are as follows:
  445.  
  446. Bytes 0 to 3 - contain the ASCII letters "IWAD" or possibly "PWAD"
  447. Bytes 4 to 7 - contain a long integer which is the number of entries in the
  448. "directory"
  449. Bytes 8 to 11 - contain a pointer to the first byte of the "directory"
  450.  
  451. (Bytes 12 to the start of the directory contain object data)
  452.  
  453. The directory referred to is a list, located at the end of the WAD file,
  454. which contains the pointers, lengths, and names of all the "objects" in the
  455. WAD file. "Objects" means data structures such as item pictures, enemies'
  456. pictures (frames), floor and ceiling textures, wall textures, songs, sound
  457. effects, map data, and many others.
  458.  
  459. For example, the first 12 bytes of the shareware DOOM1.WAD file are:
  460.  
  461. 49 57 41 44 f6 04 00 00 6b e5 3f 00
  462.  
  463. This is "IWAD", then 4f6 hex (=1270 decimal) for # of directory entries, then
  464. 3fe56b (=4187500 decimal) for the first byte of the directory.
  465.  
  466. Each directory entry is 16 bytes long (10 hex), arranged this way:
  467.  
  468. First four bytes: pointer to start of object (a long integer)
  469. Next four bytes: length of object (another long integer)
  470. Last eight bytes: name of object, ending with 00s if not eight bytes.
  471.  
  472. [.......]
  473. ------------------------------------------------------------------------------
  474.  
  475. I must add that if "length of object" is 0 , as in "E1M1" etc. entries, this
  476. object has to be skipped, since it's only a label indicating which level is
  477. defined hereby.
  478. Other skippable objects include shortest ones (sprites names= 8 bytes)
  479. and some entries that have both length and start = 0 (found at least in
  480. "Rise of the Triad")
  481.  
  482. 00: Lib Magic  (dWord) "IWAD" or "PWAD"
  483. 04: # of Recs  (dWord)
  484. 08: Lib Offset (dWord)
  485. [Files]
  486. { Start   :  1 dWord
  487.   length  :  1 dWord
  488.   Filename:  8 bytes
  489. } * # of Recs
  490.  
  491.  *■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■*
  492.  
  493.                         ┌─· ┌────────────────────┐ ·─┐
  494.                         ╘══[┤Cascada VRS Resource├]══╛
  495.                             └────────────────────┘
  496.  
  497.  *■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■▀■▄■*
  498.  
  499. ("Holistic" tested )
  500.  
  501. This is an external Lib. File starts with "CDADAT" +00h +00h and a dWord
  502. indicating the # of recs.
  503.  
  504. This is the structure:
  505.  
  506. 00: Lib Magic  (qWord) (4344414441540000)
  507. 08: # of Recs  (dWord)
  508. { Filename: 12 bytes
  509.   Filler  :  4 bytes
  510.   Start   :  1 dWord
  511.   length  :  1 dWord
  512. } * # of Recs
  513.  
  514.  
  515.  
  516. ****** End of Text ******
  517.