LZ77 compressor

ItsMetaKnight

Well-Known Member
OP
Member
Joined
Mar 4, 2008
Messages
871
Trophies
1
Website
Visit site
XP
1,737
Country
I'm coding a hacking tool for a game (in Python) and I need to compress some data with LZ77. All the algorithms I found online don't match the algorithm Nintendo is using. I'm just not getting the same byte sequence.

Did anyone ever port Nintendo's algorithm directly?

Thanks!
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,403
Country
United Kingdom
What system? The GBA and DS share a common type, though the DS has a few more, but the 3ds switched things up a bit and the GC/Wii also have their own takes on things.
For simple GBA compression most would point you at GBA crusher
http://members.iinet.net.au/~freeaxs/gbacomp/#GBA Crusher

For the GBA/DS Cue's compression tools are worth a look and have source available
http://filetrip.net/nds-downloads/utilities/download-cues-gba-ds-compressors-1-0-f29010.html
If you had already seen this then make sure you did pull apart the normal ones -- Cue also made a version which was compatible with the Nintendo decoder but better than what Nintendo had done, indeed something like that might be the story everywhere (who cares if it is a byte for byte match if the decoders handle it just the same either way?).
I should also link https://github.com/barubary/dsdecmp
Crystaltile2 has some options here
http://filetrip.net/f23649-CrystalTile2-2010-09-06.html

Also worth noting here is the DS binary compression used in DS ARM9 binaries and overlays. Technically it would be known as BLZ and covered by cue's tools at least.

I am not sure what is out there in some flavour of open source in python but if you only need to compile it or can call something then it should not be so bad.

Not sure what people are using for GC/Wii stuff right now. The classic thing to deal with is called YAZ0 http://www.amnoid.de/gc/yaz0.txt and on the Wii there was a lot of u8 compression which many would handle with something like U8Tools

I should also mention the option to cheat. Why recompress and handle the aggravation of sliding window search and encoding if you can just set flags to next ? bytes are uncompressed instead. Similarly with BLZ in the DS binary then there is a little table in the header/referenced by the header so you can set it to uncompressed, I have seen such tables in a few other games as well.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • SylverReZ @ SylverReZ:
    @Veho, Stepcroc, I'm stuck.
  • Veho @ Veho:
    Those are monitor lizards you dunce.
    +1
  • SylverReZ @ SylverReZ:
    I'm funny. lol.
  • K3Nv2 @ K3Nv2:
    Eggs and roasted potatoes came out good
  • K3Nv2 @ K3Nv2:
    Watching the first omen and so far it's not the priest doing the scaring
  • Veho @ Veho:
    Shouldn't the kid be the scary one?
  • K3Nv2 @ K3Nv2:
    The second omen: the chior boy gets his revenge
  • Veho @ Veho:
    Reverse exorcist: it's when you hire a demon to remove the priest out of a small child.
  • K3Nv2 @ K3Nv2:
    Hire Kendrick Drake possessed a minor again
  • Veho @ Veho:
    Yeah, I'd run away from his singing too.
  • K3Nv2 @ K3Nv2:
    I wonder if Drakes still allowed to use his Instagram
  • ZeroT21 @ ZeroT21:
    sounds like everyone has some great imaginary friends
  • SylverReZ @ SylverReZ:
    @K3Nv2, Yeah, that was insane.
  • SylverReZ @ SylverReZ:
    Don't know what Drake was even thinking.
  • K3Nv2 @ K3Nv2:
    What every rich scumbag thinks that they can put their dick on anything and get away with it
  • ZeroT21 @ ZeroT21:
    I better hide my silicone Tifa doll
    +1
  • Veho @ Veho:
    What did Drake do, exactly? I don't follow celeb gossip.
  • SylverReZ @ SylverReZ:
    @Veho, Supposed accusations that Drake groomed a minor.
  • K3Nv2 @ K3Nv2:
    Allegedly groomed a 17 year old Instagram model or something along those lines
  • SylverReZ @ SylverReZ:
    Yep, something like that.
  • SylverReZ @ SylverReZ:
    Not the first time this has happened with Drake.
    SylverReZ @ SylverReZ: Not the first time this has happened with Drake.