XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Mon Oct 23, 2017 5:32 am

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Microsoft Direct x Xof extractor
PostPosted: Sun Jun 10, 2012 5:28 pm 
Offline
Moderator
User avatar

Joined: Sun May 18, 2008 3:01 pm
Posts: 2434
Has thanked: 56 times
Have thanks: 1185 times

this will create a cab file you can extract from any compressed . x file.
then just add the proper 0x10 byte header for a uncompressed .x file and it will load no problem.
Code:
the header depends on the file format
most likely
xof 0303txt 0032
or
xof 0303bin 0032
or in hex
78 6F 66 20 30 33 30 33 74 78 74 20 30 30 33 32
or
78 6F 66 20 30 33 30 33 62 69 6E 20 30 30 33 32

http://paulbourke.net/dataformats/directx/


Code:
#quickbms script
set MEMORY_FILE binary "\x4D\x53\x43\x46\x00\x00\x00\x00\x41\x48\x00\x00\x00\x00\x00\x00\x2C\x00\x00\x00\x00\x00\x00\x00\x03\x01\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x74\x3D\x6C\x4B\x20\x00"
get NAME FILENAME
goto 0x3C MEMORY_FILE
append
put NAME string MEMORY_FILE
append
get SIZE asize MEMORY_FILE
string NAME + .cab
putVarChr MEMORY_FILE 0x24 SIZE long
set CHECKSUM 0
set CHUNKCOUNT 0
set USIZE 0
goto 0x14
get tmp2 asize
append
for
goto SIZE MEMORY_FILE
get CSIZE short
get ZSIZE short
putVarChr MEMORY_FILE SIZE CHECKSUM long
math SIZE + 4
putVarChr MEMORY_FILE SIZE ZSIZE short
math SIZE + 2
putVarChr MEMORY_FILE SIZE CSIZE short
math SIZE + 2
savepos OFFSET
goto SIZE MEMORY_FILE
log MEMORY_FILE OFFSET ZSIZE
math OFFSET + ZSIZE
goto OFFSET
math SIZE + ZSIZE
math CHUNKCOUNT + 1
math USIZE + CSIZE
savepos tmp
if tmp == tmp2
append
putVarChr MEMORY_FILE 0x28 CHUNKCOUNT byte
get SIZE asize MEMORY_FILE
putVarChr MEMORY_FILE 0x8 SIZE long
putVarChr MEMORY_FILE 0x2C USIZE long
log NAME 0 SIZE MEMORY_FILE
cleanexit
endif
next


You can make the ads go away by registering



Top
 Profile  
 
 Post subject: Re: Microsoft Direct x Xof extractor
PostPosted: Tue Nov 22, 2016 7:08 pm 
Offline
VIP member
VIP member

Joined: Wed Nov 05, 2008 12:16 pm
Posts: 897
Has thanked: 1884 times
Have thanks: 475 times
made a bms script to decompress the tzip/bzip back to txt or bin .x file :D
Code:
get NAME basename
string NAME + "_decomp.x"

set MEMORY_FILE binary "\x78\x6f\x66\x20\xAA\xAA\xBB\xBB\xCC\xCC\xCC\xCC\xDD\xDD\xDD\xDD"

comtype mszip
get ZSIZE asize
idstring "xof "
get MAJORVERSION short
get MINORVERSION short
getdstring FORMATTYPE 0x4
get FLOATSIZE long
get SIZE long
math OFFSET = 0x18
math ZSIZE - OFFSET

if FORMATTYPE == "tzip"
   FORMATTYPE = 0x20747874 #"txt "
elif FORMATTYPE == "bzip"
   FORMATTYPE = 0x206e6962 #"bin "
endif

putVarChr MEMORY_FILE 0x4 MAJORVERSION short #AAAA
putVarChr MEMORY_FILE 0x6 MINORVERSION short #BBBB
putVarChr MEMORY_FILE 0x8 FORMATTYPE long #CCCCCCCC
putVarChr MEMORY_FILE 0xc FLOATSIZE long #DDDDDDDD

log NAME 0 0x10 MEMORY_FILE
append
clog NAME OFFSET ZSIZE SIZE

the decompressed file is ready for import by most directX .x plugins


_________________
Noesis
Hex2obj
QuickBMS
TextureFinder
Unity Assets Bundle Extractor


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group