For those who still have a problem with gamesave for PC or iOS version, let me explain few details. Data save is just serialized sets of classes (nothing more to add as people are doing great with finding & replaces patterns). In PC and iOS version (don’t have PS3 save) save game is compress with different algorithm. PC is using LZO1X_1 when iOS compresses data by zlib. Both saves are protected by CRC checksum. However, PC version has additional one CRC. One calculated from compressed data and 2nd generated from header.
Code:
save file = header[1024] + compressed_data[]
The compress_data is organized into blocks. The block starts with block header (18 bytes) and then results of compression of 131072 bytes of “original” save data.
Code:
save_file = header[1024] + [ [block_header] [compress block]] * X blocks
Fairchild did nice work and code compression toolkit for it. It works fine for Xbox (what I can see) but it generate ‘corrupted file’ for PC version. So what the problem?
1. He did wrong assumption that CRC checksum has constant offset and after game update it puts checksum in wrong place
2. He implemented only one check.
To fix it, you need to guys calculate CRC from whole compress data which is from offset 1024 to EOF() and put it just after game language code. In example, it’s at 0xEA. To calculate correct position it’s required to go though save header variable. Sum of first 3 in red (it’s just sizeof string), the 4th one is for DLC if you don’t have it will be 0 anything else it’s string size. And finally add 8 to results for sum and you are in correct place for 1st CRC.
2nd CRC has static offset so it’s not needed to do similar operation as for 1st one. The offset is 0x3FC. 4 bytes earlier, at 0x3F8 is size of block from beginning of save which will be used for generate checksum.
And that’s it more or less. I prepared fixer for pc and ios saves which will correct CRCs. Also I patched Fairchild’s xcom which now doesn’t break header but still requires CRC correction :) Now, you should be able to change saves.
Note: Don't worry about different save size from Fairchild tool. He used different compression level and dictionary size but game will handle it :)