ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Tue Apr 13, 2021 6:51 am

All times are UTC




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Dec 24, 2020 8:58 pm 

Joined: Thu Dec 24, 2020 8:40 pm
Posts: 5
Based on viewtopic.php?f=9&t=213&hilit=luap I tried to export the file from the LuaScripts.luap file but the package released for xbox360 is different.
If I use the script for pc works but on luap cannot find anything also if I think that the file package is similar as I can see that some things are very similar.

Experimenting showed that the FILES variable with the luap file from xbox360 it is a long number negative -1358954496 instead on the pc for the same file is 321 (the size is different).

https://filetransfer.io/data-package/Dfy0Gtrs#link

At that link there is a zip package with the pc version and the xbox360 to do a comparison and in the meantime I will keep investigating, but I am not sure about what are the difference, if files is negative the loop doesn't work, if I force the loop with a fixed number there is another error Can't read 12 bytes from offset 5f0e0000.

I tested comtype-scan.bms with no results, wondering if the file is signed so cannot scan like the pc version.


Top
   
PostPosted: Thu Dec 24, 2020 10:15 pm 

Joined: Thu Dec 24, 2020 8:40 pm
Posts: 5
So on my investigation also about how quickbms works, get FILES long takes the first 4 bytes that is
Code:
4101 = 321
in this way does the loop but on the xbox version those 4 bytes are
Code:
0000
, so probably the file number is in another byte.


Top
   
PostPosted: Thu Dec 24, 2020 11:11 pm 

Joined: Thu Dec 24, 2020 8:40 pm
Posts: 5
Other investigation showed that the end of the files it's the same so I am testing in a different way, with ignoring the first bytes of the file:
Code:
get TEMP threebyte
get FILES byte
print "%FILES%"

for i = 0 < FILES
    getdstring HASH 8
    get DUMMY threebyte
    get OFFSET long # is 3679 should be around 6740
    math OFFSET s 2
    get SIZE threebyte # 00 00 D8 04 instead of 00 00 04 D8
    math SIZE s 2
    get DUMMY2 byte
    get XSIZE threebyte
    math XSIZE s 2
    print "%OFFSET% %OFFSET|h%"
    print "%SIZE% %SIZE|h%"
    print "%XSIZE% %XSIZE|h%"

    savepos TMP
    goto OFFSET
    getdstring DUMMY 12
    get NAMESZ long
    getdstring NAME NAMESZ
    string NAME | ":"
    goto TMP

    log NAME OFFSET SIZE
next i


Searching for .lua in the pc version there are 332 reference and in the xbox360 instead 186, as we know that the pc version is 321 probably the xbox version is around 186 and as this snippet the files are 175. I think that I am near also because seems that the first file is the same by name in both so size should be similar is just to define the dummy bytes to me.

I just need a bit of help on understanding how to swap the bytes, as I can see the values are mirrored compared to the pc version.


Top
   
PostPosted: Sat Dec 26, 2020 4:00 pm 

Joined: Thu Dec 24, 2020 8:40 pm
Posts: 5
I am almost, break with the last file but I am right to the end.
Code:
get FILES long
reverselong FILES
print "%FILES%"

for i = 0 < FILES
    getdstring HASH 8
    get OFFSET long
    reverselong OFFSET
    get SIZE long
    reverselong SIZE
    get XSIZE long
    reverselong XSIZE
    get DUMMY byte
    print "%OFFSET% %OFFSET|h%"

    savepos TMP
    goto OFFSET
    get NAMESZ short
    getdstring DUMMY 12
    print "%NAMESZ% %NAMESZ|h%"
    getdstring NAME NAMESZ
    print "%NAME% %NAME|h%"
    string NAME | ":"
    goto TMP

    log NAME OFFSET SIZE
next i


Top
   
PostPosted: Sat Dec 26, 2020 4:45 pm 

Joined: Thu Dec 24, 2020 8:40 pm
Posts: 5
To avoid any troubles I put a fixed value to look for the filename to avoid issues.

Code:
get FILES long
reverselong FILES

for i = 0 < FILES
    getdstring HASH 8
    get OFFSET long
    reverselong OFFSET
    get SIZE long
    reverselong SIZE
    get XSIZE long
    reverselong XSIZE
    get DUMMY byte

    savepos TMP
    goto OFFSET
    set NAMESZ 120 # fixed value because the data is not consistent
    getdstring DUMMY 17
    getdstring NAME NAMESZ
    string NAME | ":"
    goto TMP

    log NAME OFFSET SIZE
next i


This extractor works :-D


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 5 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:
Powered by phpBB® Forum Software © phpBB Limited