Author Topic: PSX Field scripting while FF7 is running ^_^  (Read 3302 times)

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
PSX Field scripting while FF7 is running ^_^
« on: 2004-07-19 02:23:47 »
I found a really neat trick on how to script FF7 while it's running to figire out how the scripting commands work.

You need ePSXe and all the goodies to make it run, a debug save, and a copy of FF7 for the PSX.

You also need a copy of Gunzip and a hex editor.

Oh and a dumped copy of the script you want to alter. (Use Lasyan3's utility for that)

First thing you do is run FF7 and use the debug save to get into the debug room. Now what you do is use my debug discription in gears to figure out what command you want to play with. You see, almost every command gets used in the debug room in one way or another. I'll run through a quick tutorial on how I was able to alter the MENU command while the game was running.

The menu tester is in Kitase's room (The top blue ball), and looks like tifa in a dress. Now what we do is enter that room and make a save state useing the F1 key.

This saves a gzipped mirror of the PSX's memory in the /sstates directory.

Now , with the emulator still running go into the /sstates directory and gunzip the save state. (Not the .pic file). On linux I had to do rename SCUS_941.63.004 (My save state) to SCUS_941.63.004.gz so Gunzip could "see" it. When I gunziped  it, gunzip renamed the file back to SCUS_941.63.004, but now it was unzompressed.

Keep in mind the emulator is still running.

Now, looking at the script dump you learn that tifa has a MENU(00,07,00) command that's used to select what characters you want in your party. The script also fills up the party pool for you as well so you won't get stuck making a party of three when you only have one character.

Looking at the script dump you see the bytes that make up the menu command are 49 00 07 00. Just to be sure we have the right part of memory, grab the opcodes before and after what you want to alter.

this means MMB+- before and the RET after. This expands our bytes to CD 01 07 [MMB+-(01,07)]   49 00 07 00 00 [MENU(00,07,00)] RET [00]

Or a final sequence of number of [CD 01 07 49 00 07 00 00 00]

See how the menu command arguments are snug in the center?

Well now what we do is use a hex editor and open the save gunzipped save state file and search for those sequence of numbers within it. I found mine at 0x1159a6

Now what you are looking at is the live script in memory. Now what I did is change that 07 in the menu command to a 08 and see if that changed anything.

Keep in mind the emulator is still running.

Ater changing the argument value, save the save state and keep the hex editor open

Press F3 to load the save state you just altered. Walk over to Tifa and talked to her.

BLAMO! She's a shop now!

Now with the hex editor still open and the emulator still running, change the 08 to an 0E and save the save state. Press F3 to load the save state into ePSXe again and talk to Tifa again...

BOOM! She's now a save point.

Pretty cool. You can use this to exersize any command, you just have to find it in the debug room. Yuse gears and some script dumps as a guide.

Happy hacking!

lasyan3

  • *
  • Posts: 76
    • View Profile
PSX Field scripting while FF7 is running ^_^
« Reply #1 on: 2004-07-19 05:31:33 »
Great news !! Let's get hacking guys !!!!!