Wednesday, November 26, 2008

Series break: Hex editing fun

I was over at a friend's house a while back, trying to get Ogre3D installed on his computer. Unfortunately, they made an "oops" with the binary package for Windows, and it kept looking for resources on the cd drive. In order to fix it, he opened something I hadn't seen before: a hex editor. In a few simple moves he turned all the "D:/" instances to "C:/" and it was fixed. I was so impressed I decided to try it myself.

I remember being a little kid and playing with Norton Commander in DOS. The program had a file viewer, and if you opened binaries you got gobbity gook. I remember thinking that someone actually programmed in those smiley faces and spades, and thinking "Oh wow, someone is really smart!". Funny thing; as it happens, I wasn't completely wrong.

I've used khexedit for a few small tasks this past week. One of them was to crack the uneditable worlds of an old game/programming tool I used to love called ZZT. I found out that a character on the second line was a '01' in locked games, and a '02' in unlocked games ( or maybe vice versa... anyway... ) Voila! I can edit locked games... or lock one. All on the binary level.

I found this fun, so I turned to script. Unfortunately most text gets compressed, such as with most of the Quest for Glory series and... (sob)... Commander Keen. What's more, on console roms it isn't even proper ASCII sometimes. However, N64 seems to be the simplest text to access, and of all the N64 games they picked the best one to make easy:


The text in Ocarina of Time is completely uncompressed. It's out of order, but its in plain text ( to a hex editor ). It's also possible to color sections using specific symbols, as above. I'm decoding it slowly. The important thing is that any unused space stays unused, so you have to use text that fills in the space as exactly as possible. I'm still not sure if I can control the creations of new lines and things like that, but I haven't spent much time with it.

I'd like to fiddle with FF7. Some people have been able to remake entire scenes in the game, changing characters, creating new dialogue, and so forth. I'm not clear whether they're using a ROM or the PC version, but I'm hoping its the former since I am using linux here. If anyone knows anything about this, please drop me a line.

This isn't really something I'd say is teaching me much, it's really just kind of fun. But you never know what you can learn doing weird things like this. Certainly teaches you a bit about security, and how binary gets read.

Guess this is another case of me going "Hmm, what can I discover in this cave?" and poking my head in.

0 comments: