Adding DVARs to a MW3 Savegame

I’ve gotten alot of request from people on how to add DVARs to a Modern Warfare 3 gamesave. In this tutorial, I will explain how to do it, in detail. This tutorial is assuming that you’ve extracted the file out of your savegame.svg, and you know have it open in a hex editor.

Thanks to CLK for helping map out the save, and Chris for testing stuff :smile:


Adding the DVAR

1. First we will need to find out where our DVAR listing is. I have not figured out how to do this by reading it correctly, but you can just search for a DVAR. So search for a common DVAR that should be located in all saves(ex. “hud_missionFaileBd”).

2. Once you find a DVAR, just scroll up until you see the first DVAR. This is not needed, but will make things much simpler. Each DVAR has 2 bytes before the name, so find the location of the name of the first one, and then go back 2 offsets to get to the beggining of the DVAR list. [details=Open Me][/details]

3. This is where we will add our new DVAR.

DVAR Structure:

0x0 = Telling you where the 'B' is located in the name.
0x1 = The length of the string/DVAR.
0x2 - Length of the string = The string/DVAR name.
Byte following the name = B located in the value.
Byte after the previous one = Length of the value.

[details=Example]Saying this, the DVAR with the picture I posted above would have the following values:

B in the name location = 0x10
Length of name = 0x11
DVAR Name = hud_missionFailed (remove the character at 0x10)
B location in the value string = 0x82 (if it is greater than the string length, then remove no characters)
Value length = 0x1
Value = 0

[/details]

So first, obviously find the DVAR you’d like to add. In this case, I guess I will be using the ‘ai_disableSpawn’ DVAR, which disables enemy spawning.

4. Now, we will begin writing the data. Make sure that you have your writing mode on Insert, NOT Overwrite! To do this on HxD, click the text that says ‘Overwrite’ on the bottom toolstrip, so it says ‘Insert’. Now, type the length of your DVAR name, minus one.

So since the length of ‘ai_disableSpawn’ is 0x0F, I will subtract one from that and write 0x0E. Once again, this tells the game where that stupid ‘B’ is stored. In the next byte, write the actual length of the name, so in this case, 0x0F.

So right now, your file should look something like this. (Red = the bytes I added)

View Image

5. We will now add the name of the DVAR. So since we are adding the DVAR, ‘ai_disableSpawn’, and our first byte is 0x0E, we will add a ‘B’ at 0x0E in the name. So our string should be ‘ai_disableSpawBn’. Now, this is the next thing that we will write.

Your data should now look like this:

Open Me

6. Next, we have to write the value of our DVAR. So now, we will not add a ‘B’ into our value, so we will just make it 0x82, which I think simply tells the game that there is no ‘B’ in the value. So now, we will write the length of the value, which will be 1.

Your data should now look like this:

Open Me

Finally, add the the value as a string. We will be making it ‘1’. A value of 1 means true, and a value of 0 means false. This is what our final DVAR inserted should look like:

Open Me


Editing the Sizes

Change your writing mode back to Overwrite now!

  1. We will need to do this so the save know’s how many bytes we’ve added to the save. This is not very hard, and will not take long to do. As you can see, we have added 0x15 bytes to our file…

  2. First, navigate to offset 0x48A, and get the integer from there. Now advance your position from 0x48E, by the integer you got from 0x48A. Easier: (0x48E + Integer). Now, subtract 4 from that offset.

Current location should look something like this:

Open Me

  1. Now, read that integer, and add 0x15(the amount of bytes we added) to it, and write it back to its original location.

For me, it is: 0x6E8A + 0x15.

This is what it should look like once you’ve written it back:

Open Me

  1. Now, go to offset 0x44C, and do the same for the integer at this offset.
Before

After

  1. We are now finished, besides fixing the files checksum. So first save our modded gamesave, and close your hex editor. Now, download my MW3 Savegame Checksum Fixer, and click Fix Checksum, and select the file. You are now ready to replace your current file in your savegame, rehash and resign, and play!

I know that may have been a bit confusing, so if you have any questions, feel free to ask!

Thank god! I thought you were ignoring me haha
Sorry to anyone I raged at before

Nahh, I saw your PM, ignored it, and started the tutorial :smile:

I want to kiss you!JK! But what a good post! This deservesa sticky!!!

Nice tut dude! I always wanted to know how to add them. I was wondering how to do it, but now I know! Thank you!

If the game says it can’t read from the device… Do you know, just from that, what I did wrong? It at least starts loading my campaign progress.
I am trying to set the timescale to half speed but I do not know if I do 0.5 or .5 or what.
i am going to troubleshoot a bit more though

No I can’t… Is that the error you are getting?

“Can’t read from save device.”

Because I’ve never gotten that. Usually mine is “max_size_string” exceeded or something like that. I’m guessing you maybe didn’t fix the checksum. Did you?

You and Experiment5X are my best frands.

I did. It says error reading from save device. Make sure it’s plugged in. It obviously is plugged in lol
What is the dvar for timescale? I want to make sure I am doing it right.
Or actually, there is one in there already. Should I not be using that one? I see a “com_timescale” and that’s the one I did. I just edited it. Should I be adding a whole new one for time?

No, the one that you edited should work. Want to send me your save?

i have much easier method :smile:

add

timescale 2

its 2x faster than normal speed

I’m pretty sure this is the easiest possible wag to do it, adding bytes… Obviously, you can replace other DVARs with your wanted one, but then that would result in a deleted DVAR. You can’t add bytes to the file without telling the game how many you added…

Already knew this but great post for them newbies, we wont have as much spam now.

thanks again for this tut. +rep

That isn’t what I want. Nobody can figure this out for some reason. I just want slow motion. I do not mean slow motion as in 2x as fast. That doesn’t even make sense

I don’t understand the numbers like this : example: “0x48E”. Can you explain me how this works please. And I have difficulty with the editing size part. Ty

Does anyone happen to have the images from the original post? it’s a bit difficult to understand without all the pretty pictures that used to come with this :anguished: