Need for Speed Carbon Hex Editing Guide

(Difference between revisions)
Jump to: navigation, search
(Customization2 Slot)
(Vinyl Slot)
Line 124: Line 124:
 
=== Vinyl Slot ===
 
=== Vinyl Slot ===
 
==== Hex Editor ====
 
==== Hex Editor ====
 +
The vinyl slots start at 0002FEB8h. To get to your car's vinyl slot, read the vinyl slot link number in the customization slot of your car (or the next slot link from the current vinyl slot), multiply it with 1ch (the size of one vinyl slot) and add the result to 0002FEB8h (Slot number x slot size + start of block).
 +
<br/>
 +
Example: If your vinyl slot link is 08, you will find the vinyl slot at 08h x 1Ch = E0h + 0002FEB8h = 0002FF98h.
 
==== Memory Editor ====
 
==== Memory Editor ====
 +
As we did for finding all other blocks in memory, find the start of the car slot block and we calculate from there. Multiply the vinyl slot link number from the customization slot (or the next slot link from the current vinyl slot) with 1Ch (the size of a vinyl slot) and add the result to the found address + 1F2E8h (1F2E8h = FA0h + 14CD0h (14CD0h = 4Bh x 470h = 75 customization slots with a size of 470h Bytes) + 208h (208h = Ah x 34h = 10 career slots with a size of 34h Bytes) + 9470h (9470h = 251Ch x 04h = 9500 part slots with size 4 Bytes)).
 +
<br/>
 +
Example: My carslot block starts at 0E44228Ch. My vinyl slot 08 will then start at 08h x 1Ch = E0h + 0E44228Ch + 1F2E8h = 0E461654h.

Revision as of 14:55, 24 December 2006

Here is some information which should help you hex-edit your savegame or memory, of course not every detail is covered. If you aren't yet familiar with hex-editing you might want to read the MW Hex-Editing Guide & Tutorial, which is for MW though but also gives you some basic ideas about hex-editing a savegame. If you have any questions, comments, or concerns, please make a post here. One of our resident hex editors will try to answer your question as soon as possible.

And don't forget:
Before messing with savegames, always make a backup copy!

Contents

Overview

The car data is stored in 5 blocks in the savegame:

  • Car slots:
    A car slot contains the car code, link to customization & career slot and some other stuff (like car category). There is space for 200 car slot entries.
  • Customization slots:
    A customization slot contains a link to the customization2 & vinyl slot and some customization like performance parts, autosculpt settings, car/rimpaint and ride height. There is space for 75 customization entries.
  • Career slots:
    Your heat, impounds and other career related things are stored here. There is space for 10 career slots.
  • Customization2 slots:
    A customization2 slot contains the bodies, rims, spoilers, hoods, scoops, windowtint and sometimes a texture vinyl (Most Wanted style vinyl). There should be space for 75 customization2 slots.
  • Vinylslots:
    These were newly introduced with Carbon. They will hold the vinyl code, color, size & stuff. There is space for 700 vinyl slots. With a total of 75 customization slots, this will leave you with 9.333 vinyls per car

Savegame Structure

Car Slot

A single carslot uses 14h Bytes and is built like this: http://img367.imageshack.us/img367/6679/thecarslotfinaloe3.png

  • Carslot number:
    This is the car slot number, it's usually a subsequent number. However, for some bonus cars it's a unique id.
  • Logocode:
    This is the code of the logo/name which will be displayed for your car (Sometimes this code is useless because the game uses the carcode to decide which logo/name to display).
  • Carcode:
    This is the actual car code identifying your car, check the last section for logo/carcodes.
  • Car membership:
    This identifies where the car will be available (01 = stock, 02 = career, 04 = my cars, 08 = bonus, 10 = custom, 20 = special, 40 = won car, 80 = wingman car).
    The second byte is usually 00, if you change it to 01 the car will show up in the Mazda Dealership and as another side effect it's price will be 0$ in the carlots (Thanks to STAT-X for this info).
  • Car category:
    This identifies which category a car will show up (01 = muscle, 02 = exotic, 04 = tuner (Note: Bonus & addon cars use 08/0F instead)).
  • Customizaion slot link:
    This is the customization slot link number. It's the number of the customization slot which belongs to this car (Note: it is FF if the car is stock).
  • Career slot link:
    This is the career slot link number. It's the number of the career slot which belongs to this car (Note: it is FF if it's not a career car).

Customization Slot

