• Civ7 is already available! Happy playing :).

Hex editor for newbies

DannyITR

Chieftain
Joined
Oct 1, 2006
Messages
17
Hi all,

I'm wondering if somoene can put together a step by step instruction on how to modify civ.exe with a hex editor? In all of the posts I've seen, most seem to be quite advanced and don't explain anything at all. For example this is what I see when I open civ.exe but none of the instructions ever match what I see here so I don't know what to modify.

1736688277860.png
 
For exmaple. Here are instruction on how to patch for the arctic anomoly. There is no row in the offset column that matches 0x4718C and there are 11 columns of digits but my file has 15.

1736688956871.png
 
The column widths are just how the file is displayed for your convenience. You can just search for those consecutive bytes and it doesn't matter if they run over into another column or start in the middle of a row, it's purely a visual thing.

The offset is a specific byte that may show up anywhere in a row depending on how you choose to view the file. Forget rows, just imagine you're counting bytes from the start of the file. They could all be in a single giant row and it would make no difference to the program.
 
ok thank you! Is the offset a reference for a starting point? I can't find the once mentioned.

1736691425076.png
 
yeah, those are just there to show you the offset of the first byte in the row, to save you actually having to count from the start of the file! Don't forget the offsets are in hex too, so 47189 is followed by 4718a.
 
yeah, those are just there to show you the offset of the first byte in the row, to save you actually having to count from the start of the file! Don't forget the offsets are in hex too, so 47189 is followed by 4718a.
Thankyou so much for the reply. I don't really understand what you mean though :( I also can't find the series 9A 41 70 91 0C 83 C4 06 B8 0B 00.
 
Last edited:
For example, I have v475.01 right now. The patch is the following

EN47501 =
[0] offset=0x4793F(293183); bytes=9090B8070D83C400B80B00; original=9AC16E070D83C406B80B00

The offset is the position in the file where this series of bytes starts. The first byte of the file is at offset 0 (you start counting from 0, not 1) then you just keep counting them left to right. Of course hex editors are there to save you time so you don't need to actually count. Most of them will have some kind of goto offset function. I'm using Frhed as my hex editor of choice which lets me put a bookmark at any offset I want and jump to it. I imagine your editor does too.

You can also see that if I start reading the bytes from that offset, the bytes match what is described as 'original' in the patch description. And also note that it is irrelevant where in the row the first byte is located. I could tell my hex editor to have a different number of bytes in the row and it would visually show up somewhere else.
1736692250157.png
 
For example, I have v475.01 right now. The patch is the following

EN47501 =
[0] offset=0x4793F(293183); bytes=9090B8070D83C400B80B00; original=9AC16E070D83C406B80B00

The offset is the position in the file where this series of bytes starts. The first byte of the file is at offset 0 (you start counting from 0, not 1) then you just keep counting them left to right. Of course hex editors are there to save you time so you don't need to actually count. Most of them will have some kind of goto offset function. I'm using Frhed as my hex editor of choice which lets me put a bookmark at any offset I want and jump to it. I imagine your editor does too.

You can also see that if I start reading the bytes from that offset, the bytes match what is described as 'original' in the patch description. And also note that it is irrelevant where in the row the first byte is located. I could tell my hex editor to have a different number of bytes in the row and it would visually show up somewhere else.
View attachment 714857
 
Ok I see the original code now. If I understand corectly I need to repalce the original with 9090B8070D83C400B80B00?

Edit: I did it but my game still has the extra land and is crashing because I have a city too close to the top of the map. I guess it only works on new games?
 
Last edited:
Ok I see the original code now. If I understand corectly I need to repalce the original with 9090B8070D83C400B80B00?

Edit: I did it but my game still has the extra land and is crashing because I have a city too close to the top of the map. I guess it only works on new games?
@DannyITR could you please share the corrupted game save (in this thread or privately) because I'm curious what exactly is corrupted. I also would like to see how will OpenCiv1 handle this corrupted game save.

Thanks :)
 
Top Bottom