Back to the Main Page

Main Database - All the PK Hack knowledge you could ever want!

Download programs and tools

Learn from the hackers!

An introduction to the PK Hack community

Find out how to do some hacking of your own!

Download IRC scripts and learn how to chat with us!

PK Hack Message Board, hosted by Starmen.Net

Link us!


To our new guests

Welcome to the PK Hack website!

   In the year 1995, a game called EarthBound was released. EarthBound was an unconventional role-playing game created for the Super Nintendo. Known in Japan as Mother 2, it takes place in the present day, with four young teenage kids as the heroes. Since the year 2000, a community of video game hackers has been breaking down the code of EarthBound. Through the endless efforts of this community, enough knowledge has been gained - and tools have been developed - to allow people with sufficient drive and creativity to create an entirely new RPG from the EarthBound engine. We are the PK Hack community.


About ROMs

   Some of you may remember looking in the back of your Nintendo instruction booklets and seeing a big disclaimer talking about the illegitimate legal status of "archival and backup copies" of their video games. In case this left you scratching your head: there are devices that allow the user to copy the contents of video game cartridges into computer data. These copies, known as ROM images (as they are literally a duplication of the cart's Read-Only Memory) are distributed across the Internet en masse. In short, you can find hundreds of console games on the Net, available for free download, and fully playable through the use of an emulation program. One can also, through various editing programs, change the data contained within the ROMs and manipulate the game.

   This, in no uncertain terms, greatly displeases the major gaming corporations.

   Yes, distribution and possession of ROMs is considered illegal. The myth perpetrated by hundreds of ROM archive websites is that you may legally hold a ROM image if you own the actual cartridge - however, this is far from true. Granted, the chance that Nintendo stormtroopers will come crashing through your window and rough you up for having a copy of Mario 1 on your PC is rather slim. However, web communities where ROM distribution is known to take place are often forced to shut down or face litigation. It is for that reason that we of the PK Hack community ban ROM distribution within our webspace. So don't ask where to find a ROM. Don't tell anybody where ROMs are, either. Too many people have invested too much time in the Starmen.Net EarthBound community (where this site and our forum is hosted) to have it shut down because of ROM trafficking.

   Legal issues aside, the acquisition of an EarthBound ROM is a rite of passage for prospective hackers. All one really needs to do is make use of a search engine and find a site that deals in Super Nintendo ROMs. The EarthBound ROM is a little bit over 3 megabytes in size, so keep that in mind if you have a slow Internet connection. If you're not sure what "megabytes" or "search engines" are, I suggest you become a bit more familiar with using your computer before coming back to this site. I wonder how you got here in the first place...


What Is PK Hack, Exactly?

   PK Hack, by itself, is a computer program for Windows that allows the user to meaningfully edit the EarthBound ROM - specifically, you can change the properties of items, enemies, and a variety of other things. However, as time has passed and more programs have been developed, the term PK Hacking has come to refer to the hacking of EarthBound itself, rather than a specific program. With even a little knowledge of how to use your computer, it's possible to become a good PK Hacker.

   Contained within the Database are tutorials on how to use each and every program available for EarthBound hacking. If nothing else, there are two pieces of advice you should listen to. First, read the tutorials before you want to do something! You should try to absorb the information like a sponge absorbs water. Second, and even more important, you should start small. All of the tutorials and downloads pages are marked with a difficulty level. Try to master the use of a given level of knowledge before going on to the next.


Computer Requirements

   There are a few things you'll need to start! A machine running Windows 95 or 98 is probably best, as most programs developed for hacking EarthBound have been made with these operating systems in mind. Windows XP and Millenium Edition users may have problems running certain EarthBound programs. Macintosh and Linux users beware, relatively few hacking programs of any sort have been developed for your systems; however, the hacker DrAndonuts has been developing EarthBound hacking programs for Mac. Keep an eye on the PK Hack forum at Starmen.net and the PK Hack website for updates on all programs.

   Once you download the ROM, you will need an emulation program to run it. An SNES emulator will digitally mimic the Super Nintendo console and allow you to play ROMs on your computer. The two best emulators are generally considered to be ZSNES and SNES9X. Now that you are set up with those two essentials, it is time to get your hacking tools. Like you'll need a word processor to write letters or a media player to play music, you'll need special programs to make various changes to your ROM. Many programs that have been developed for use with hacking EarthBound. Be sure to check out the Downloads page to find all the programs you could ever need.


Distributing Your Hack

   The only real legal way - and practical way, considering its size - to distribute your hack is using a so-called "IPS patch." The International Patch System is a method of recording the differences between two files. With an IPS patcher program, you can create IPS files which contain all the details of your hack. To generate an IPS of your hack, you must have your hacked ROM and an original, unchanged ROM to compare it to. (Keep in mind, if your hack's ROM has been expanded using the EarthBound Text Editor or the EarthBound ROM Expander, your "unchanged" ROM will have to have been expanded as well.) To use an IPS file, you can do one of two things. With a recent enough emulator, you will be able to play the hack without patching the IPS file if the IPS and the ROM have the same name. However, to make a permanent copy of a hack, you will have to perform the patch creation sequence in reverse. Make a copy of your original ROM, and use the patching program to apply the IPS file to the ROM. In terms of programs, I recommend "SNESTool" for all of your patching needs.


Prerequisite Math Crash Course

   Before you start hacking ANYTHING, you should know a bit about how the ROM is structured, and about bits, bytes, binary and hexidecimal numbering.

   Let's dive right in. We're all familiar with the Base 10, or "decimal," system. You know, it has 10 different numbers - 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. The places go up by factors of 10 - ones, tens, hundreds, thousands, and so forth. If you're not familiar with decimal numbering, then you need to sit in on a Kindergarten class and come back when you get a brain. No offense. However, you may not be quite so comfortable with binary and hexidecimal formats. They may seem scary at first, but don't be afraid.

   Binary, or Base 2, has only two numbers - 0 and 1. It is the way your computer stores information - either a pulse of electricity, or not a pulse - a stream of electric 1's and 0's. Binary numbers are grouped together in blocks known as "bytes." Each byte contains eight binary digits, or "bits." 1,024 bytes is a "kilobyte," 1,048,576 is a "megabyte," 1,073,741,824 is a "gigabyte," and so on.

Diagram of a byte:

    1 | 0 | 1 | 1 | 1 | 0 | 1 | 0  Base 2 (Binary)
   ---+---+---+---+---+---+---+---
   128| 64| 32| 16| 8 | 4 | 2 | 1  Base 10 (Decimal)

   It works out in a simple fashion. Each bit represents a decimal value like I described above. A 1 in any of those bit-places designates that its value is added to the total sum of the byte's value. Let's look at the value I have above: 10111010. Looking at it, we see that the 2's, 8's, 16's, 32's, and 128's are all turned on. So, we just have to add up that sum: 2 + 8 + 16 + 32 + 128. That sum happens to be 186. Therefore, decimal 186 is equal to binary 10111010. The maximum value for any byte is 255 (1 + 2 + 4 + 8 + 16 + 32 + 64 + 128). Now, before you run away crying, take heart. This is just here to help illustrate the concept of bytes - you won't have to do this all the time. :D

   Hexidecimal, or Base 16, is even more alien to some because it contains 16 numbers. "16 NUMBERS?" you shout, incredulous. "WHAT THE ¶©§þ?" Instead of stopping at 9, it continues on. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. Then, once you go past F, you count 10, 11, 12, 13... yada, yada, yada... 19, 1A, 1B, 1C, 1D, 1E, and 1F. It continues on like that. To differentiate hex numbers from decimal, we write them with 0x at the front. Like this -> 93 = 0x5D. The places in hexidecimal form increase by factors of (guess what) 16. Thus you have the ones place, the sixteens, the two-hundred-fifty-sixes, and so on. Each byte contains 2 hex digits, and the maximum any byte can be (in hex) is 0xFF. So, let's look at that byte diagram again.

Diagram of a byte (again):

    1 | 0 | 1 | 1 | | 1 | 0 | 1 | 0  Base 2 (Binary)
   ---+---+---+---| |---+---+---+---
   128| 64| 32| 16| | 8 | 4 | 2 | 1  Base 10 (Decimal)
   ---+---+---+---| |---+---+---+---
   0x8|0x4|0x2|0x1| |0x8|0x4|0x2|0x1 Base 16 (Hexidecimal)

   In order to convert from binary to hex, we have to consider the byte as two pairs of four bits. The first four bits will designate the first digit in the hex value of the byte. 0x8 + 0x2 + 0x1 = 0xB, so the first digit is B. As for the second, 0x8 + 0x2 = 0xA. Thus, the whole byte ends up being 0xBA. Unless you really want to, you don't need to manually convert any number to hex, or binary, or whatever. You have Microsoft Calculator - the one not-crap thing included with Windows! In Scientific mode, select your number type - ignoring Octal (Base 8, that is) - type in the value, and click the type you want to convert to! It's that easy. Now, let's discuss how the ROM is constructed.

   The ROM is made up of a string of 3,146,240 bytes stored in a hexidecmal format. Scary. However, we can use that fact to obtain what's known as a hex address. In order to refer to a particular location in the file, we need to know where it is. We do this by counting the number of bytes into the ROM that byte is, as if each byte were a page number in a book (starting at 0x0). For example, the text in the game begins at the 335,122nd byte in the ROM - or in hex, 0x51D12. Thereby, we say that the hex address of the beginning of the text is 0x51D12. You don't have to count, as hex editors have a location readout displaying your address at all times. However, internally, it works a bit differently.

   All SNES ROMs contain a short header, identifying the game, the company that made it, how big it is, and other such information. This lasts for the first 512 - or, 0x200 - bytes in the file. Now, the game will not actually read this part of the file. And on top of that, EarthBound reads the first byte after the headers as location "0xC00000". I can imagine you're going, "WHAT YOU SAY ??" right about now. Just calm down, clear your mind, and live with it. :P In order to find an SNES-format address from a standard hex address, you'll have to subtract 0x200 because it's not reading the header, and add 0xC00000 'cuz it's funky. Of course, to find the hex address from an SNES format address, you have to do the opposite (add 0x200 and subtract 0xC00000).

   Now, one more basic fact to grapple with. Every time where the game stores a number - say, the amount of Hit Points a particular enemy has - it's stored in hex. The Kraken, for example, has 1,097 HP. Using our calculators, we find that 1,097 is 0x449 in hex. Since each byte has 2 hex digits, we know that that the bytes have to be [04 49]. Right? Wrong. The ROM also stored bytes in a flipped-around-backwards format which trips a lot of beginning hackers up. In this backwards format, 0x449 would be stored as the bytes [49 04]. Don't let this confuse you - you just have to read the bytes in backwards order. But DON'T read the VALUES of the bytes backward - [49 04] is not 0x4094, after all!

   Well, that about wraps it up for the basic information you need to know. If you're scratching your head still, don't worry. Just give it all a chance to sink in. Knowing this stuff is a neccessary evil; but if you don't get it right off the bat, it's okay. It is required knowledge for some more advanced hacking concepts, however.