Save State Hacking Guide by demonsword2
Breath of Fire 4 on SuperCheats.com
Breath of Fire IV(c) Capcom, 2000

Save State Hacking Guide 
Copyright 2010 Carlos Eugenio

******************************************************************************
   This guide is licensed under the Creative Commons Attribution-Sharealike,
avaiable here http://creativecommons.org/licenses/by-sa/2.0/legalcode. 
Simplifying the legalese, that means that you are free to copy, print, 
distribute, and otherwise use this guide any way you want as long as you don't
violate the license i.e. give credit where it is due! :)
   Derivative works of this guide are allowed provided that you credit me for
the original work *AND* release it under this same license or other free, 
copyleft license compatible with Creative Commons Attribution-Sharealike. If
you indeed produce a derivate, kindly inform me after it's done so I can enjoy
it too and maybe even improve this guide (you will be credited for it too of
course!)
******************************************************************************

Version History
------------------------------------
2010 April 9: v. 0.9
        -First Version, still a lot to do. Probaly a lot of wrong offsets and
values too... and typos...It'll get better soon I promise :D
------------------------------------

        This is a save state hacking guide for Breath of Fire IV, a classic PSX
RPG by Capcom. Why I bothered writing this stuff? Well... I've done it JUST to
BEAT mo&##$*@>@er Rider without having to grind to level 50+. That's reason
enough to you?! :D
So I did fiddle a little with a hexeditor, a diff tool, some save states and 
now I want to share it with you, my dear lazy classic RPG gamer. Enjoy :)

PS: This guide won't teach you hex editing. There are plenty of other guides 
who'll teach you better than me.

PS2: I used ePSXe. State hacking with ePSXe is a bit tricky but I'll explain
it in detail on section 1.0.

PS3: Use this guide with moderation! You can ruin your fun if you go overboard
and max out everything. In fact, I recommend that you beat the game first
without cheating, and in subsequent replays hexedit away. 

And, before anyone bug me with annoying accusations, I played on a emulator
yes, but I DO OWN a copy of this game! Well I mean I had one... CD's so badly
scratched it won't ever work again that's for sure...

Well, on to the guide...

Index
1.0 Save state?
1.1 Char stats offsets
    1.1.1 Hidden Stats?!
    1.1.2 Ryu
    1.1.3 Nina
    1.1.4 Cray
    1.1.5 Scias
    1.1.6 Ursula
    1.1.7 Ershin
    1.1.8 Fou-lu
1.2 Money
1.3 Items
1.4 Lists
1.5 Thanks & contact info 


1.0 Save state?
        Save state is a file with a snapshot of the game progress on a given
instant. More specifically, its the CPU & Memory data on a given instant. This
guide was made and tested on ePSXe for Linux (stated above, before the index).
I guess that the files structure are the same on Linux and Windows but I cannot
be certain, since I can't and won't install Windows EVER AGAIN :P
EDIT: in fact the save states works in both versions. Just tested the Windows
version using wine. (and, surprise! running the Windows version via wine is way
better than playing the native Linux version. Go figure...)

        As I said earlier it takes some effort to hack the states. First thing,
ePSXe save states are compressed using gzip, so before you edit anything at all
you must decompress it (used gunzip but I guess 7-Zip, WinRAR, etc should do the
trick on Windows). Then you load the file on your hexeditor, edit whatever you
want, then recompress the file. Remember to remove any file extension that gets 
added to the recompressed file, if any. Now you can load the save state on the 
emulator. A word of warning, it seems that ePSXe somehow keeps the save state 
in memory, so to edit it you must close it before. Phew! I said it was tricky :)

EDIT: I recently used ePSXe 1.7 -- wine emulation :P -- and there's no need to
gzip the file again after you're done editing it... just load it (no need to
restart the emulator too!!)

So, to be clearer, that's how I (used) to do it myself:
$ mv SCUS_942.54.001 SCUS_942.54.001.gz
$ gunzip SCUS_942.54.001.gz             #decompressing the file
$ bless SCUS_942.54.001                 #loading on the hexeditor
$ gzip SCUS_942.54.001                  #done editing, recompressing it 
$ mv SCUS_942.54.001.gz SCUS_942.54.001 #removing file extension
$ cd ..
$ ./epsxe                               #play away

