As far as I tested, this works for any cod...
Load up the CoD you want on IDA Pro and go to Search Text and search for "Can't create Dvar"
You'll end up on something like this:
This function has everything you need.
Press F5 to go to PseudoCode view.
You'll see a if testing if the dvar list is full:
if ( dword_59B3CA0 >= 4096 )
in this case, dword_59B3CA0 holds the max of dvars allowed (usually 4096).
Right after the is the pointer to the dvar struct:
v10 = (int)((char *)&unk_59B8CC8 + 76 * v9);
unk_59B8CC8 is the start of the dvar list. 76(0x4C) is the size of the dvar struct. v9 is the Dvar index on the list.
After this there's a switch testing for the dvar type and setting the value.
*(_BYTE *)(v10 + 8) = a2;
switch ( a2 )
v11 = sub_42BE30(LODWORD(a4));
*(_DWORD *)(v10 + 12) = v11;
*(_DWORD *)(v10 + 28) = v11;
*(_DWORD *)(v10 + 44) = v11;
bla bla bla...
Hopefully, now you can already see the dvar struct (more or less)...
This is the base struct (it has more stuff in it) for MW3:
char* Name; //0x0000
char unk1; //0x0004
BYTE bType; //0x0008
char unk2; //0x0009
__int32 iValue; //0x000C
char unk3; //0x0010
To log all dvars you can now simply do:
for(int i = 0; i < *(DWORD*)0x59B3CA0; i++)
dvar_t_mw3 *Dvar = (dvar_t_mw3*)(0x59B8CC8 + i * 0x4C);
if(Dvar != NULL)
Log("%s 0x%.8X\n", Dvar->Name, &Dvar->iValue);