Author Topic: .  (Read 3387 times)

Jenova's Witness

  • Right Wing Safety Squads
  • *
  • Posts: 471
  • I ♥ SCIENCE
    • View Profile
.
« on: 2011-04-04 20:31:27 »
.
« Last Edit: 2015-11-16 07:10:35 by Jenova's Witness »

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: FF7 - Formulas - Save State Hacking
« Reply #1 on: 2011-04-05 00:54:46 »
I find bits and pieces of formulas here and there. I found the 3841-4096 random variance function and the random number "generators", but none of the actual damage scripts.

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: FF7 - Formulas - Save State Hacking
« Reply #2 on: 2011-04-05 02:35:10 »
http://www.ffhacktics.com/wiki/Formula_Hacking

How much is known about how FF7 loads each party member's stats in battle, and how this is used in formulas?  I ask this because a motivated FFT save state hacker can find some formula offsets in RAM, with no knowledge of assembly, and I'm wondering if the same can be done with FF7.

The following is for memory not save :) 

The data is there in 3 sections, 1 for each member.  If you look at this with an assembly debugger you can see that all attributes (HP of characters etc) are in their own sections.  character 1 data begins at 00DBA490 in memory.  Character 2 data begins 440 bytes after character 1.  Character 3 data begins 440 bytes after character 2.

For example limit var is at 00DBA4B3 and HP is at 00DBA4A8 but is written there from 00435718.   If you go to 00435714 and change the code from mov ax,[ebp-10] to mov ax,10 -  all 3 party members will be invincible and stuck at 16 HP.

A better place to look is 009ab108 for HP because that is the main holding area for it.  if you change those values they get reflected (not immediately) as the new HP.  MP is at 009ab104.  These areas are what the game uses once it has been loaded from the save file.

Simples.
« Last Edit: 2011-04-05 02:36:57 by DLPB »

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: FF7 - Formulas - Save State Hacking
« Reply #3 on: 2011-04-05 12:01:55 »
character 1 data begins at 00DBA490 in memory.  Character 2 data begins 440 bytes after character 1.  Character 3 data begins 440 bytes after character 2.

IIRC, that 440 is in hex. So each character would span 1088 bytes.

sithlord48

  • *
  • Posts: 1634
  • Dark Lord of the Savegame
    • View Profile
    • Blackchocobo
Re: FF7 - Formulas - Save State Hacking
« Reply #4 on: 2011-04-05 16:03:28 »
IIRC, that 440 is in hex. So each character would span 1088 bytes.

this is oddly much larger then the space used to save a char in your save file (132 Bytes), wonder what all that extra data ? there has to be some padding for the purpose of alignment or some data not being saved, thats a lot of "extra" bytes for each char.

as a Referance this is how chars are saved in the save game file

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: FF7 - Formulas - Save State Hacking
« Reply #5 on: 2011-04-05 19:39:22 »
IIRC, that 440 is in hex. So each character would span 1088 bytes.

Sorry ;)  of course it is.

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: FF7 - Formulas - Save State Hacking
« Reply #6 on: 2011-04-05 20:27:10 »
this is oddly much larger then the space used to save a char in your save file (132 Bytes), wonder what all that extra data ? there has to be some padding for the purpose of alignment or some data not being saved, thats a lot of "extra" bytes for each char.

Allowed commands, magics, and summons mostly. Each is a fixed length for each character. 16 commands that are at least 6 bytes each (96 bytes), 56 possible magic attacks that are about 3-4 bytes, and 16 summons that are 3-4 bytes. Also things like Attack = Strength + strength bonuses (from sources) + weapon attack are stored per character and not saved. Status effects for in-battle. LOTS of graphics modifiers like gamma values, size, hue, etc.