• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
March 28, 2024, 06:58:26 am

News:

Use of ePSXe before 2.0 is highly discouraged. Mednafen, RetroArch, and Duckstation are recommended for playing/testing, pSX is recommended for debugging.


Hex editing Stuff & Basic Tutorial

Started by Vanya, July 28, 2008, 04:43:10 pm

Vanya

July 28, 2008, 04:43:10 pm Last Edit: January 31, 2010, 02:20:53 pm by Vanya
Some hex editing tools and files.

If anyone has any general questions about hex editing I guess you can ask them here. I may post a tutorial in the future as well.
  • Modding version: Other/Unknown
¯\(°_0)/¯

Vanya

July 28, 2008, 04:45:45 pm #1 Last Edit: January 31, 2010, 02:22:17 pm by Vanya
Some prelim stuff:

OK. The very first thing you'd need to know is how hexadecimal numbers work.

Decimal is the 10 digit system we normally use. (#1-9 and 0) "Hexa-" means 6. Therefore, a hexadecimal system used 10 + 6 digits to count.

These are the hexa decimal digits:
0 1 2 3 4 5 6 7 8 9 a b c d e f

This means that when you count in hex instead of going from 09 to 10 you'd count 09, 0a, 0b, 0c, 0d, 0e, 0f, and then would come 10. It's a little hard to count this way at first, but you get used to it. Some people can even do math in hex. For those of us that can't there's the windows calculator.

What this means to you for hex editing and programming is that the largest number you can fit into a single byte of info is FF. FF = 255. The first thing you'll notice about the data in a hex editor is that all the bytes are arranged in pairs of digits. Each pair is one byte. And for most simple hex editing you'll only be changing a byte or two.

For example, in the Super Mario World ROM, if you go to a certain address you can change the speed of the fireballs he throws when he gets a fire flower. This is a single byte that is normally like 05, but if you change it to 0a it'll go twice as fast. This is because 5x2=10, but 10 in hexadecimal is 0a.

The bin file is a file extracted from FFT. It contains a lot of data and text for the game's main menu. You can open any kind of file in a hex editor, this one just happens to be a binary file.

The table file is needed for text editing. The one I included is specifically for FFT. Different files will have different tables depending on how the text is encoded. What it does is tell the hex editor to represent certain values as a certain character. Open the table file in a text editor to see the format.

Important Things to Remember
> When you hex edit text remember that there could be several duplicate blocks of text in the file you're editing.

> Unless you're having problems with it, use FFTacText to make your changes. It's much easier.

> The 2 *problem* files in FFTacText are 'Battle.BIN' and 'World.BIN'. Until FFTacText is perfected you're better off hex editing these. EDIT: The newest version of FFTacText seems to have these problems solved.

More details
Quote
Quote00000000 || 88880680888806808888068088880680 || ................
00000010 || 94880680948806809488068094880680 || ................

The numbers all the way on the left, "00000000" and "00000010", are the starting addresses of those two lines.

Like in any number system the leading 0's don't have to be typed. Thus, the offset of the first byte of each of those lines is "0x0" & "0x10". The "0x" tells you that we're talking about an offset. OK?
Also, it can be written without the first 0 as in "x0" & "x10", but that isn't proper.

The value stored at 0x0 is "$88". The value stored at 0x1 is also "$88".
When writing a hex value you put a "$" in front of it or an "h" after it. Thus, $88 is the same as 88h, OK?

So when I tell you that the skill animation at 0x2ce13 is 012c00. It means that the three bytes at that address are 01, 2c, and 00.

In WinHex, you load battle.bin.
Click on the 'Search' menu.
Go down to 'Go To Offset' and click on it.
The dialogue box that pops up has a space marked 'File Position'. In that space type "2ce13" and press enter.
It will jump down to line '0002ce10' which will be highlighted, and the cursor will be on the number '01'.
Next to it will be '2c', and next to that is '00'.
Those 3 numbers are the skill animation value. If you change it to "$070000" the cure spell will make the caster use their weapon instead of the normal spellcast animation.
Try it and see.
  • Modding version: Other/Unknown
¯\(°_0)/¯

trickstardude7

July 29, 2008, 11:22:50 pm #2 Last Edit: December 31, 1969, 07:00:00 pm by trickstardude7
Edit-

nevermind this is easy thank you for the links and table :D

Cheetah

July 29, 2008, 11:41:52 pm #3 Last Edit: December 31, 1969, 07:00:00 pm by Cheetah
Good info, thanks, I will hopefully use this in the future.
Current Projects:

trickstardude7

July 30, 2008, 12:16:07 am #4 Last Edit: December 31, 1969, 07:00:00 pm by trickstardude7
hm im going to try to find a method for psp i have nitepr and can search text but i need some way to implement the fft table in or else everything looks weird and no text im going to keep messing around with it

Vanya

July 30, 2008, 12:27:26 am #5 Last Edit: December 31, 1969, 07:00:00 pm by Vanya
The PSP files should be using the same character encoding as the PSX version. If not I have a program you can use to build a table file. I'll post it tomorrow.
  • Modding version: Other/Unknown
¯\(°_0)/¯

trickstardude7

July 30, 2008, 01:41:07 am #6 Last Edit: December 31, 1969, 07:00:00 pm by trickstardude7
Quote from: "Vanya"The PSP files should be using the same character encoding as the PSX version. If not I have a program you can use to build a table file. I'll post it tomorrow.
o im dumb i was trying to edit in game i forgot to extract world.bin

Kenshin72

July 30, 2008, 02:20:31 am #7 Last Edit: December 31, 1969, 07:00:00 pm by Kenshin72
So using this I can change the 3 things I've always wanted to on the PSP?............*suspenseful pause*........................Skills Names, Job Names, and Skillset Names?

Vanya

July 30, 2008, 10:23:09 am #8 Last Edit: December 31, 1969, 07:00:00 pm by Vanya
As long as the relevant files aren't compressed, you should be able to edit anything you want. Just remember that the text block has to remain the same length or shorter. Padding with zeros is fine, but don't spill over into the next section.

It is possible to use empty space to put in more text, BUT you'd have to mess with pointers. And messing with pointers isn't easy or fun.
  • Modding version: Other/Unknown
¯\(°_0)/¯

Nagafen

July 30, 2008, 10:25:03 am #9 Last Edit: December 31, 1969, 07:00:00 pm by Nagafen
Heh... Thanks Vanya. I've pretty much edited all the Prologue text, and now I'm moving on to Chapter One. Thanks again.

Vanya

July 30, 2008, 10:28:50 am #10 Last Edit: December 31, 1969, 07:00:00 pm by Vanya
:D
  • Modding version: Other/Unknown
¯\(°_0)/¯

Nagafen

July 30, 2008, 10:33:40 am #11 Last Edit: December 31, 1969, 07:00:00 pm by Nagafen
By the by.. how do I edit the White text that says "Orbonne Monastry" at the beggining, just before Ovelia's "God" bit? Is their any known way?

Vanya

July 30, 2008, 10:41:40 am #12 Last Edit: December 31, 1969, 07:00:00 pm by Vanya
I *think* those are actually graphics. Don't know where they are, though. I think there was some thread somewhere about it. do a search for it. =)
  • Modding version: Other/Unknown
¯\(°_0)/¯

BeoulveBlack

July 30, 2008, 10:42:34 am #13 Last Edit: December 31, 1969, 07:00:00 pm by BeoulveBlack
wow this is useful....thanks! now i can see my spelling errors as i go!

one more thing: how do i edit the fft table, so that when i edit text, i can see the punctuation?

Vanya

July 30, 2008, 10:49:03 am #14 Last Edit: July 30, 2008, 10:52:28 am by Vanya
Just use a text editor to open it. The format is simple.

if 0A is the value used to represent the number 2 you type an entry that reads:

0A=2

Each entry has to be on it's own line. You'll see how it's done when you open the file. Check out this site for info on the character mapping: http://gomtuu.org/fft/trans/

I suppose you could contact Gomtuu with more specific questions about the info on this site as he is a registered user here.

Also, I'm attaching a table file utility you guys might find useful.
  • Modding version: Other/Unknown
¯\(°_0)/¯

Nagafen

July 30, 2008, 10:51:03 am #15 Last Edit: December 31, 1969, 07:00:00 pm by Nagafen
Ahh.. that's good. I was wondering why I coudn't see any of the punctuation.

Kenshin72

July 30, 2008, 11:01:41 am #16 Last Edit: December 31, 1969, 07:00:00 pm by Kenshin72
So Im trying to change a job name. Ramza's chapter two Squire class.
Um... How do I know which hex digit is which letter?

Vanya

July 30, 2008, 11:09:32 am #17 Last Edit: December 31, 1969, 07:00:00 pm by Vanya
You have to load the table file above along with the file you want to edit. =)
  • Modding version: Other/Unknown
¯\(°_0)/¯

Kenshin72

July 30, 2008, 11:28:53 am #18 Last Edit: December 31, 1969, 07:00:00 pm by Kenshin72
O!
Thats the one you provided in the first post?

Nagafen

July 30, 2008, 11:30:57 am #19 Last Edit: December 31, 1969, 07:00:00 pm by Nagafen
Yep. It helps a lot. Trsut me, it got me through most of the Story Text in the Prologue/Chapter One.