Byvar

eso_zosft_extract_names_by_filenumber.bms

Oct 13th, 2013
193
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. idstring 0 "ZOSFT"
  2. goto 0xA 0 SEEK_CUR #unknown part
  3. endian little
  4. get NUMBER_RECORDS_1 long 0
  5. comtype ZLIB
  6.  
  7. goto 0xA 0 SEEK_CUR
  8. get NUMBER_RECORDS_1 long 0
  9. goto 0x4 0 SEEK_CUR #2nd number records
  10. get BLOCK_SZ long 0
  11. get BLOCK_ZSZ long 0
  12. goto BLOCK_ZSZ 0 SEEK_CUR #skip zlib block
  13. get BLOCK_SZ long 0 # zsz is larger than sz for some reason!
  14. get BLOCK_ZSZ long 0
  15. goto BLOCK_ZSZ 0 SEEK_CUR #skip zlib block
  16. get BLOCK_SZ long 0
  17. get BLOCK_ZSZ long 0
  18. goto BLOCK_ZSZ 0 SEEK_CUR #skip zlib block
  19.  
  20. goto 0xA 0 SEEK_CUR
  21. get NUMBER_RECORDS_2 long 0
  22. goto 0x4 0 SEEK_CUR #2nd number records
  23. get BLOCK_SZ long 0
  24. get BLOCK_ZSZ long 0
  25. goto BLOCK_ZSZ 0 SEEK_CUR #skip zlib block
  26. get BLOCK_SZ long 0
  27. get BLOCK_ZSZ long 0
  28. goto BLOCK_ZSZ 0 SEEK_CUR #skip zlib block
  29. get BLOCK_SZ long 0
  30. get BLOCK_ZSZ long 0
  31. savepos OFFSET 0
  32. clog MEMORY_FILE OFFSET BLOCK_ZSZ BLOCK_SZ 0
  33. goto BLOCK_ZSZ 0 SEEK_CUR #skip zlib block
  34.  
  35. goto 0xA 0 SEEK_CUR
  36. get NUMBER_RECORDS_3 long 0
  37. goto 0x4 0 SEEK_CUR #2nd number records
  38. get BLOCK_SZ long 0
  39. get BLOCK_ZSZ long 0
  40. goto BLOCK_ZSZ 0 SEEK_CUR #skip zlib block
  41.  
  42. if NUMBER_RECORDS_3 != 0
  43. get BLOCK_SZ long 0
  44. get BLOCK_ZSZ long 0
  45. goto BLOCK_ZSZ 0 SEEK_CUR #skip zlib block
  46. get BLOCK_SZ long 0
  47. get BLOCK_ZSZ long 0
  48. goto BLOCK_ZSZ 0 SEEK_CUR #skip zlib block
  49. endif
  50.  
  51. string RENAME_FILENAME = "renamer.bat"
  52. log MEMORY_FILE2 0 0 0
  53.  
  54. get FILENAMES_BLOCK_SIZE long 0
  55. savepos ZOSFT_OFFSET 0
  56. for i = 0 < NUMBER_RECORDS_1
  57. get FILE_NUMBER long MEMORY_FILE
  58. get NAME_OFFSET long MEMORY_FILE
  59. get COMPLEX_NUMBER longlong MEMORY_FILE
  60. math NAME_OFFSET += ZOSFT_OFFSET
  61. goto NAME_OFFSET 0
  62. get NAME string 0
  63. string FILE_NAME == NAME
  64. string FOLDER_NAME == NAME
  65. string FILE_NAME != "/"
  66. string FOLDER_NAME <= "/"
  67. string FOLDER_NAME R= "/" "\
  68. putct "ren __" string -1 MEMORY_FILE2
  69. putct FILE_NUMBER string -1 MEMORY_FILE2
  70. putct ".* " string -1 MEMORY_FILE2
  71. putct FILE_NAME string -1 MEMORY_FILE2
  72. put 10 byte MEMORY_FILE2
  73. putct "robocopy %CD% %CD%" string -1 MEMORY_FILE2
  74. putct FOLDER_NAME string -1 MEMORY_FILE2
  75. putct " " string -1 MEMORY_FILE2
  76. putct FILE_NAME string -1 MEMORY_FILE2
  77. putct " /MOV /NFL /NDL /NJH /NJS /nc /ns /np" string -1 MEMORY_FILE2
  78. put 10 byte MEMORY_FILE2
  79. next i
  80. savepos MEMORY_OFFSET MEMORY_FILE2
  81. log RENAME_FILENAME 0 MEMORY_OFFSET MEMORY_FILE2
RAW Paste Data