Overview
How to change your in game gold with any old hex editor.
Tools
You will need any good hex editor. It should be able to rewrite values in place and go to hex offsets.
I use Bless on linux.
You will also need a save game. Ideally start a new game, but it should work with regularly saved game as well.
What to do
Backup your savegame. They are in steamapps/common/Princess Maker 2 Refine/F10*.GNX where * is 1-9.
Open the save game in your hex editor
Remember these two magical offsets 0x70 and 0x1b4c. First offset is 4byte number of your gold. Second offset is 4byte number of sum of all bytes (I assume). I am not sure, but I expect it to modulo % 2^32, but haven’t tested that far (there was no need – if you do it, tell me if I am right).
Write down bytes at 0x70. If you start new game, there should be F4 01 (save game is saved in little endian). Now, imagine what gold you want. Use google or python to tell you what hex number you need. So lets say I want 65536 gold. That would be 0x10000. So rewrite three hexes F4 01 00 (00) at address 0x70 with 00 00 01.
Save the difference between new gold and old gold. In our example, difference was 65036.
Go to address 0x1b4c.
Check what number is written there. For me, it was 25 CE 00 00.
Convert that to decimal. In my case it was 52773.
Add the difference you got from new gold. 52773 + 65036 = 117809*.
Convert the new sum into hex: 117809 = 0x1cc31.
Rewrite the value at 0x1b4c. Remember, write it in little endian, ie from back to front in 2 numbers. 25 CE 00 00 will become 31 CC 01
Save the file and reload it in the game. If you did everything right, you should have 65536 gold.
If you instead get a corruption error, you made a mistake somewhere or you overflown.
* I think (haven’t tested it), that values will modulo 2^32 in the checksum. So, if you get above that, try to modulo it and see if it works.