God Eater2 (*.rdp, *.res)

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
sigroon365
Posts: 330
Joined: Fri Nov 21, 2014 4:03 am

God Eater2 (*.rdp, *.res)

Post by sigroon365 »

I made bms script for *.res files. But it had some errors.
Data file https://drive.google.com/file/d/0B8iw-j0BGWKIMnBHeHZCWjFyaFU/view?usp=sharing

Code: Select all

#BMS script for system.res
idstring "Pres"
get Headersize long
get UNK1 long
get UNK2 long
get datastart long

goto 0x28
get tbloff3 long

goto 0x48
get tbloff2 long

goto 0xE0
savepos tbloff1

xmath files "(tbloff2 - tbloff1) / Headersize"

for i = 0 < files
    get OFFSET short
    get UNK3 short
    get ZSIZE long
    get noff long
    savepos tmp

    goto noff
    get namstart long
    get extstart long
    get extend long
    xmath namlength "extstart - namstart - 1"
    xmath extlength "extend - extstartf - 1"

    goto namstart
    getdstring name namlength

    goto extstart
    getdstring ext extlength

get packname filename
   string packname += _unpacked/
   string packname += name
   string packname += "."
   string packname += "ext"

    goto tmp
    get UNK4 long
    get null longlong
    get null long
    get SIZE long

  if SIZE == ZSIZE
        log packname OFFSET SIZE
    else
       
        string packname p "unknown_compression/%s" packname
        log packname OFFSET ZSIZE
    endif

next i


Image

Image

I guess that the number of files in system.res is 96h = 150. And I'm not sure 1D 00 00 00 at 34h is files long.
Also don't know about compression. And *.rdp file is a package of idstring "Pres" files.
But it's structure is different from system.res file.

Press1 is 800h to 8800h of data.rdp

Code: Select all

#BMS script for Press1
idstring "Pres"
get Headersize long
get UNK1 long
get UNK2 long
get datastart long

goto 0x34
get files long [b]#It is different from system.res file.[/b]

goto 0x60 [b]#Start point is different from system.res and don't know how to calculate it.[/b]

for i = 0 < files
    get OFFSET short
    get UNK3 short
    get ZSIZE long
    get noff long
    savepos tmp

    goto noff
    get namstart long
    get extstart long
    get extend long
    xmath namlength "extstart - namstart - 1"
    xmath extlength "extend - extstartf - 1"

    goto namstart
    getdstring name namlength

    goto extstart
    getdstring ext extlength

get packname filename
   string packname += _unpacked/
   string packname += name
   string packname += "."
   string packname += "ext"

    goto tmp
    get UNK4 long
    get null longlong
    get null long
    get UNK5 long  [b]#I think it is SIZE, but can't unpack.[/b]

log packname OFFSET ZSIZE

next i


Image

<Press1 structure form>
Image

And there are another case.
Press_x is 9800h to A000h of data.rdp

Start point is 0x80. And 62 57 is not offset.
<Press_x structure form>
Image
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: God Eater2 (*.rdp, *.res)

Post by aluigi »

I think that there is an index file for data.rdp.
If you can upload it I have the script ready.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: God Eater2 (*.rdp, *.res)

Post by aluigi »

In case you can't find the index file I have written a scanner.
It works but it's not like having the index file because many names are missing and everything is just "guessed" (guessed means that a small percentage is wrong):

When I will have the index file I will update it:
http://aluigi.org/papers/bms/others/god_eater_2.bms
sigroon365
Posts: 330
Joined: Fri Nov 21, 2014 4:03 am

Re: God Eater2 (*.rdp, *.res)

Post by sigroon365 »

aluigi wrote:In case you can't find the index file I have written a scanner.
It works but it's not like having the index file because many names are missing and everything is just "guessed" (guessed means that a small percentage is wrong):

When I will have the index file I will update it:
http://aluigi.org/papers/bms/others/god_eater_2.bms


Image

Here are all other files except eboot or prx module files.
https://drive.google.com/file/d/0B8iw-j0BGWKIVlVmaHowTlFrTjA/view?usp=sharing

<package.rdp information>
Image
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: God Eater2 (*.rdp, *.res)

Post by aluigi »

Apparently there is no index file. Anyway the script/scanner works with both the archives so it's not that bad.
sigroon365
Posts: 330
Joined: Fri Nov 21, 2014 4:03 am

Re: God Eater2 (*.rdp, *.res)

Post by sigroon365 »

aluigi wrote:Apparently there is no index file. Anyway the script/scanner works with both the archives so it's not that bad.


Yes. It works. THK :mrgreen:
Jicks
Posts: 3
Joined: Tue Oct 21, 2014 5:18 am

Re: God Eater2 (*.rdp, *.res)

Post by Jicks »

I'm working on an extractor for God Eater/ Gods Eater Burst, and the file structure seems the same. I use system.res as the entry point, and some of it's entries point to the package.rdp(no data.rdp in GE1), which itself contains more .res files. The compression is done using GZip in GE1. Here's a 010 Editor template and a QuickBMS script for .res files: https://mega.co.nz/#F!i9tyAB6B!H8xjOij_uYU53fN0CRhr_Q

I haven't tested the QuickBMS script in a while so idk if it even works. The 010 template seems to work for your system.res file.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: God Eater2 (*.rdp, *.res)

Post by aluigi »

What I don't get is how system.res points to the rdp archive, I don't see these references.
There are 4 bits in the OFFSET field that are used as flags and must be considered while extracting the files.
Jicks
Posts: 3
Joined: Tue Oct 21, 2014 5:18 am

Re: God Eater2 (*.rdp, *.res)

Post by Jicks »

Right after header, at offset pointed by int after magicNum is the group table. The group table is divided into 8 filetable offsets and fileCount (= two 32bit uint).
Files belonging to groups 0, 1 and 4 are located in package.rdp. The rest of the groups are located inside the .res file that owns the group table.
Additionally, offsets in groups 0, 1 and 4 are actually block indexes. Block size is 32768 bytes, so the resulting offset in package.rdp is readInt * 32768.
Group 5 contains small table files which I haven't been able to figure out, but their size is noted in 32bit words, so the real size is readInt * 4.

Do you mean fileoffset by OFFSET field? I don't see flags there. All values seem to be stored in positive 32bit uint/int and right after fileoffset there is filesize.

The bms script is unfinished because I couldn't find a way to load two files into QuickBMS. The 010 script works much better, though it doesn't support two files either.
Jicks
Posts: 3
Joined: Tue Oct 21, 2014 5:18 am

Re: God Eater2 (*.rdp, *.res)

Post by Jicks »

Coldbird on gbatemp.net has made tools for GE2 that he is apparently going to release later.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: God Eater2 (*.rdp, *.res)

Post by aluigi »

On GE2 you can see the offsets having a 0xc0000000 mask.
With quickbms it's possible to load multiple files with the Open command and assigning them a different file number, for example
open FDSE "file.txt"
get DUMMY long
open FDSE "file2.txt" 1
get DUMMY long 1