ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Tue Dec 01, 2020 5:49 am

All times are UTC




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sat Nov 21, 2020 3:43 pm 

Joined: Sat Feb 24, 2018 7:24 am
Posts: 18
Hello there.
Can anyone make a script for attached file?

Header:
10 08 13 50 magic
0x0C - compressed data size
0x18 - first compressed block
0x02F975 - next compressed data size
0x02F981 - second compressed block
etc

comtype falcom


It's difficult to convert this file manually and then combine all the parts.
Game: Ys Celceta

Thanks.


Attachments:
dat, png.rar [1.26 MiB]
Downloaded 18 times
Top
   
 Post subject: Re: dat unpacker
PostPosted: Thu Nov 26, 2020 9:58 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11845
There is something missing in the information you provided since falcom can't work from that offset 0x18.

I tried something and one chunk worked during my tests, anyway feel free to do your tests and let me know when you have the correct offset, compressed and uncompressed size of each chunk so I can fix it:
Code:
# Ys: Memories of Celceta

comtype falcom
idstring "\x10\x08\x13\x50"
get DUMMY long  # 0x200
get DUMMY long  # 0x200

get DAT_SIZE asize
for i = 0
    savepos TMP
    if TMP == DAT_SIZE
        break
    endif

    get TMP basename
    string NAME p "%s_%d." TMP i
    log NAME 0 0

    append
    get ZSIZE long
    get CHUNK_SIZE long # 0x40000
    get CHUNKS long
    for x = 0 < CHUNKS
        get CHUNK_ZSIZE long
        math CHUNK_ZSIZE & 0xffffff
        math CHUNK_ZSIZE - 3

        savepos CHUNK_OFF
        clog NAME CHUNK_OFF CHUNK_ZSIZE CHUNK_SIZE

        math CHUNK_OFF + CHUNK_ZSIZE
        goto CHUNK_OFF

        #get DUMMY byte  # ever 1 except for the last chunk
    next x
    append
next i


Top
   
PostPosted: Thu Nov 26, 2020 10:10 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11845
This one works but I have some doubts:
Code:
# Ys: Memories of Celceta

comtype falcom
idstring "\x10\x08\x13\x50"
get DUMMY long  # 0x200
get DUMMY long  # 0x200

get DAT_SIZE asize
for i = 0
    savepos TMP
    if TMP == DAT_SIZE
        break
    endif

    get TMP basename
    string NAME p "%s_%d." TMP i

    get ZSIZE long
    get SIZE long
    get CHUNKS long

    math SIZE + 1   # bug in the decompression code?

    math ZSIZE - 8

    savepos OFFSET
    clog NAME OFFSET ZSIZE SIZE
    goto ZSIZE 0 SEEK_CUR
next i


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 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