SHARE
TWEET

eso_mnf_with_id.bms

Byvar Oct 4th, 2013 209 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. idstring 0 "MES2"
  2. get NAME basename 0
  3.  
  4. endian little
  5. get DUMMY short 0
  6. get NUMBER_DAT_FILES byte 0
  7. get DUMMY long 0
  8. get EOF_OFFSET long 0
  9. goto 0x0A 0 SEEK_CUR #unknown part
  10. endian big
  11. comtype ZLIB
  12. get FILECOUNT long 0
  13. goto 0x4 0 SEEK_CUR #2nd file count
  14.  
  15. get BLOCK_SZ long 0 #block 1 size
  16. get BLOCK_ZSZ long 0 #block 1 compressed size
  17. savepos OFFSET 0
  18. clog MEMORY_FILE OFFSET BLOCK_ZSZ BLOCK_SZ 0
  19. goto BLOCK_ZSZ 0 SEEK_CUR #skip zlib block
  20.  
  21. get BLOCK_SZ long 0 #block 2 size
  22. get BLOCK_ZSZ long 0 #block 2 compressed size
  23. savepos OFFSET 0
  24. clog MEMORY_FILE2 OFFSET BLOCK_ZSZ BLOCK_SZ 0
  25. goto BLOCK_ZSZ 0 SEEK_CUR #skip zlib block
  26.  
  27. get BLOCK_SZ long 0 #block 3 size
  28. get BLOCK_ZSZ long 0 #block 3 compressed size
  29. savepos OFFSET 0
  30. clog MEMORY_FILE3 OFFSET BLOCK_ZSZ BLOCK_SZ 0
  31. goto BLOCK_ZSZ 0 SEEK_CUR #skip zlib block
  32.  
  33. savepos OFFSET 0
  34.  
  35. ###################################### EXTRACTION ######################################
  36. endian little
  37. for i = 0 < FILECOUNT
  38.         get UNKNOWN longlong MEMORY_FILE2 # unknown
  39.         get FILE_SZ long MEMORY_FILE3
  40.         get FILE_ZSZ long MEMORY_FILE3
  41.         get FILE_NAME_HASH long MEMORY_FILE3
  42.         get FILE_OFFSET long MEMORY_FILE3
  43.         get FILE_COMTYPE byte MEMORY_FILE3 # 0 = no compression, 1 = zlib, 2 = snappy
  44.         get FILE_ARCHIVE_NUM byte MEMORY_FILE3
  45.         get DUMMY short MEMORY_FILE3 # unknown
  46.         string ARCHIVE_NAME p= "%s%04d.dat" NAME FILE_ARCHIVE_NUM
  47.         open FDSE ARCHIVE_NAME 1
  48.         for
  49.                 get FILE_ID long MEMORY_FILE
  50.                 if FILE_ID != 0
  51.                         break
  52.                 endif
  53.         next
  54.         math FILE_ID += 1
  55.         string FILE_NAME = "__"
  56.         string FILE_NAME += FILE_ID # unique identification
  57.         if FILE_COMTYPE == 0
  58.         log MEMORY_FILE4 FILE_OFFSET FILE_SZ 1
  59.     elif FILE_COMTYPE == 1
  60.                 comtype ZLIB
  61.                 clog MEMORY_FILE4 FILE_OFFSET FILE_ZSZ FILE_SZ 1
  62.         elif FILE_COMTYPE == 2
  63.                 comtype SNAPPY
  64.                 clog MEMORY_FILE4 FILE_OFFSET FILE_ZSZ FILE_SZ 1
  65.         endif
  66.         getdstring FILETYPE 3 MEMORY_FILE4
  67.         if FILETYPE ^ "RIF"
  68.                 string FILE_NAME += ".wav"
  69.         elif FILETYPE ^ "DDS"
  70.                 string FILE_NAME += ".dds"
  71.         elif FILETYPE ^ "ZOS"
  72.                 string FILE_NAME += ".zosft"
  73.         else
  74.                 string FILE_NAME += ".eso"
  75.         endif
  76.         log FILE_NAME 0 FILE_SZ  MEMORY_FILE4
  77. next i
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top