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 | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
Gustav
Newcomer
Level: 3

Posts: 1/4
EXP: 82
For next: 46

Since: 07-20-05

Since last post: 103 days
Last activity: 98 days
Posted on 07-20-05 08:04 AM Link | Quote
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?
d4s

Panser
Level: 29

Posts: 260/325
EXP: 142151
For next: 5734

Since: 03-23-04

Since last post: 13 days
Last activity: 1 day
Posted on 07-20-05 09:36 PM Link | Quote
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.
JLukas

Red Paragoomba
Level: 13

Posts: 38/51
EXP: 8897
For next: 1370

Since: 03-15-04
From: USA

Since last post: 9 hours
Last activity: 6 hours
Posted on 07-20-05 11:14 PM Link | Quote
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.


(edited by JLukas on 07-20-05 02:38 PM)
Gustav
Newcomer
Level: 3

Posts: 2/4
EXP: 82
For next: 46

Since: 07-20-05

Since last post: 103 days
Last activity: 98 days
Posted on 07-21-05 07:32 AM Link | Quote
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.
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 5919/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 07-21-05 07:40 AM Link | Quote
You can write them however you want, but you need to know ASM for the console you're hacking to figure them out.
beneficii

Lakitu
Level: 36

Posts: 291/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 07-21-05 07:41 AM Link | Quote
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?

Parasyte

Bullet Bill
Level: 35

Posts: 514/514
EXP: 267348
For next: 12588

Since: 05-25-04

Since last post: 104 days
Last activity: 32 days
Posted on 07-21-05 09:27 AM Link | Quote
... 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.
Gustav
Newcomer
Level: 3

Posts: 3/4
EXP: 82
For next: 46

Since: 07-20-05

Since last post: 103 days
Last activity: 98 days
Posted on 07-21-05 12:32 PM Link | Quote
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.
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 5934/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 07-21-05 12:34 PM Link | Quote
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
Newcomer
Level: 3

Posts: 4/4
EXP: 82
For next: 46

Since: 07-20-05

Since last post: 103 days
Last activity: 98 days
Posted on 07-22-05 12:57 AM Link | Quote
Do you know specifically where I can get a tutorial on an algorithm for decompressing in Z80?
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 5949/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 07-22-05 02:06 AM Link | Quote
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.)
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
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.014 seconds.