A single customization slot uses 470h Bytes and looks like this (the image only shows the first bytes): http://img367.imageshack.us/img367/1433/thecustslotfinalow0.png

  • Customization2 slot link:
    This is the Customization2 slot link number. It's the pointer to the start of Customization2 slot which belongs to the car's customization.
  • Vinyl slot link:
    This is the Vinyl slot link number. It's the number of the vinyl slot which belongs to the car's customization (Note: it is FF FF if the car has no vinyl applied).
  • Tires:
    This is the current performance upgrade level of the car's tires.
  • Brakes:
    This is the current performance upgrade level of the car's brakes.
  • Suspension:
    This is the current performance upgrade level of the car's suspension.
  • Transmission:
    This is the current performance upgrade level of the car's transmission.
  • Engine:
    This is the current performance upgrade level of the car's engine.
  • Turbo/Supercharger:
    This is the current performance upgrade level of the car's turbo/supercharger.
  • NOS:
    This is the current performance upgrade level of the car's nitrous oxide system.
  • Owned parts:
    This is a number calculated from all the parts you own, so the game know which parts you have to pay in career.
  • Customization slot number:
    This is the customization slot identifier referenced by the car slot.
  • Paint:
    This is the paint of the car.
  • Wheel Paint:
    This is the paint of the car's wheels.
  • Autosculpt values:
    Here are all the settings from the autosculpt parts.
  • Ride Height:
    Not shown in the picture, but the slot ends with the car's ride height.

Career Slot

A single career slot uses 34h Bytes and looks like this: http://img147.imageshack.us/img147/9349/thecareerslotfinalsq6.png

  • Career slot number:
    This is the number identifying the career slot, it's the number referenced from the car slot.
  • Max impounds:
    This is the max number of impound strikes your car can get before it's taken away by the cops (min 03, max 05).
  • Current impounds:
    This is the amount of imounds strikes the car currently has.
  • Car heat:
    This is the car's heat.
  • Career specific car info:
    Here is some career specific car info like times busted/escaped etc.

Customization2 Slot

There is nothing like a customization2 slot (as a whole block), instead there are many part slots which are chained together. This means the customization2 will vary in size (the chain expands/shrinks with adding/removing parts) and it might be spread over a large area. One single part slot uses 4 Bytes and looks like this:
http://img143.imageshack.us/img143/7400/thecust2slotfinalvq2.png

  • Part code:
    This is the code of the part. The code can represent things like rims, spoilers, hoods, scoops, skirts, side mirrors, vinyl textures, window tint etc.
  • Next slot link:
    This is the pointer to the next part slot belonging to the car. It is FF FF if the end of the chain has been reached and there are no more parts for the car.

The savegame offers space for 9500 part slots, this should be enough for the 75 customization slots which have a "customization2".

Vinyl Slot

A single vinyl slot uses 1Ch Bytes and looks like this: http://img90.imageshack.us/img90/3066/thevinylslotfinalvc8.png

  • Move:
    This is the value the vinyl has been moved.
  • Rotate:
    This is the value the vinyl has been rotated.
  • Skew:
    This is the value the vinyl has been skewed.
  • Scale:
    this is the vinyl's scale value.
  • Vinyl code:
    This is the vinyl code identifying the vinyl. Check the last section for vinyl codes.
  • Next slot link:
    Like the part slots for customization2 the vinyl slots can be linked. This is used whenever you apply more than one vinyl to the car. The link is the number of the vinyl slot used for the next vinyl.
  • Color1:
    This is the vinyl's first color value.
  • Color2:
    This is the vinyl's seconds color value.
  • Color3:
    3rd color value.
  • Color4:
    4th color value.

Finding a Block

If you know exactly what you are looking for, you can always search for the representing bytes. Just make sure that what you found is really what you were looking for, or you might end up editing something else.

Car Slot

Hex Editor

