LZ77 compressor

ItsMetaKnight

Well-Known Member
OP
Member
Joined
Mar 4, 2008
Messages
866
Trophies
1
Website
Visit site
XP
1,484
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,350
Trophies
3
XP
27,317
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.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • JuanMena @ JuanMena:
    Kissing random dudes choking in celery? Really? Need to study for that?
  • K3N1 @ K3N1:
    Yes it requires a degree
  • K3N1 @ K3N1:
    I could also yank out the rest of my teeth but theirs professionals for that
  • x65943 @ x65943:
    If your throat closes, putting oxygen in your mouth will not solve anything - as you will be introducing oxygen prior to the area of obstruction
  • JuanMena @ JuanMena:
    Just kiss me Kyle.
  • x65943 @ x65943:
    You either need to be intubated to bypass obstruction or create a stoma inferior to the the area of obstruction to survive
  • x65943 @ x65943:
    "Just kiss me Kyle." And I thought all the godreborn gay stuff was a smear campaign
  • JuanMena @ JuanMena:
    If I die, tell my momma I won't be carrying Baby Jesus this christmas :sad::cry:
  • K3N1 @ K3N1:
    Smear campaigns are in The political section now?
  • JuanMena @ JuanMena:
    Chary! Chary! Chary, Chary, Chary!
  • Sonic Angel Knight @ Sonic Angel Knight:
    Pork Provolone :P
  • Psionic Roshambo @ Psionic Roshambo:
    Sounds yummy
  • K3N1 @ K3N1:
    Sweet found my Wii u PSU right after I ordered a new one :tpi:
  • JuanMena @ JuanMena:
    It was waiting for you to order another one.
    Seems like, your PSU was waiting for a partner.
  • JuanMena @ JuanMena:
    Keep them both
    separated or you'll have more PSUs each year.
  • K3N1 @ K3N1:
    Well one you insert one PSU into the other one you get power
  • JuanMena @ JuanMena:
    It literally turns it on.
  • K3N1 @ K3N1:
    Yeah power supplies are filthy perverts
  • K3N1 @ K3N1:
    @Psionic Roshambo has a new friend
    +1
  • JuanMena @ JuanMena:
    It's Kyle, the guy that went to school to be a Certified man Kisser.
  • Psionic Roshambo @ Psionic Roshambo:
    Cartmans hand has taco flavored kisses
  • A @ abraarukuk:
    hi guys
  • Iron_Masuku @ Iron_Masuku:
    Hello
    Skelletonike @ Skelletonike: hmm