Lost Saga .iop

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Manolper
Posts: 8
Joined: Sat Feb 06, 2016 3:26 pm

Lost Saga .iop

Post by Manolper »

someone can give me a hand on this? is very similar to Zip archives. :?

File :
https://drive.google.com/file/d/0B1iFFi ... sp=sharing
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Lost Saga .iop

Post by aluigi »

Is it just one file or do you have more of them?
Anyway it's just a normal ZIP with a name_len (length of the filename) to which you have to substract 8:
http://aluigi.org/bms/lost_saga_iop.bms
Manolper
Posts: 8
Joined: Sat Feb 06, 2016 3:26 pm

Re: Lost Saga .iop

Post by Manolper »

aluigi wrote:Is it just one file or do you have more of them?
Anyway it's just a normal ZIP with a name_len (length of the filename) to which you have to substract 8:
http://aluigi.org/bms/lost_saga_iop.bms


Nope , that is just for server patchs.
Here is the resources :
https://drive.google.com/file/d/0B1iFFi ... sp=sharing

if i try to unpack with the script only extract one file :
Image

for lostsaga.exe.iop works fine.
Last edited by Manolper on Sat Feb 06, 2016 7:47 pm, edited 1 time in total.
Manolper
Posts: 8
Joined: Sat Feb 06, 2016 3:26 pm

Re: Lost Saga .iop

Post by Manolper »

and another error:
Image
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Lost Saga .iop

Post by aluigi »

The files in this archive are probably encrypted because that data is not deflate.
Manolper
Posts: 8
Joined: Sat Feb 06, 2016 3:26 pm

Re: Lost Saga .iop

Post by Manolper »

aluigi wrote:The files in this archive are probably encrypted because that data is not deflate.


I dont think is encrypted because for the first one (lostsaga.exe.iop) the script works but this ones giving random errors

here is the server_patch.cfg.iop.
https://drive.google.com/file/d/0B1iFFiDLVjb7MzREX2tyU19QcUE/view?usp=sharing
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Lost Saga .iop

Post by aluigi »

rs.iop: offset 0x43, compressed size 0x5491, uncompressed size 0x8375.
That's definitely not deflate and I got no results from my scanner so, yes, it's encrypted.
Manolper
Posts: 8
Joined: Sat Feb 06, 2016 3:26 pm

Re: Lost Saga .iop

Post by Manolper »

aluigi wrote:rs.iop: offset 0x43, compressed size 0x5491, uncompressed size 0x8375.
That's definitely not deflate and I got no results from my scanner so, yes, it's encrypted.


so resources in the client are encrypted but server ones not? very strange... you tried with server_patch.cfg.iop?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Lost Saga .iop

Post by aluigi »

Yeah, both server_patch.cfg.iop and lostsaga.exe.iop are not encrypted, while rs.iop is encrypted.
Maybe the encryption is used only for archives containing multiple files and not for single compressed files.
Manolper
Posts: 8
Joined: Sat Feb 06, 2016 3:26 pm

Re: Lost Saga .iop

Post by Manolper »

aluigi wrote:Yeah, both server_patch.cfg.iop and lostsaga.exe.iop are not encrypted, while rs.iop is encrypted.
Maybe the encryption is used only for archives containing multiple files and not for single compressed files.


I get it how is works, the launcher of the game downloads the single compressed files and encrypt it in rs.iop, maybe i can debug the launcher for redirect the URL of download to mine one and then the launcher encrypt my modified file in rs.iop

but the bms you provided only works for lostsaga.exe.iop , is not working in others single files.
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Lost Saga .iop

Post by Ekey »

Manolper
Posts: 8
Joined: Sat Feb 06, 2016 3:26 pm

Re: Lost Saga .iop

Post by Manolper »

Ekey wrote:http://zenhax.com/viewtopic.php?p=117#p117


i tried to unpack a .iop with that key but says Error: No passwords Found.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Lost Saga .iop

Post by aluigi »

@Ekey

I don't think that one is the key but feel free to check and fix it:

Code: Select all

set ZIP_PASSWORD string "Eg%^io03UT$Cvf921-!$"

goto -0x16
idstring "PK\x05\x06"
        get disk_num        short
        get disk_start      short
        get central_entries short
        get central_entries short
        get central_size    long
        get central_offset  long
        get comm_len        short
        getdstring comment  comm_len

for i = 0 < central_entries
    goto central_offset
    idstring "PK\x01\x02"
        get ver_made        short
        get ver_need        short
        get flag            short
        get method          short
        get modtime         short
        get moddate         short
        get crc             long
        get comp_size       long
        get uncomp_size     long
        get name_len        short
        get extra_len       short
        get comm_len        short
        get disknum         short
        get int_attr        short
        get ext_attr        long
        get rel_offset      long

        savepos TMP
        findloc name_len binary "PK"
        math name_len - TMP
        getdstring name     name_len

    savepos central_offset

    goto rel_offset
    idstring "PK\x03\x04"
        get _ver             short
        get _flag            short
        get _method          short
        get _modtime         short
        get _moddate         short
        get _crc             long
        get _comp_size       long
        get _uncomp_size     long
        get _name_len        short
        get _extra_len       short
        getdstring name     name_len
        #getdstring extra    extra_len
        savepos offset

        encryption zipcrypto ZIP_PASSWORD 1

        if method == 0
            Log name offset uncomp_size
        else
            if method == 8
                ComType deflate
            else
                print "unsupported compression method %method%"
                cleanexit
            endif
            CLog name offset comp_size uncomp_size
        endif

        encryption "" ""
next i
Manolper
Posts: 8
Joined: Sat Feb 06, 2016 3:26 pm

Re: Lost Saga .iop

Post by Manolper »

aluigi wrote:@Ekey

I don't think that one is the key but feel free to check and fix it:

Code: Select all

set ZIP_PASSWORD string "Eg%^io03UT$Cvf921-!$"

goto -0x16
idstring "PK\x05\x06"
        get disk_num        short
        get disk_start      short
        get central_entries short
        get central_entries short
        get central_size    long
        get central_offset  long
        get comm_len        short
        getdstring comment  comm_len

for i = 0 < central_entries
    goto central_offset
    idstring "PK\x01\x02"
        get ver_made        short
        get ver_need        short
        get flag            short
        get method          short
        get modtime         short
        get moddate         short
        get crc             long
        get comp_size       long
        get uncomp_size     long
        get name_len        short
        get extra_len       short
        get comm_len        short
        get disknum         short
        get int_attr        short
        get ext_attr        long
        get rel_offset      long

        savepos TMP
        findloc name_len binary "PK"
        math name_len - TMP
        getdstring name     name_len

    savepos central_offset

    goto rel_offset
    idstring "PK\x03\x04"
        get _ver             short
        get _flag            short
        get _method          short
        get _modtime         short
        get _moddate         short
        get _crc             long
        get _comp_size       long
        get _uncomp_size     long
        get _name_len        short
        get _extra_len       short
        getdstring name     name_len
        #getdstring extra    extra_len
        savepos offset

        encryption zipcrypto ZIP_PASSWORD 1

        if method == 0
            Log name offset uncomp_size
        else
            if method == 8
                ComType deflate
            else
                print "unsupported compression method %method%"
                cleanexit
            endif
            CLog name offset comp_size uncomp_size
        endif

        encryption "" ""
next i


this is what looks like now :
Image
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Lost Saga .iop

Post by Ekey »

aluigi wrote:@Ekey

I don't think that one is the key but feel free to check and fix it:

This a generic password for patch and release IOP archives and here no more keys. In the fact i guess zip crypto algorithm just modified as in Tree of Savior.
rzlizfah
Posts: 2
Joined: Fri Aug 20, 2021 7:23 am

Re: Lost Saga .iop

Post by rzlizfah »

aluigi wrote:The files in this archive are probably encrypted because that data is not deflate.


Hello sir Aluigi , its been a long time but , I still cant fix this problem , I already got the IOP Extractor ( IOP Manager) to extract the .iop extension , but when I try to extract the .iop file , there is an error that say " The file password is wrong , file is encrypted " , I don't know how to fix that , maybe you can help me , thank you.
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Lost Saga .iop

Post by Ekey »

@rzlizfah - Just contact with author of this tool. Also as far as I know, for each local version of game client the passwords are different.
alfims025
Posts: 1
Joined: Thu Sep 09, 2021 5:23 am

Re: Lost Saga .iop

Post by alfims025 »

Ekey wrote:@rzlizfah - Just contact with author of this tool. Also as far as I know, for each local version of game client the passwords are different.


I had the local game password, then how to implement it?
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Lost Saga .iop

Post by Ekey »

What the local version of client are you trying to unpack? Or you can upload IOP file, I'll check it myself
rzlizfah
Posts: 2
Joined: Fri Aug 20, 2021 7:23 am

Re: Lost Saga .iop

Post by rzlizfah »

Ekey wrote:What the local version of client are you trying to unpack? Or you can upload IOP file, I'll check it myself



hello , sir @Ekey , I still didn't solve the problem how to fix it , so this is the IOP file

IOP Manager v1.2 : https://www.mediafire.com/file/3sq3u2mr ... r.exe/file

here my contact if I didn't online or you want to ask some thing :
Discord :hafzirzl#9138

thank you very much in advance