Sorry for the necro.
I think I have a solution, but it requires a two-step approach. I am pretty sure the SAV is not structured with fixed offsets. Instead it seems like it is a series of sections, with each section expanding with more data as the game continues. I suspect there is "meta" data in the first sections that would allow you to jump to the exact location for each section, but I haven't cracked those first sections yet. I used the tips in this thread to search for the "village section" instead.
I first scanned the hex data for coordinates followed by one of the tribe flags. I used regex. The "\x" flags made it possible to match a range of hex values like you would use [0-9] to match a digit:
/([\x01-\x38][\x01-\x46][\x04-\x0b])/
This ugly stream of characters searches for three bytes:
- [\x01-\x38] The first byte in the decimal range 1-56 (a valid X coordinate)
- [\x01-\x46] The second byte in the decimal range 1-70 (a valid Y coordinate)
- [\x04-\x0b] The third byte in the decimal range 4-11 (a valid tribe flag)
Secondly, I had to look for the spacing between the matches. There are several sections of the SAV file where these patterns can be found. To find the right section, I looked for a series of matches that were each exactly 18 bytes apart.
This method exactly lists all the villages, but that is just a start. I'm not sure what the other fifteen bytes are yet, nor am I sure what the other section of matches represents.
I'm going to continue working on decoding the full SAV file using another thread:
https://forums.civfanatics.com/threads/decoding-colonization-sav-files-1994-old-classic.674707/
If I can decode the full SAV file, then a building a companion utility to keep track of the settlements would be an easier feat.
Thank you for all the discussion in this thread, it really helped me.