Since now there's no need to gzip again the file neither restart the emulator
it may be already running... SO here's the improved way:
$ wine ePSXe.exe &                      #yeah the windows version IS better :P
$ cd sstates/                           
$ mv SCUS_942.54.001 SCUS_942.54.001.gz #save state name of course
$ gunzip SCUS_942.54.001.gz             #decompress file
$ bless SCUS_942.54.001                 #load it on hexeditor
                                        #reload it on ePSXe and play away

        BACKUP YOUR FILES before you edit them to save yourself a lot of grief
in case something goes wrong! Saving in two or more slots and editing one does
the trick neatly.

1.1 Chars stats offsets
YEAHHH you can rename everyone if you wish to :)
As a note, multi-offset stats (HP, MP) are inverted i.e most significant digit
goes last. Just like the money offsets, check below.

1.1.1 Hidden Stats?!
        There are some char stats are hidden from the main menu i.e. no way to
figure, in-game, their values. They follow basically the same hidden stats that
existed on BoF3 (yeah they were there too!!). All thanks to Zhi Cheng Liu for 
this. Check his BoF3 Secrets Guide for further explanations along with some
nice tables and in-depth info on them.
        The hidden (BoF3) stats are: Willpower, Resistances (Physical, Fire, 
Ice, Electric, Earth, Wind, Holy, Mind, Status, Death), surprise rate, reprisal 
rate, critical rate, dodge rate, and attack accuracy. Willpower is the chance 
of auto-revival during battle when you are KOed the first time, the resistances
are how well a given char copes with an element attack on him/her, surprise 
rate are your chances at first strike at battle, reprisal rate is counter
attack frequency, critical rate is how ofter you crit when you attack, dodge
rate is how often you dodge an incoming attack, and attack accuracy is, well,
self-explanatory :P Willpower and surprise/reprisal/critical/dodge/accuracy
rates range from 0x00 to 0x64 (i.e 0 to 100 decimal), the resistances range
from 0 (most vulnerable) to 7 (damage is negligible or absorved). Like other
stats, there are both natural values and equipped values for all of those.
        All that said, I still haven't tested all this very well yet... there
are some values that are easy to guess (i.e. Ryu is strong to fire and weak to
ice and Fou-lu is just the reverse...) Also, the list may not be exactly the
same as BoF3... it will take some time to pinpoint exactly which offset is 
which, coming in a future update :) The list below are the natural values of
all chars (values in hex):

Ryu      02 02 02 02 04 02 01 02 05 02 02 02 19 0A 06 06 32 64
Nina     03 02 02 02 02 03 02 02 05 02 02 02 00 00 00 14 32 64
Cray     02 02 02 02 02 02 02 03 05 02 02 02 00 0F 04 04 37 64
Scias    02 02 02 02 02 02 03 02 05 02 02 02 00 14 08 0F 46 64
Ursula   02 02 02 02 03 02 02 02 05 02 02 02 00 00 02 0A 37 50
Ershin   02 03 02 02 02 02 02 02 05 05 05 19 00 04 00 1E 5A 39
Fou-lu   02 02 02 02 01 02 04 02 05 07 07 07 19 14 0F 08 46 64

So my educated guess, with the very little testing I've done so far, is that 
the order is: *dunno*, Physical?, *dunno*, *dunno*, Fire,  Wind, Ice, Earth, 
Holy,Mind,Status,Death, Suprise, Reprisal, Willpower, Dodge, *dunno*, *dunno*.

Lots of *dunno*... It will get fixed soon don't worry :)

1.1.1 Ryu
Name                     0x11AB06-0x11AB0F
Current HP               0x11AB1A-0x11AB1B
Current MP               0x11AB1E-0x11AB1F
Max HP                   0x11AB62-0x11AB63
Max MP                   0x11AB66-0x11AB67
CP  (equipped/natural)   0x11AB46/0x11AB6A
Pwr (equipped/natural)   0x11AB48/0x11AB6C
Def (equipped/natural)   0x11AB4A/0x11AB6E
Agl (equipped/natural)   0x11AB4C/0x11AB70
Wis (equipped/natural)   0x11AB4E/0x11AB72
Hidden stats (equipped)  0x11AB50-0x11AB61
Hidden stats (natural)   0x11AB74-0x11AB85


