Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Lunar PSP Zlib Compressed file...

Read or post about compression. And decompression. Or ask questions how to decompress your files.
Post Reply
caws
veteran
Posts: 120
Joined: Sat Mar 01, 2008 7:57 pm
Been thanked: 4 times

Lunar PSP Zlib Compressed file...

Post by caws »

Well, this file is compressed with zlib, it starts at 16 but the header seems to be cuted out.

Can anyone help me out??

Thanks.!
You do not have the required permissions to view the files attached to this post.
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1422 times

Re: Lunar PSP Zlib Compressed file...

Post by chrrox »

here you go :)
quickbms script

Code: Select all

for i = 1 < 2
goto 0xA
get name string
savepos offset
goto -4
get size long
get zsize asize
math zsize - offset
math zsize - 8
comtype inflate
clog name offset zsize size
next i
caws
veteran
Posts: 120
Joined: Sat Mar 01, 2008 7:57 pm
Been thanked: 4 times

Re: Lunar PSP Zlib Compressed file...

Post by caws »

chrrox wrote:here you go :)
quickbms script

Code: Select all

for i = 1 < 2
goto 0xA
get name string
savepos offset
goto -4
get size long
get zsize asize
math zsize - offset
math zsize - 8
comtype inflate
clog name offset zsize size
next i
Hey man, thanks, you are the man.

But i'm trying to add the function to one of my tools. Can you explain it in words?? thanks again.
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1422 times

Re: Lunar PSP Zlib Compressed file...

Post by chrrox »

I just read the null terminated string that started at 0xA
then i save the position where the name ended as the start offset.
the last 8 bytes are not part of the compressed file.
the last 4 of those 8 bytes are the uncompressed file size.
so that gives us what we need to extract offset size and zip size
the size is the total size of the file - the start offset of the compressed block - 8 bytes at the end.
and the compression is lib with -15 window bit or inflate.
caws
veteran
Posts: 120
Joined: Sat Mar 01, 2008 7:57 pm
Been thanked: 4 times

Re: Lunar PSP Zlib Compressed file...

Post by caws »

chrrox wrote:I just read the null terminated string that started at 0xA
then i save the position where the name ended as the start offset.
the last 8 bytes are not part of the compressed file.
the last 4 of those 8 bytes are the uncompressed file size.
so that gives us what we need to extract offset size and zip size
the size is the total size of the file - the start offset of the compressed block - 8 bytes at the end.
and the compression is lib with -15 window bit or inflate.

Hey man, thanks.

Now i can translate the texts that were compressed.

Image
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1422 times

Re: Lunar PSP Zlib Compressed file...

Post by chrrox »

do you have a site where you release your tools / translations?
caws
veteran
Posts: 120
Joined: Sat Mar 01, 2008 7:57 pm
Been thanked: 4 times

Re: Lunar PSP Zlib Compressed file...

Post by caws »

chrrox wrote:do you have a site where you release your tools / translations?

Mainly i release them in the romhacking.trd.net , but some people puts them in the romhackers.org and romhacking.net.
http://www.romhackers.org/modules/news/
http://www.romhacking.trd.br/index.php?topic=7060.0
Ps:They're in portuguese so guess you will need google translate.!
The lunar is still just a project, i'm not going to translate it, just creating the tools so the people in my team will be able to do so..(man 1.5 mb of texts is just too much for me...)
I think that only the 5 bytes at the end arent part of the compressed file...

Now i'm going to research the decompressed file... container i think...
Post Reply