Pc Game Pinball Arcade file .rez

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
ivanzac
Posts: 2
Joined: Thu Jan 31, 2019 11:24 am

Pc Game Pinball Arcade file .rez

Post by ivanzac »

Hello there!
Can somebody provide me with a script for these games? Here's a sample rez file: https://mega.nz/#!GvoVRY7I!GgR249tt5DhQ ... 9lczpbUEGQ
Thanks for your help!
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Pc Game Pinball Arcade file .rez

Post by aluigi »

This format is a mess.

I just leave here a work-in-progress (DOES NOT WORK, DO NOT USE IT) in case I will return on it another day:

Code: Select all

#comtype ???
goto -0x800
get ZERO long
get DUMMY long
get SECTORS long
get DUMMY long
get DUMMY long
goto -0x1000
for i = 0 < SECTORS
    get OFFSET long
    get ZSIZE long
    get SIZE long   # sometimes it's wrong, read it from the first 32bit
    get TYPE short
    get DUMMY short
    get FLAGS long
    get ZERO long

    // 0x0000 = Marker / No Data
    // 0x0001 = CSV or ROM
    // 0x0013 = Resource
    // 0x0018 = Font metrics? [.bin]
    // 0x0022 = Texture
    // 0x0024 = DIM (model file)
    // 0x0025 = WAV or ROM
    // 0x002A = DIL (placement file)
    // 0x002C = DIM (collision file)
    // 0x002F = Samples (What is this??)
    // 0x005F = Version

    #if TYPE == 0x0013
        if ZSIZE == SIZE
            log "" OFFSET SIZE
        else
            # this is valid only for some compressed files, others don't have the SIZE field
            savepos TMP
            goto OFFSET
            get SIZE long
            math OFFSET + 4
            math ZSIZE  - 4
            goto TMP
            #clog "" OFFSET ZSIZE SIZE
            log "compressed/" OFFSET ZSIZE
        endif
    #endif

next i

goto OFFSET
getdstring DUMMY 0x50

math OFFSET = 0
for i = 0
    getdstring NAME 0x60
    if NAME == "1.0"    # wrong but works
        break
    endif
    get SIZE long
    get TSTAMP longlong
    getdstring ZERO 12
    get DUMMY long  # 1/0
    math OFFSET + SIZE
next i
print "%OFFSET|x%"

*edit* script updated
ivanzac
Posts: 2
Joined: Thu Jan 31, 2019 11:24 am

Re: Pc Game Pinball Arcade file .rez

Post by ivanzac »

aluigi wrote:This format is a mess.

I just leave here a work-in-progress (DOES NOT WORK, DO NOT USE IT) in case I will return on it another day:

Code: Select all

goto -0x800
get ZERO long
get DUMMY long
get SECTORS long
get DUMMY long
get DUMMY long
goto -0x1000
for i = 0 < SECTORS
    get OFFSET long
    get ZSIZE long
    get SIZE long
    get DUMMY short
    get DUMMY short
    get FLAGS long
    get ZERO long
next i
goto OFFSET
getdstring DUMMY 0x50
for i = 0
    getdstring NAME 0x60
    get SIZE long
    get TSTAMP longlong
    getdstring DUMMY 0x10
next i




// 0x0000 = Marker / No Data
// 0x0001 = CSV or ROM
// 0x0013 = Resource
// 0x0018 = Font metrics? [.bin]
// 0x0022 = Texture
// 0x0024 = DIM (model file)
// 0x0025 = WAV or ROM
// 0x002A = DIL (placement file)
// 0x002C = DIM (collision file)
// 0x002F = Samples (What is this??)
// 0x005F = Version
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Pc Game Pinball Arcade file .rez

Post by aluigi »

So we have the compression algorithm which is unknown and needs to be figured out.
Then we have the referenced files in the second part of the script that have a total size of 0x16c0d100 bytes that it's probably referred to all the decompressed sectors in the archive.
Too bad it's 19Gb on Steam... not worth at the moment.