Skip to content

Instantly share code, notes, and snippets.

@donnaken15
Last active April 22, 2022 05:46
Show Gist options
  • Save donnaken15/5eb8a19b975fff2d2bcf076caf2c6c6c to your computer and use it in GitHub Desktop.
Save donnaken15/5eb8a19b975fff2d2bcf076caf2c6c6c to your computer and use it in GitHub Desktop.
quickbms script to extract a GH3 tex's texture files and their (non-DDS properties) and make it rebuildable with buildtex
endian big
get magic long # 0x00
get unk1 short # 0x04
get unk2 byte # 0x06
get count byte # 0x07, max 0x80 textures??
get moff long # 0x08
get unk3 long # 0x0C
get xFFFF long # 0x10
get unk4 long # 0x14
get a1C long # 0x18
goto moff SEEK_SET
string config p "%08X%c" magic 0xD
string cfgtmp p "%04X%02X%02X%c" unk1 unk2 count 0xD
string config + cfgtmp
string cfgtmp p "%08X%c" moff 0xD
string config + cfgtmp
string cfgtmp p "%08X%c" unk3 0xD
string config + cfgtmp
string cfgtmp p "%08X%c" xFFFF 0xD
string config + cfgtmp
string cfgtmp p "%08X%c" unk4 0xD
string config + cfgtmp
string cfgtmp p "%08X%c" a1C 0xD
string config + cfgtmp
math count + 1
for i = 1 < count
get axA2802 long
get key long
get width short
get height short
string cfgtmp p "%08X,%04X%04X," key width height
string config + cfgtmp
get t_unk1 short
get width2 short
get height2 short
string cfgtmp p "%04X%04X" width2 height2
string config + cfgtmp
get t_unk2 short
string cfgtmp p "%04X" t_unk2
string config + cfgtmp
get t_unk3 byte # forgot if this is mipmaps value
get t_unk4 short # changes sometimes with DXT format
string cfgtmp p "%02X%04X%c" t_unk3 t_unk4 0xD
string config + cfgtmp
get t_unk5 byte
get t_unk6 long
get t_off long
get t_len long
get t_unk7 long
string fname p "%08u.dds" i
log fname t_off t_len
next i
log "config.txt" 0 0
open "." "config.txt" cfgio
strlen cnflen config
putdstring config cnflen "config.txt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment