Repointing Tutorial

Repointing Tutorial

Since apparently the one in the UT doesn’t suffice, I’ve been asked or told or whatever to create one. Keep in mind, this is not something to be done by newer hackers, as its unnecessary most of the time for many hackers to need to do this. Repointing a table is moving where that table’s data is stored in the game in order to expand it. A common example(in the fire emblem fanbase) is repointing and expanding the item table.

Tools required:
Nightmare modules(or a program that can view the address of tables)
A hex editor(I prefer HxD)
Notepad(or any text-based program; use paint, be that guy/girl)
A hex calculator(the basic one on your computer should suffice)
A ROM(idk where to get one though)

Prior Knowledge required:
Free space range you plan to point to’s address
Size of the data table you’re repointing(I might as well go over that though)

Locate the table you wish to repoint/expand. For now, I’ll pick the item table. Go to the item editor module, and open it in notepad.
At the top you’ll see some important things.

FE7 Item Editor by SpyroDi, updated by Nintenlord <-- The title of the mod
0xBE222c <-- The address of the table this mod edits[Important]
159 <-- The amount of entries allowed in this mod[Important for Nightmare only]
36 <-- the amount of bytes each entry takes up
FE7 Item Editor.txt <-- text file that is used by the module

First things first, we’ll want to to change that 159 to 200(since we’re expanding the item table, might as well actually expand it)
Now change that address to the one you want to repoint to. I have no idea where you plan to point this to, but I’ll point it to 0xD00000. So change 0xBE222c to 0xD00000. Nothing else needs to be changed, but obviously you’ll add your new items accordingly to the text file. Do not change the 36, or amount of bytes each entry takes up; this is not going to change when you repoint and will more than likely brick your ROM. Keep the new numbers and the old numbers in a text file for reference.

We’re done in the module now, so you can save and close it now. Get that calculator open and change the mode to programmer(view → programmer). It’ll look like this:
http://puu.sh/dFLQi.png
Now multiply the number of entries by the size of each entry(to get the size of the table). Do this with the old number first, 159 in our case. Convert the number to hex(5724 → 0x165C) and keep that in your text file.
Open your ROM in HxD and go to edit → select block.
For your start offset, put the address, 0xBE222c. For the length, put the size of the table(in hex).
Should look like this:
http://puu.sh/dFMdh.png
Copy that block of data and paste(control+B not control+V) it in your new location(in our case, 0xD00000).
We’re almost done, but there’s one tiny step left; actually pointing the table to the new location.
Now, use the search → replace function. Change the data type to hex. For the “Search for”, put the old address in little endian and the new address should follow the same format in the “Replace with” box. You should look something like this(don’t forget for FE offsets, there’s 08 in place of 0x):
http://puu.sh/dFNpr.png
Hit replace all, and(in this instance), you’ll see a lot of replacements(62 should be how many in FE7).
Save the ROM and test any old item. If it works, you should be fine. If it crashes,you probably did it wrong. Following these steps to a T will result in an expanded table.
http://puu.sh/dFNl3.png
^ See I just did it.

If you’re wondering why we needed the size of the new table, it’s because you’ll need to know where that table ends to properly insert more data in the future. No dumping things willy-nilly.

7 Likes

This is because (based on having asked you questions before) your explanations are almost always much clearer than the ones in the UT.