[PS2] Prince of Persia: Warrior Within *.Bin - LZO Compression

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
OAleex
Posts: 52
Joined: Mon Nov 04, 2019 3:18 am

[PS2] Prince of Persia: Warrior Within *.Bin - LZO Compression

Post by OAleex »

Image

Image
Image

I need a script that decodes and then encodes this kind of file compression.
rabatini
Posts: 179
Joined: Tue Jan 18, 2022 12:21 am

Re: [PS2] Prince of Persia: Warrior Within *.Bin - LZO Compression

Post by rabatini »

Try this:

Code: Select all

# POP WW bin decompressor

comtype lzo1x
get NAME basename

For
    get DECOMP_SIZE long
    if DECOMP_SIZE == 0
        break
    endif
    get COMP_ZSIZE long
    savepos OFFSET
string FILENAME P "%NAME%.%dec%"
    clog FILENAME OFFSET COMP_ZSIZE DECOMP_SIZE
    goto COMP_ZSIZE 0 SEEK_CUR
next
OAleex
Posts: 52
Joined: Mon Nov 04, 2019 3:18 am

Re: [PS2] Prince of Persia: Warrior Within *.Bin - LZO Compression

Post by OAleex »

rabatini wrote:Try this:

Code: Select all

# POP WW bin decompressor

comtype lzo1x
get NAME basename

For
    get DECOMP_SIZE long
    if DECOMP_SIZE == 0
        break
    endif
    get COMP_ZSIZE long
    savepos OFFSET
string FILENAME P "%NAME%.%dec%"
    clog FILENAME OFFSET COMP_ZSIZE DECOMP_SIZE
    goto COMP_ZSIZE 0 SEEK_CUR
next


Thanks!