ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Mon Jul 24, 2017 4:48 am

All times are UTC




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Thu Nov 03, 2016 9:12 pm 

Joined: Thu Nov 03, 2016 9:05 pm
Posts: 3
My first bms script extracts each texture file from Burnout 3's .TXD files. Here it is:
Code:
get null longlong
get texCount long
get ten long

for i = 0 < texCount
   savepos REMEMBER
   get fileNo long
   get null0 long
   get fileOff long
   get null1 long
   
   goto fileOff
   
   get null2 long
   get twoFiddy long
   get fileLength long
   math tempVar = fileOff
   math tempVar += 0x9D
   
   goto tempVar
   
   getCT NAME string 0x0
   
   log NAME fileOff fileLength
   
   math REMEMBER += 0x10
   goto REMEMBER
next i

The files are extracted, alright, but they don't get given the names I want them to be given. Instead, they're just given the automatically generated names. I can't post FRONTEND.TXD or GLOBAL.TXD here due to copyright issues, but if anyone else has Burnout 3, I'd be delighted if I could receive some help with this.

And I know, the script is awful, but it's not too bad for my first one IIDSSM ;) ;) ;).


Top
   
PostPosted: Thu Nov 03, 2016 11:14 pm 

Joined: Thu Nov 03, 2016 9:05 pm
Posts: 3
Code:
get null longlong
get texCount long
get ten long

for i = 0 < texCount
   savepos REMEMBER
   get fileNo long
   get null0 long
   get fileOff long
   get null1 long
   
   goto fileOff
   
   get null2 long
   
   get something long
   
   get fileLength long
   
   math tempVar = fileOff
   math tempVar += 0xA8
   
   goto tempVar
   
   getdstring NAME 0x18
   string NAME + ".txd"   //Don't know what the actual extension is.
   
   log NAME fileOff fileLength
   
   math REMEMBER += 0x10
   goto REMEMBER
next i


I managed to fix the issue, although I would like to be able to use getCT string so I don't read any more data than I need to.


Top
   
PostPosted: Fri Nov 04, 2016 6:14 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6252
If the names have a fixed size then you have to use getdstring NAME FIXED_SIZE.
Post a sample in case you still have problems.


Top
   
PostPosted: Fri Nov 04, 2016 12:27 pm 

Joined: Thu Nov 03, 2016 9:05 pm
Posts: 3
aluigi wrote:
If the names have a fixed size then you have to use getdstring NAME FIXED_SIZE.
Post a sample in case you still have problems.


The names are of various sizes. Here's FRONTEND.txd from Burnout 3:
https://drive.google.com/open?id=0B3AFe ... 3hZWHlPLUE

The script works perfectly fine, but I'd like to be able to use getCT in the future.


Top
   
PostPosted: Fri Nov 04, 2016 1:21 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6252
Why getct?
get NAME string


Top
   
PostPosted: Fri Nov 04, 2016 9:18 pm 
User avatar

Joined: Fri Aug 08, 2014 1:06 am
Posts: 298
i'm seeing a problem with your filelength, some extracted files are zero bytes, the
long integer before the string name looks like the correct size and works with all but

Volumebar
B3Logo
finish
EATrax
coronaglow

where the size exceeds the data by 64 bytes, there must be a flag or something that signals this :|

Code:
goto 0x8
get FILES long
get SKIP long
for i = 0 < FILES
    get SKIP long
    get SKIP long
    get OFFSET long
    get SKIP long
    savepos TMP
    goto OFFSET
    savepos TMP2
    math TMP2 + 164
    goto TMP2
    get SIZE long
    get NAME string
    string NAME + ".tex"
    log NAME OFFSET SIZE
    goto TMP
next i


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

All times are UTC


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:
cron
Powered by phpBB® Forum Software © phpBB Limited