Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
1 user currently in Rom Hacking: hukka | 2 guests
Acmlm's Board - I2 Archive - Rom Hacking - Compression Help
  
User name:
Password:
Reply:
 

UserPost
HyperLamer
Posts: 5949/8210
GB Devrs probably has some simple compression/decompression code you could look at. It's for Gameboy, which is almost exactly the same as Z80 (mostly just some instructions added/removed/moved). Though you'd best just get familliar with Z80 in general, then once you're good at it, start looking for compression-related code. (Breakpoints really help with this.)
Gustav
Posts: 4/4
Do you know specifically where I can get a tutorial on an algorithm for decompressing in Z80?
HyperLamer
Posts: 5934/8210
Ah, well you're lucky. Z80 is easy. You should learn ASM, it's a big help when you want to do things you can't normally do to a game.

Of course, if the compression format is really obvious or is used in a different game, sometimes you can get away with not having to reverse-engineer it.
Gustav
Posts: 3/4
Well, I've figured out this rom is using advanced compression methods and I have no idea how to learn to write a decompression routine for Gamegear. If anyone wants to help with that part, I'd appriciate it. If not I got plenty of other things to do.
Parasyte
Posts: 514/514
... Assembly knowledge is needed to reverse engineer the routines responsible for decompression. Yes, those routines can be rewritten in C / C++, but how do you expect them to be rewritten if you have no idea what the algorithm is? The short answer: You find out what the algorithm is. The slightly less short answer: You find out what the algorithm is by reverse engineering the decompression routines, which (as fate has it) are only available in machine code, but can be translated to a very low-level disassembly. Therefore, assembly knowledge is still required to complete the job. And in this case, Zilog z80 assembly knowledge.
beneficii
Posts: 291/567
Originally posted by Gustav
JLukas: Thank you very much for that post, I wish other people made things as clear as you did. I am a guru C++ coder, but I was told by another that I need to use ASM to write decompression routines. Ever since I began programming ASM keeps poping up... Oh well... I'll read that file you mentioned. Again, thanks for your help.


You don't need ASM for decompression. C++ is Turing-complete, so given enough time and memory it can solve any problem the universal Turing machine can. (Then again, INTERCAL is Turing-complete too....) Perhaps the guy was making a reference to a big decompression job and recommended ASM to make it quicker?

HyperLamer
Posts: 5919/8210
You can write them however you want, but you need to know ASM for the console you're hacking to figure them out.
Gustav
Posts: 2/4
JLukas: Thank you very much for that post, I wish other people made things as clear as you did. I am a guru C++ coder, but I was told by another that I need to use ASM to write decompression routines. Ever since I began programming ASM keeps poping up... Oh well... I'll read that file you mentioned. Again, thanks for your help.
JLukas
Posts: 38/51
The problem with relative search is that it won't find strings that use dictionary compressed bytes (or any other kind of compression in it)

Example, you are trying to search a game for the text "abcd"

The relative search looks for a hex string such as 01 02 03 04

When the game is dictionary compressed, commonly used letter combinations are assigned their own byte(s). In this example, "ab" might be frequently used in the game for the words: about, cabin, etc.

Instead of "01 02 03 04" it could be "65 03 04" and that's why the searcher isn't picking it up.

I highly recommend reading a FAQ called tabdef.txt (you can find it on Zophar's Domain), it contains a huge amount of info on the different formats, text compression methods and how to build tables. If the game is only using dictionary and similar types of compression for the text, you should be able to build the table even if you don't have programming knowledge. However, as d4s mentioned, the game could be using an advanced compression method that will require writing decompression routines.
d4s
Posts: 260/325
Originally posted by Gustav
I'm trying to relative search a game called Shining Force - Final Conflict for Game Gear but I believe the text is compressed or something. Does anyone know any way I can build a table with compressed text?


unless its just using dictionary compression, there are slim chances you will be able to change the text without reverse-engineering the compression format first.
Gustav
Posts: 1/4
I'm trying to relative search a game called Shining Force - Final Conflict for Game Gear but I believe the text is compressed or something. Does anyone know any way I can build a table with compressed text?
Acmlm's Board - I2 Archive - Rom Hacking - Compression Help


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.034 seconds.