Advertisement
alcea

BMS Data extract (for fdata files)

Mar 26th, 2025 (edited)
5
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. https://reshax.com/topic/1829-atelier-yumia/
  2. https://reshax.com/topic/303-fatesamurai-remnant-fdata/#comment-970
  3. https://github.com/LittleBigBug/QuickBMS/releases
  4. ---------
  5.  
  6. Comtype ZLIB
  7. Get FILETOTALSIZE asize
  8.  
  9. if FILETOTALSIZE > 128
  10.  
  11. Set IDRKOFFSET long 0x10
  12.  
  13. Do
  14.  
  15. Goto IDRKOFFSET
  16. Print "%IDRKOFFSET%"
  17. Getdstring MAGICVERSION 8
  18. Get ENTRYSIZE longlong
  19. Get COMPSIZE longlong
  20. Get DECOMPSIZE longlong
  21. Get ENTRYTYPE long
  22. Get FILEKTID long
  23. Get TYPEINFOKTID long
  24. Set SKIP long ENTRYSIZE
  25. Math SKIP - COMPSIZE
  26. Math SKIP - 0x2C
  27. Goto SKIP 0 SEEK_CUR
  28. Savepos TEMP
  29. Print "%TEMP%"
  30.  
  31. String FNAME p "0x%08x." FILEKTID
  32. String FEXT p "%08x" TYPEINFOKTID
  33.  
  34. If TYPEINFOKTID == 0x563bdef1
  35. Set FULLNAME string "g1m/"
  36. String FNAME + "g1m"
  37. String FULLNAME + FNAME
  38.  
  39. Elif TYPEINFOKTID == 0x6fa91671
  40. Set FULLNAME string "g1a/"
  41. String FNAME + "g1a"
  42. String FULLNAME + FNAME
  43.  
  44. Elif TYPEINFOKTID == 0xafbec60c
  45. Set FULLNAME string "g1t/"
  46. String FNAME + "g1t"
  47. String FULLNAME + FNAME
  48.  
  49. Elif TYPEINFOKTID == 0x20a6a0bb
  50. Set FULLNAME string "kidsobjdb/"
  51. String FNAME + "kidsobjdb"
  52. String FULLNAME + FNAME
  53.  
  54. Elif TYPEINFOKTID == 0x5153729b || TYPEINFOKTID == 0xb340861a
  55. Set FULLNAME string "mtl/"
  56. String FNAME + "mtl"
  57. String FULLNAME + FNAME
  58.  
  59. Elif TYPEINFOKTID == 0x8e39aa37 || TYPEINFOKTID == 0xbe144b78
  60. Set FULLNAME string "ktid/"
  61. String FNAME + "ktid"
  62. String FULLNAME + FNAME
  63.  
  64. Elif TYPEINFOKTID == 0x56efe45c || TYPEINFOKTID == 0xbbf9b49d
  65. Set FULLNAME string "grp/"
  66. String FNAME + "grp"
  67. String FULLNAME + FNAME
  68.  
  69. Elif TYPEINFOKTID == 0xbbd39f2d
  70. Set FULLNAME string "srsa/"
  71. String FNAME + "srsa"
  72. String FULLNAME + FNAME
  73.  
  74. Elif TYPEINFOKTID == 0x0d34474d
  75. Set FULLNAME string "srst/"
  76. String FNAME + "srst"
  77. String FULLNAME + FNAME
  78.  
  79. Else
  80. Set FULLNAME string FEXT
  81. String FULLNAME + "/"
  82. String FNAME + FEXT
  83. String FULLNAME + FNAME
  84. Endif
  85.  
  86. Savepos OFFSET
  87.  
  88. If COMPSIZE == DECOMPSIZE
  89.  
  90. Get MAGIC long 0 OFFSET
  91. If MAGIC == 1194412127
  92. Set FULLNAME string "g1h/"
  93. String FNAME p "0x%08x." FILEKTID
  94. String FNAME + "g1h"
  95. String FULLNAME + FNAME
  96. Endif
  97. Log FULLNAME OFFSET DECOMPSIZE
  98.  
  99. Else
  100.  
  101. Set MEMORY_FILE binary ""
  102. Append
  103. Do
  104. Get ZSIZE short
  105. Get Junk longlong
  106. Savepos OFFSET
  107. If DECOMPSIZE > 16384
  108. Clog MEMORY_FILE OFFSET ZSIZE 16384
  109. Math DECOMPSIZE - 16384
  110. Else
  111. Clog MEMORY_FILE OFFSET ZSIZE DECOMPSIZE
  112. Math DECOMPSIZE - DECOMPSIZE
  113. Endif
  114. Math OFFSET + ZSIZE
  115. Goto OFFSET
  116. While DECOMPSIZE > 0
  117. Append
  118.  
  119. Get LSIZE asize MEMORY_FILE
  120. GetVarChr MAGIC MEMORY_FILE 0 long
  121. Print "%MAGIC%"
  122. If MAGIC == 1194412127
  123. Set FULLNAME string "g1h/"
  124. String FNAME p "0x%08x." FILEKTID
  125. String FNAME + "g1h"
  126. String FULLNAME + FNAME
  127. Endif
  128. Log FULLNAME 0 LSIZE MEMORY_FILE
  129. Endif
  130.  
  131. Math ENTRYSIZE x 0x10
  132. Math IDRKOFFSET + ENTRYSIZE
  133.  
  134. While IDRKOFFSET < FILETOTALSIZE
  135.  
  136. Endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement