Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding
You last visited: Today at 04:59

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Opening a .IOP File

Discussion on Opening a .IOP File within the General Coding forum part of the Coders Den category.

Reply
 
Old   #1
 
LepEatWorld's Avatar
 
elite*gold: 0
Join Date: Apr 2017
Posts: 76
Received Thanks: 25
Opening a .IOP File

So, I currently tried to open an IOP file but for some reason I cant seem to you know... get it open. I'm able to open it as a Zip, but if I do the file contains 0bites. When I open it with Notepad++ it's kind of encrypted? Not sure at this point. But when I open it with it shows me the files inside and then it stops and shows me the Zip files instead...

This is an example of the files that should be inside the IOP.

Thanks for the help in advance to whoever can help.
LepEatWorld is offline  
Old 10/30/2019, 21:51   #2
 
elite*gold: 0
Join Date: Apr 2011
Posts: 363
Received Thanks: 167
Quote:
Originally Posted by LepEatWorld View Post
So, I currently tried to open an IOP file but for some reason I cant seem to you know... get it open. I'm able to open it as a Zip, but if I do the file contains 0bites. When I open it with Notepad++ it's kind of encrypted? Not sure at this point. But when I open it with it shows me the files inside and then it stops and shows me the Zip files instead...

This is an example of the files that should be inside the IOP.

Thanks for the help in advance to whoever can help.
Edit: Sorry im late, made python script instead

The file is PK, means with zlib can be unpacked, but its a modified PK format, it has the following file format

|4 bytes | 1 byte |0xD bytes| 4 bytes | 4 bytes | 4 bytes | variable size bytes | variable size bytes|
|PK SIGNATURE|filenamelen|unknown |compressed_size|uncompressed_size| unk2 | filename | data |


Code:
import zlib
import os

f = open("rs.iop","rb")

#zlib header
pkHeader = b"\x50\x4b\x03\x04"

print("Unpacking...")

while True:
    header = f.read(4)
    if header != pkHeader:
        break
    filenamelen = int.from_bytes(f.read(1),byteorder="little")
    #skip bytes
    f.read(0xD)
    filesize = int.from_bytes(f.read(4),byteorder="little")
    #skip bytes
    f.read(8)
    filename = f.read(filenamelen).decode("utf-8")
    if filesize == 0:
        try:
            os.mkdir(filename)
        except:
            pass
    else:
        fo = open(filename,"wb")
        print(filename)
        data = f.read(filesize)
        try:
            decompressed = zlib.decompress(data,-15)
            fo.write(decompressed)
        except:
            #can't uncompress data, write plain
            fo.write(data)
        fo.close()

f.close()

print("Done!")
elmarcia is offline  
Thanks
1 User
Old 10/31/2019, 13:01   #3
 
LepEatWorld's Avatar
 
elite*gold: 0
Join Date: Apr 2017
Posts: 76
Received Thanks: 25
Thanks for the help, haven’t tested it yet since I havent had time but I’ll check it tomorrow after Halloween ���� Thanks again.
LepEatWorld is offline  
Old 10/31/2019, 15:22   #4
 
elite*gold: 0
Join Date: Apr 2011
Posts: 363
Received Thanks: 167
Np, if you need to pack it again will need to figure out unknown bytes, i assume 4 of them is for CRC the file name len is 2bytes not 1 like i said, but used one cause max path is 255. And make a script for the reverse process.

elmarcia is offline  
Reply


Similar Threads Similar Threads
anyone post here the file of editing file.. the .edf file
07/13/2013 - RF Online - 3 Replies
please post here... so that i can download again.. i guess the old one thread was gone.. i've been search for an hour in this section.. but i can't see it... thanks..
Dofus Str Iop lvl 118 Str S. Nehra
08/10/2011 - Trading - 4 Replies
Guten Tag, ich vk einen Stärke Iop auf dem Server Nehra. Str geskillt und wis auf 25 gescrollt. Mit 10 ap Set. Wär Interesse hätte und das mit dem Preis wissen will pls add mich einfach auf Skype. Name:
Dofus Account iop lvl 194 Pouchcote
03/01/2010 - Trading - 4 Replies
Hello iam selling dofus Account iop lvl 194 contact me for more info:)



All times are GMT +1. The time now is 05:00.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.