Jump to content

Repointing Tutorial


Chocolate Kitty
 Share

Recommended Posts

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.

Old address: 0xBE222c
New address: 0xD00000
Amount of entries: 159 -> 200
Entry size: 36


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:
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:
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):
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.

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.

Link to comment
Share on other sites

I've been told it's alright because pointers in little endians are pretty unique sequences so it's unlikely an occurrence of those exact values in a row will be unrelated. Besides, it's not really worth checking out unless you can debug and see if that's unrelated data.

Link to comment
Share on other sites

http://www.scadacore.com/field-applications/miscellaneous/online-hex-converter.html

Hey you might want to add this link to your tutorial as it helps a TON with little endian for anyone who isn't savvy at this :) It's an easy hex to little endian convertor.

Thanks for this btw I just finished and it works gorgeously! This is exactly what I needed skitty!

Edited by Lance-a-lot
Link to comment
Share on other sites

I thought that was enough...

but good that it helped

It is very helpful but I thought it wouldn't hurt to point you to the scadacore link which is just a simple plug in number convertor which can save some time if you don't quite understand what the link you provided is explaining. Either way your tutorial was very easy to follow and a complete miracle for me. I appreciate the time you took to make this for all of us without the know how. Happy holidays friend!
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...