The car slots start at 00010BD0h. As there are already 138 slots used, your first player car (with slot number 8A) is at 00011698h. Searching for the car code of the car (and it's membership and category) should get you to the car slot you are looking for. If you know the car slot number you can of course multiply the car slot number with 14h (the size of one car slot) and add the result to 00010BD0h.

Memory Editor

As your memory is quite big, you need to search for a value you want to edit (if you know it) or which is located near the value you want to edit. For example the first car slot number is 78563412, that should be a good value.

Customization Slot

Hex Editor

The customization slots start at 00011B70h. To get to your car's customization read the customization link number in the car slot of your car, multiply it with 470h (the size of one customization slot) and add it to 00011B70h (Slot number x slot size + start of block).
Example: If your customization link number is 21, you should go to 21h x 470h = 9270h + 00011B70h = 0001ADE0h.

Memory Editor

As the data will most certainly be located at another memory location the next time you start the game, you need to find a value to start and calculate the offsets from there. A good start would be the beginning of the car slot block. Search for 78563412 and note down the address you found.
Next, you find your car's customization link number, mulitply it with 470h and add the result to the above address + FA0h (FA0h = C8h x 14h = 200 car slots with a size of 14h Bytes).
Example: My carslot block starts at 0E44228Ch. Customization slot 21 will start at 21h x 470h = 9270h + 0E44228Ch + FA0h = 0E44C49Ch.

Career Slot

Hex Editor

The career slots start at 00026840h. To get to your car's career slot, read the career slot link number in the car slot of your car, multiply it with 34h (the size of one careerslot) and add it to 00026840h (Slot number x slot size + start of block).
Example: If your career slot link number is 02, go to 02h x 34h = 68h + 00026840h = 000268A8h.

Memory Editor

Like for the customization above find the address of the beginning of car slot block, then mulitply your career slot link number with 34h and add it to the found address + 15C70h (15C70h = FA0h + 14CD0h (14CD0h = 4Bh x 470h = 75 customization slots with a size of 470h Bytes)).
Example: My carslot block starts at 0E44228Ch. Career slot 02 will then start at 02h x 34h = 68h + 0E44228Ch + 15C70h = 0E457F64h.

Customization2 Slot

As mentioned in the previous section, there is no block of code with fixed size & position representing a customization2 slot. Instead there are plenty of 4 Byte part slots linked together and most certainly spread over the whole area for customization2. However, if you buy/add a new car or edit a premade one, the chain will be in one block, it will start to fragment when doing changes ingame. The customization2 link in the customization slot is the pointer to the first element in the chain. All elements can be located the same way:

  • To get to the address where the first element of your part chain is located, read the customization2 link number (Note: the number is 2 Bytes in size) in the customization slot of your car.
  • To get to the address of the next element in the chain, read the next link number of the current part slot (2 Bytes).

As the 2 Bytes for the link are in little endian order (this means the lowest order number comes first) you need to reverse the Byte order (not the numbers representing one byte) to bring them into big endian order.

Hex Editor

The part slots start at 00026A48h. Multiply the big endian value you read above with 4h (as one part slot is 4 Bytes in size) and add the result to 00026A48h.
Example: The customization2 link in my customization slot is 64 06. Reversing the byte order to bring it into big endian format will give us 06 64. So the start of the part slot chain is at 664h x 4h = 1990h + 00026A48h = 000283D8h.

Memory Editor

Like for the career and customization slots above, find the address of the beginning of car slot block, then multiply your part slot link number with 4h and add it to the found address + 15E78h (15E78h = FA0h + 14CD0h (14CD0h = 4Bh x 470h = 75 customization slots with a size of 470h Bytes) + 208h (208h = Ah x 34h = 10 career slots with a size of 34h Bytes)).
Example: My carslot block starts at 0E44228Ch. The first part slot (which is linked as 64 06) will then start at 664h x 4h = 1990h + 0E44228Ch + 15E78h = 0E459A94h.

Vinyl Slot

Hex Editor

The vinyl slots start at 0002FEB8h. To get to your car's vinyl slot, read the vinyl slot link number in the customization slot of your car (or the next slot link from the current vinyl slot), multiply it with 1ch (the size of one vinyl slot) and add the result to 0002FEB8h (Slot number x slot size + start of block).
Example: If your vinyl slot link is 08, you will find the vinyl slot at 08h x 1Ch = E0h + 0002FEB8h = 0002FF98h.

Memory Editor

As we did for finding all other blocks in memory, find the start of the car slot block and we calculate from there. Multiply the vinyl slot link number from the customization slot (or the next slot link from the current vinyl slot) with 1Ch (the size of a vinyl slot) and add the result to the found address + 1F2E8h (1F2E8h = FA0h + 14CD0h (14CD0h = 4Bh x 470h = 75 customization slots with a size of 470h Bytes) + 208h (208h = Ah x 34h = 10 career slots with a size of 34h Bytes) + 9470h (9470h = 251Ch x 04h = 9500 part slots with size 4 Bytes)).
Example: My carslot block starts at 0E44228Ch. My vinyl slot 08 will then start at 08h x 1Ch = E0h + 0E44228Ch + 1F2E8h = 0E461654h.

Personal tools
Namespaces
Variants
Actions
NFSUnlimited
Need for Speed Wiki
NFSUnlimited.net Wiki
Toolbox