Author
|
Topic: When You Hack... (Read 1 times)
|
.:ROFLcopter:.
Guest
|
|
« on: March 13, 2008, 06:17:15 pm » |
|
Do you use hex editors when you hack? Or game specific ones? Or both? I'm really a newbie to all this, so I wanted your opinions on what you think is best. And if hex editing is the way to go, where could I find some form of guide on it? Please an thank you :laugh:
|
|
|
|
sb iq
Guest
|
|
« Reply #1 on: March 13, 2008, 06:42:51 pm » |
|
If you must use a hex editor to hack a game, then you have to look for a game specific guide.
|
|
|
|
Spikeman
Guest
|
|
« Reply #2 on: March 13, 2008, 09:07:18 pm » |
|
|
|
|
|
Karatorian
Guest
|
|
« Reply #3 on: March 14, 2008, 02:51:09 am » |
|
When I hack, I use the full gamut. Each type of tool has it's own benefits and drawbacks.
Hexeditors are nice in that you can edit practically anything with them. They are pretty much required for anything beyond simply applying tools written by others. They are nice for exploratory hacking and editing simple data, but they can be tedious for more complex data. In particular, any data that comes in variable sized chunks (like text or compressed data) can be a real pain to work with using only a text editor. This is because to expand the size of a chunk, you've got to move all the other data around (and usually updata a pointer table as well). ASM hacking with a hex editor is particularly tedious, but can be managed for small hacks. (If all you're doing is changing data in a chunk of code, it's no worse than editing data.)
Hexeditors are also nice for simply looking at a ROM's contents. You'd be surprized how much info you can glean about a ROM's organization just by looking at it.
Game specific editors are nice, when they exist, run on your platform, and have the features you want. Oftentimes, especially when hacking a less popular game, no such editors are availible. Advanced projects sometimes require that you write your own game specific tools to deal with complex data. (I have on several occasions.)
For some types of data in some games, you can use generic tools (such as graphics tools and script extractors). Furthermore, even if you're dealing with a data that generic tools won't work for (such as compressed graphics), generic tools can sometimes be useful to produce input data for custom tools.
One tool I've found useful is a graphics viewer. In addition to locating and viewing graphic data in the ROM, I've found another use for them. When looking at code and data displayed as graphics, you can sometimes tell the two apart just by how they look. Code tends to look more like static, while data tends to look more orderly. Of course, this is in no way scientific and doesn't always work, but it can give you some hints. (This is kinda strange and I wonder if anyone besides me has ever done this.)
A dissassembler is a must if you're going to do any ASM hacking. Getting a look at the programming in a format other than raw machine code is essensial to being able to modify it easily. You can also use them to locate data as it usually doesn't disassembly cleanly. They are also a key tool to my personal favorite method of ROM hacking, reassembly.
While it's an advanced technique, a method I like to use is to make (or aquire) a dissasembly of the ROM's code that can be cleanly reassembled. Then you can make changes just like you would to any other ASM program. Of course, this is a lot more effort than basic hexediting or using custom tools, but it allows for the most drastic changes. Additionally, once the intial setup is done, it makes ASM hacks a breeze compared to other methods. (However, in all honestly, I don't think very many projects bother.)
Even if you don't go to such lengths, you'll want a good assembler if you do any ASM hacking. Even a small ASM hack can be tedious and error prone if hand assembled. Similarly to a full reassembly, you can dissasemble the part you're interested in, change it and ressasmble it. Of course, you'll have to make sure there's room for the new code, or find space elsewhere to relocate it to.
Finally, a tool I get great use out of is the standard un*x dd command. While I'm sure equivilants exist for other platforms, I don't know of any off hand. What it basically does is move the data you specify from one file to the the location you want in another file. I use it for all kinds of things, but basically they all boil down to pulling stuff out of ROMs, putting stuff into ROMs, and relocating stuff within ROMs.
|
|
|
|
optomon
Guest
|
|
« Reply #4 on: March 15, 2008, 02:51:19 am » |
|
I like this Karatorian; posts are almost always proposterously large and yet somehow typically filled with good advice.
For me, the hex editor is pretty much the staple rom hacking tool. The debugger is also extremely useful, once you figure out how to use the darn thing.
I almost never use a disassembler. I almost exclusively use a hex editor to write in new lines of code, though they are usually brief. I'm probably a freak.
|
|
|
|
Karatorian
Guest
|
|
« Reply #5 on: March 15, 2008, 05:02:02 pm » |
|
Hmm, well, thanks, I guess.
If you do all your ASM hacking with a hex editor, you must know the machine code for the platforms you hack pretty well (or spend a lot of time looking at docs while you edit).
As for hexeditors, you're correct in that they are absolutely esssensial. In my effort to explain all the various sorts of tools I've found useful, I may have understated how important they are. I actually use a hexeditor quite a bit in the early stages of a project, but as I progress to the later stages, I usually do more with custom tools or assemblers.
For a newbie, which I somewhat ignored in my post (bad poster, no cookie), a hexeditor will proably the main hacking tool.
|
|
|
|
|