It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
I'm trying to hex edit a Heroes 3 Complete edition campaign save game (with HD mod, but no unofficial expansions or other mods) in accordance with a post from heroescommunity.com that I can't seem to link to, but no dice. From what I can tell, I'm supposed to:
- extract the .CGM file (used 7zip)
- open the extracted file with a hex editor (used HxD) - here's my snag
- edit whatever I want to edit, with information about what's what being in said post
- compress it again (supposedly with 7zip) and change the filename extension back to .CGM

When trying to extract it, 7zip says "CRC failed" and makes a file that's not complete gibberish in the hex editor, just mostly. For instance the hero data (I'm trying to change secondary skills), converted Hex -> ANSI, has hero names, but no other meaningful information (the hex data is mostly 01 or FF). If I compress the file again, it ends up about a third smaller than the original and it doesn't appear in the in-game loading menu, even with the .CGM extension.

Any help would be appreciated. Also, I've never done any hex editing before, so this might be another one of those times where I missed on obvious step.
Post edited July 20, 2018 by Krof
This question / problem has been solved by ZFRimage
avatar
Krof: I'm trying to hex edit a Heroes 3 Complete edition campaign save game (with HD mod, but no unofficial expansions or other mods) in accordance with a post from heroescommunity.com that I can't seem to link to, but no dice. From what I can tell, I'm supposed to:
- extract the .CGM file (used 7zip)
- open the extracted file with a hex editor (used HxD) - here's my snag
- edit whatever I want to edit, with information about what's what being in said post
- compress it again (supposedly with 7zip) and change the filename extension back to .CGM

When trying to extract it, 7zip says "CRC failed" and makes a file that's not complete gibberish in the hex editor, just mostly. For instance the hero data (I'm trying to change secondary skills), converted Hex -> ANSI, has hero names, but no other meaningful information (the hex data is mostly 01 or FF). If I compress the file again, it ends up about a third smaller than the original and it doesn't appear in the in-game loading menu, even with the .CGM extension.

Any help would be appreciated. Also, I've never done any hex editing before, so this might be another one of those times where I missed on obvious step.
Can you post the original save file and I'll see what I can do?
Thanks for the reply and I'm sorry for the delay, I'm not quite familiar with GOG forum notifications and I just remembered to check this thread.

There isn't any single save file I'd want to specifically edit, but here's a randomish one: (I did the quoting because I don't have the rep for link posting. Hopefully not too illegal.)
My goal is to be able to edit campaign hero secondary skills to weed out unwanted ones I had to pick.
OK, unzipped. Trying it out.
Post edited July 29, 2018 by ZFR
avatar
Krof: Thanks for the reply and I'm sorry for the delay, I'm not quite familiar with GOG forum notifications and I just remembered to check this thread.

There isn't any single save file I'd want to specifically edit, but here's a randomish one:
avatar
Krof: (I did the quoting because I don't have the rep for link posting. Hopefully not too illegal.)
My goal is to be able to edit campaign hero secondary skills to weed out unwanted ones I had to pick.
OK, it seems to work for me. Here is what I did:

_ Unzip using 7zip. Igonre CRC errors.
_ Downloaded HxD for hex editing.
https://mh-nexus.de/en/hxd/
_Check this for editing reference (not just the first post, there is more info later)
http://heroescommunity.com/viewthread.php3?TID=18817&pagenumber=1

In the example you gave me I found Terek. Let's try to change his secondary skills.

Open the file in HxD and find the string "Terek". See attachment.
_ The hero's name is stored in 13 bytes. These are the bytes highlighted.
_ The next 28 bytes represent his secondary skill. These are the bytes in grey brackets. 00 means none, 01 means basic, 02 means advanced and 03 means expert. For order of skills refer to the thread above.
_ Note the 8th byte (underlined in red) which is Basic Wisdom and 20th byte (underlined in green) which is Basic Tactics.
_ The next 28 bytes show which secondary skill appears in which slot. A value of 01 means the skill is in first slot, 02 means skill is in second slot... etc.
_ Note the 8th byte (underlined in light red) which is Wisdom has a value of 01 (first slot) and the 20th byte (underlined in light green) is Tactics which has a value of 02 (second slot).
Putting more than one skill in the same slot or into invalid slots might lead to unwated effects or crahing.

So let's try to give Terek Leadership. That's skill #7

Step 1:
Change the value in orange box to 01 for Basic, 02 for Advance and 03 for expert.
Note: you can stop here, in which case the leadership skill will not appear in the hero's skill screen, but you will still get its effect (you can see morale increase). In fact you can get the expert effect of all 28 skills, even though only 8 will appear in the hero's screen.

Step 2:
Change the value in black box to 03. This means the leadership skill will appear in the 3rd slot.

Step 3:
Note the value 02 in the pink box. That box is located at -126 offset from the beginning of hero's name (i.e. 126 byte before the beginning of hero's name). That's where the total number of active skill slots to be shown is stored. Since we added a third skill, change that value to 03.

You can do other changes. Those FF's at the bottom for example are where artifacts are stored. FF FF FF FF means empty. Note the 62 00 00 00; those are the boots of speed. Again, check the thread for reference.

Next, you have to re-zip the edited file. You can do it in 7zip, but you must change archive type to gzip. See attachment.

And you're done. You can load the game, and Terek now has a new Leadership skill.

Try experimenting using the reference thread I posted. I'm not an expert on Heros save editing, but if you need any help, give me a shout and I'll see what I can do.
...
Attachments:
hex.png (187 Kb)
7zip.png (72 Kb)
new_terek.png (448 Kb)
Post edited July 29, 2018 by ZFR
You sir are a gentleman and a scholar.

As far as I can see, these are the most detailed instructions on how to do this on the internet and I hope they help future generations as well. Although I see I could've known not to make my mistakes (like compressing into .7z rather than .gzip, although I noticed the game will recognize and load uncompressed files as well, as long as they have the .CGM or .GM1 extension).

I haven't gotten around to trying this yet, but I have noticed I mostly need to pay attention to the hex data, instead of the text and that it's not jibberish at all. With that, the instructions and the reference post (that I previously kinda misunderstood) everything seems clear and I've been fully helped, many thanks.
avatar
Krof: You sir are a gentleman and a scholar.
Thanks, glad I could help. Enjoy your editing and as I said don't hesitate to reach out if you're stuck anywhere.