Need For Speed Carbon Save Editor ================================= This program is really very simple to use, but there are a few features which require a more detailed explanation. After starting this editor you have to pick your game profile from the list and then use "Edit" or "Tools" button. Its pretty obvious. The game reads the "NFS Carbon" folder under My Documents and each profile is stored in a separate folder named A<your_alias> in a file with the same name in that folder. So, for example, if my alias is "Driv3r" then my savefile path is: %USERPROFILE%\My Documents\NFS Carbon\ADriv3r\ADriv3r The name displayed by both the game and this save editor will be the name of the file without the leading 'A' char (which I think stands for "Alias"). Why not the name stored in savefile? Because of optimization. To read the name from the savegame the main data table has to be decompressed and parsed as it is stored as a plain text (that will be described in more detail later). After you have selected your profile, use "Edit" button to make changes. There is nothing special here except of the effect I emphasized in readme - make backups of your savefiles before using unlock features because the changes made can't be reverted later by no other means except restoring the file from its backup copy. The "Tools" section allows you to determine the state of your savefile: whether its checksums are correct and the cd keys in save and in registry match each other. You can change both cd keys (savefile/reg) but remember that they must be equal (its ok if they are both empty). Also keep in mind that nothing is physically changed unless you push the "Save Changes" button. If you will manually edit your saves, you need to update the checksums. To do that use "Fix" button. Incorrect checksums are highlighted in red. The last thing here is the list of compressed data blocks in savefile. Usually the savefile contains 3 compressed blocks, the last of them is the main data table (a simple plain text). The smallest of these blocks usually is empty and contain only zero bytes. That blocks are described by "CompressedBlock" structure (defined in lib\NFSCSaveLib.h) and use two types of compression algorithms. The program searches only for JDLZ blocks (LZ dictionary based compression). The first block can be compressed with either JDLZ or HUFF (Huffman coding?) algorithm, the latter two are always compressed using JDLZ. You can decompress and store any of these blocks into a file by using "Export..." button, maybe modify or view them and import back with "Import..." button. The "LF <-> CR/LF (text/binary mode)" checkbox controls how the decompressed/imported data must be treated: as a text file (uses text mode for fopen() function - carriage return?linefeed combinations are translated into single linefeeds on input, and linefeed characters are translated to carriage return?linefeed combinations on output) or a binary file (untranslated). And remember, not all the data is stored inside these compressed blocks, the live example is car heat level. Now about the main data table. It consists of lines of specially formatted text. The first number is a unique key (or id, no matter how its called) followed by the colon, then an array of values, delimited with tabulation characters and all this ends up with linefeed character. Values can be signed integers, floating point or strings (in that case they are surrounded with double quotes). So, any value can be located by that unique id and its position (offset, index) in the corresponding array. For example, to change alias, we modify the first value in a row identified by the key 841929775 (later I will use the key[zero-based-index] notation, for the previous example it will be 841929775[0]). Also it is possible to modify gameplay and pursuit stats (partially) by changing values of 831388323 array (the time is encoded in 1/4000 of second, so for example, if you see that the game shows time 5:08.68 then you should look for a value in a range (5*60+8)*4000 ... ((5*60+8)+1)*4000 (e.g. 1232000 ... 1236000) or just divide all rather big numbers by 4000 and compare the result with the time in seconds. Almost all unlocks implemented in this program manipulate the 3391526480 array. This array holds (id, state) pairs which actually define unlocked items. An id is a unique number/hash that identifies a specific part (it can be a car, vinyl or anything else) and the state is a boolean value (1 or 0) that makes "!" sign appear (in case of 1) alongside the corresponding menu item. 3391526480[0] is a count of these pairs, 3391526480[1]...3391526480[3] are also read by game code, but I did no examination about their meaning. When the game displays the menu it consecutively takes the id's of the parts and iterates through this array to see if it is there. So what this prog does - it adds these part ids to the 3391526480 array and sets their state to 0. That's why it can't be reverted (in fact it can ;-) but that would make the program more complicated as the "alredy present" pairs must be stored somewhere and then read back again on undo action). To unlock reward cards the program searches the 2268361667 array for the value of 100 (in case of main) or 40 (in case of online exclusive) followed by the corresponding number of one/zero pairs. The first value in each pair defines the state of the reward card task (1 - complete, 0 - incomplete), the second is always zero. The program unlocks both main and online exclusive reward cards and that means the corresponding bonuses are instantly available after you reload your profile (it can be easily checked in Quick Race - you will get all that bonus and custom cars). However the messages stating that you have earned these bonuses will be displayed only after at least one of the reward card tasks is accomplished. These arrays of pairs are projected on an actual reward card tasks in a way as if you just moved from left to right across them in the game with the "Right Arrow" key. So, for example, to completely open the first main reward card we need to put 1 into the first value of the 1-st, 2-nd, 11-th and 12-th pair; for second - 3, 4, 13, 14 pair, etc. And a few words about checksums. The checksum protection scheme is similar to NFS Most Wanted, but EA has strengthened the default MD5 hash with custom algorithm (more likely it is some part of libtomcrypt/libtommath lib but I won't assert that, fairly I don't know and I had no time to discover what it was in fact). That's why the hash calculation code was "borrowed" from the game exe :-) Besides, you can use it in your own programs, just for that there is a C header file with function prototypes and a lib for dynamic linking with NFSCSaveLib.dll in the "lib" folder (read the comments in header to find out how the specific function must be used). Well, that's all I'd like to say... And oh, don't send me e-mails like "anything else for NFS Carbon?" or "can you for $$$ or something else make for me xxx yyy?" - these can be deleted without confirmation. I do that for fun in my free time just because I want to, besides I had played all the games of NFS series... Any updates and bugfixes will be uploaded to my homepage. It is not permanent, so use the following address: http://kickme.to/coderipper If you have found a bug or something, please try first checking for the most recent version at my homepage, maybe the problem is already solved. Regards CoDe RiPPeR (code_ripper@ukr.net)
komoroski123