Hi again, i have one more question about this script i use to split stx textures from the pak archives in Revenge of the Sith game.
Code:
findloc OFFSET binary "\x53\x54\x58\x00"
do
goto OFFSET
get DUMMY long
findloc NEXT_OFFSET binary "\x53\x54\x58\x00" 0 ""
if NEXT_OFFSET == ""
get SIZE asize
else
math SIZE = NEXT_OFFSET
endif
math SIZE -= OFFSET
string NAME p "%08x.stx" OFFSET
log NAME OFFSET SIZE
math OFFSET = NEXT_OFFSET
while NEXT_OFFSET != ""
The script currently writes out texture filenames in the order they were split as hexadecimal, i would like to give the textures back their original name which happens to be included in the header for each texture as a string starting at 0x40 where 40 bytes of space is reserved for this string data. the unused bytes are 00 until 0x68.
How can i grab the string at 0x40 and prepend that to the extension during the splitting process? or will this require another script?
this is example of the first 7 lines of stx header which includes the file name string (S_Main_highlight_yellow)
Code:
53 54 58 00 04 00 00 00 00 00 00 00 00 01 00 00
20 00 00 00 00 01 00 00 20 00 00 00 E4 00 00 00
00 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00
03 00 00 00 80 80 00 00 80 00 00 00 56 00 00 00
53 5F 4D 61 69 6E 5F 68 69 67 68 6C 69 67 68 74
5F 79 65 6C 6C 6F 77 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 02 00 00 00 0A 00 00 00
Thank you for any help