1.1.2 Nina
Name                     0x11AB9E-0x11ABA5
Current HP               0x11ABB2-0x11ABB3
Current MP               0x11ABB6-0x11ABB7
Max HP                   0x11ABFA-0x11ABFB
Max MP                   0x11ABFE-0x11ABFF
CP  (equipped/natural)   0x11ABDE/0x11AC02
Pwr (equipped/natural)   0x11ABE0/0x11AC04
Def (equipped/natural)   0x11ABE2/0x11AC06
Agl (equipped/natural)   0x11ABE4/0x11AC08
Wis (equipped/natural)   0x11ABE6/0x11AC0A
Hidden stats (equipped)  0x11ABE8-0x11AC0C
Hidden stats (natural)   0x11AC0C-0x11AC1D


1.1.3 Cray
Name                     0x11AC36-0x11AC3D
Current HP               0x11AC4A-0x11AC4B
Current MP               0x11AC4E-0x11AC4F
Max HP                   0x11AC92-0x11AC93
Max MP                   0x11AC96-0x11AC97
CP  (equipped/natural)   0x11AC76/0x11AC9A
Pwr (equipped/natural)   0x11AC78/0x11AC9C
Def (equipped/natural)   0x11AC7A/0x11AC9E
Agl (equipped/natural)   0x11AC7C/0x11ACA0
Wis (equipped/natural)   0x11AC7E/0x11ACA2
Hidden stats (equipped)  0x11AC80-0x11AC91
Hidden stats (natural)   0x11AB74-0x11ACB5


1.1.4 Scias
Name                     0x11ACCE-0x11ACD5
Current HP               0x11ACE2-0x11ACE3
Current MP               0x11ACE6-0x11ACE7
Max HP                   0x11AD2A-0x11AD2B
Max MP                   0x11AD2E-0x11AD2F
CP  (equipped/natural)   0x11AD0E/0x11AD32
Pwr (equipped/natural)   0x11AD10/0x11AD34
Def (equipped/natural)   0x11AD12/0x11AD36
Agl (equipped/natural)   0x11AD14/0x11AD38
Wis (equipped/natural)   0x11AD16/0x11AD3A
Hidden stats (equipped)  0x11AD18-0x11AD29
Hidden stats (natural)   0x11AB74-0x11AD4D


1.1.5 Ursula
Name                     0x11AD66-0x11AD6D
Current HP               0x11AD7A-0x11AD7B
Current MP               0x11AD7E-0x11AD7F
Max HP                   0x11ADC2-0x11ADC3
Max MP                   0x11ADC6-0x11ADC7
CP  (equipped/natural)   0x11ADA6/0x11ADCA
Pwr (equipped/natural)   0x11ADA8/0x11ADCC
Def (equipped/natural)   0x11ADAA/0x11ADCE
Agl (equipped/natural)   0x11ADAC/0x11ADF0
Wis (equipped/natural)   0x11ADAE/0x11ADF2
Hidden stats (equipped)  0x11ADB0-0x11ADC1
Hidden stats (natural)   0x11AB74-0x11ADE5


1.1.6 Ershin
Name                     0x11ADFE-0x11AE05
Current HP               0x11AE12-0x11AE13
Current MP               0x11AE16-0x11AE17
Max HP                   0x11AE5A-0x11AE5B
Max MP                   0x11AE5E-0x11AE5E
CP  (equipped/natural)   0x11AE3E/0x11AE62
Pwr (equipped/natural)   0x11AE40/0x11AE64
Def (equipped/natural)   0x11AE42/0x11AE66
Agl (equipped/natural)   0x11AE44/0x11AE68
Wis (equipped/natural)   0x11AE46/0x11AE6A
Hidden stats (equipped)  0x11AE48-0x11AE59
Hidden stats (natural)   0x11AE6C-0x11AE7D


1.1.7 Fou-lu
Name                     0x11AE96-0x11AE9D
Current HP               0x11AEAA-0x11AEAB
Current MP               0x11AEAE-0x11AEAF
Max HP                   0x11AEF2-0x11AEF3
Max MP                   0x11AEF6-0x11AEF7
CP  (equipped/natural)   0x11AED6/0x11AEFA
Pwr (equipped/natural)   0x11AED8/0x11AEFC
Def (equipped/natural)   0x11AEDA/0x11AEFE
Agl (equipped/natural)   0x11AEDC/0x11AF00
Wis (equipped/natural)   0x11AEDE/0x11AF02
Hidden stats (equipped)  0x11AEE0-0x11AEF1
Hidden stats (natural)   0x11AF04-0x11AF15

