goto 0xC get ftable long goto 0x18 get files long goto ftable for i = 0 < files get unk01 long get unk02 long get unk03 long get offset long get null01 long get null02 long get zsize long get size long get unk04 short clog "" offset zsize size next i
here is a small tor sample to test the script
swtor_main_zed_1.zip
EasyMYP is what we normally use to extract the files from tor archives but some people aren't able to extract the gr2 model files with it any more for some reason and this is the only other solution to getting those files extracted.
Any help is appreciated!
edit ok since chrrox says tor files are zlib compressed i figured offzip will work and i was able to extract 229 files from the sample like this offzip.exe -a swtor_main_zed_1.tor C:\offzip\extracted_files 0
# Star Wars - The Old Republic MYP # script for QuickBMS http://quickbms.aluigi.org
idstring "MYP\0" get VERSION long get UNK long get TABLE_OFFSET longlong get MAX_FILES_PER_TABLE long get TOTAL_FILES long goto TABLE_OFFSET do get FILES long if FILES == 0 break endif get NEXT_TABLE_OFF longlong for i = 0 < FILES get OFFSET longlong if OFFSET == 0 break endif get HEADER_SZ long get ZSIZE long get SIZE long get NAME_HASH long get NAME_HASH2 long get DATA_HASH long get COMP_TYPE short savepos TMP goto OFFSET get DATA_TYPE short get DATA_OFF short goto DATA_OFF 0 SEEK_CUR savepos OFFSET string NAME p "%08x_%08x%08x.dat" DATA_HASH NAME_HASH2 NAME_HASH if COMP_TYPE == 0 log NAME OFFSET SIZE else clog NAME OFFSET ZSIZE SIZE endif goto TMP next i goto NEXT_TABLE_OFF while NEXT_TABLE_OFF != 0
Last edited by Acewell on Fri Feb 02, 2018 6:57 pm, edited 2 times in total.
include "func_getTYPE.bms" get BNAME basename idstring "MYP\0" get VERSION long get UNK long get TABLE_OFFSET longlong get MAX_FILES_PER_TABLE long get TOTAL_FILES long goto TABLE_OFFSET do get FILES long if FILES == 0 break endif get NEXT_TABLE_OFF longlong for i = 0 < FILES get OFFSET longlong if OFFSET == 0 break endif get HEADER_SZ long get ZSIZE long get SIZE long get NAME_HASH long get NAME_HASH2 long get DATA_HASH long get COMP_TYPE short savepos TMP goto OFFSET get DATA_TYPE short get DATA_OFF short goto DATA_OFF 0 SEEK_CUR savepos OFFSET string NAME p "%s\%08x_%08x%08x" BNAME DATA_HASH NAME_HASH2 NAME_HASH putVarChr MEMORY_FILE SIZE 0 log MEMORY_FILE 0 0 if COMP_TYPE == 0 log MEMORY_FILE OFFSET SIZE else clog MEMORY_FILE OFFSET ZSIZE SIZE endif callfunction getTYPE 1 get SIZE asize MEMORY_FILE log NAME 0 SIZE MEMORY_FILE goto TMP next i goto NEXT_TABLE_OFF while NEXT_TABLE_OFF != 0
Edit 10:17: more formats added to func_getTYPE.bms
Last edited by AlphaTwentyThree on Mon Jan 10, 2022 10:02 am, edited 2 times in total.
I actually might be able to write a script for retrieving the original file names: inside the swtor_main_gamedata_1.tor there are tons of plain text files with the GUID and corresponding file name. For example:
Added latest func_getTYPE.bms with more specific format, e.g. nodes and particles. Searched for names high and low - looks like the is a lack of file names in those text files, so scrap that for now.