1.2 Money
        Money offsets are reversed i.e. most significant digit goes last...
Example: to have 50000 Zenny (0xC350) you must fill the offsets 0x50 - 0xC3
Money offsets: 0x11AF3A, 0x11AF3B, 0x11AF3C

1.3 Items
       Items are composed of two offsets, the first defines which item and the
second, its quantity. For example, to add 15 Panaceas to your inventory on the
very first item slot, put 0x0E on offset 0x11AF52, then 0x0F on 0x11AF53. :)

Inventory offset start: 0x11AF52

1.4 Lists

1.4.1 Item List
00  Nothing        01  Healing Herb     02  Vitamin         03  MultiVitamin
04  SuperVitamin   05  Vitamins         06  Berries         07  Apple
08  Wisdom Seed    09  Wisdom Fruit     0A  Croc Tear       0B  Antidote
0C  Eye Drops      0D  Jabberglass      0E  Panacea         0F  Ammonia
10  Life Shard     11  Magic Shard      12  Power Food      13  Protein
14  Swallow Eye    15  Fish-head        16  Ambrosia        17  Weather Vane
18  Void Sphere    19  Molotov          1A  Firecracker     1B  Electrode
1C  Dynamite       1D  Water Bomb       1E  Icicle          1F  Napalm
20  Taser          21  Belladonna       22  Scorched Rice   23  Aurum
24  Moon Tears     25  Ginseng          26  Ivory Dice      27  Dragon Scale
28  Headband       29  Knockout Gas     2A  Flash Grenade   2B  Poison Powder
2C  Mouth Gag      2D  Jelly Fish       2E  Piranha         2F  Bass
30  Blue Gill      31  Sweetfish        32  Browntail       33  Black Bass
34  Angelfish      35  Trout            36  Rainbow Trout   37  Bullcat
38  Martian Squid  39  Dorado           3A  Salmon          3B  Barandy
3C  Sturgeon       3D  Man-o'-War       3E  Flying Fish     3F  Blowfish
40  Moorfish       41  Sea Bass         42  Flatfish        43  Sea Bream
44  Octopus        45  Bonito           46  Black Porgy     47  Angler
48  Spearfish      49  Whale            4A  Acheron         4B  Rice Ball
4C  Mozweed        4D  Straw            4E  Faerie Drop     4F  Stamp Card
50  Ship Parts     51  Glass Shard      52  Iron Scraps     53  Lottery Stub
54  Ribs           55  Roast            56  Flank           57  Loins
58  Fire Seed      59  Wind Seed        5A  Water Seed      5B  Earth Seed
5C  Spirit Seed    5D  Vigor Seed       5E  Phoenix Seed    5F  Holy Seed
60  Strength Seed  61  Hard Seed        62  Speed Seed      63  Sage Seed
64  Strike Seed    65  Reflex Seed      66  Dodge Seed      67  Sight Seed
68  Target Seed    69  Elixer           6A  Elixer+         6B  Wassail
6C  Wassail+       6D  Draught          6E  Draught+        6F  Dark Daught
70  Bird Drop      71  Rotten Meat      72  Bent Screw      73  Old Tire
74  Dirty Filter   75  Burnt Plug       76  Rusty Pipe      
77 and beyond -- rubbish, removed items, etc


1.5 Thanks & contact info

-Thanks to Capcom, for this wonderful game, I enjoy it to this day!
-Thanks to the free & open source software people!
-Thanks to the GameFAQs people!
-Thanks to Zhi Cheng Liu for his BoF3 Secrets Guide with the Hidden stats
info, it would take even more work to figure out WTF where those offsets...
-Thanks to anyone who deserves a thanks but I forgot to mention!

You can reach me on demonsword at gmail dot com. Please, if you want to mail
me, write in proper English so I can understand you. Offensive mails won't 
get replied. And please, I'm a busy man, so if I don't reply to you the same
day/month/year/century don't be mad at me ok? :)

---EOF