Complete Dvar List (All Modes)

Posts 115 of 22 · Page 1 of 2
Complete Dvar List (All Modes)
Well.. here the list of all dvars for MP, SP and Zombies. Hope some of you find this useful

Thanks to g0dly that helped me to see what I was doing wrong

PS: I was going to post them here.. but the list is too long...

MultiPlayer | SinglePlayer | Zombies
Did you have to find each one individually? just curious.
Quote Originally Posted by Geomatrical the 7th View Post
Did you have to find each one individually? just curious.
No, if you see. He thanked a person.
That person posted a "source" on how to get the values.


This has been done before
I didn't used g0dly "source"... not all of them at least... About a week ago I was trying to do this, but my dvar_t struct was completely wrong SO when g0dly posted his source, I saw what I did wrong and fixed it

Here's the code if anyone is interested:

Code:
#include <windows.h>
#include <fstream>
#include <stdio.h>
#include <Psapi.h>
#pragma comment(lib, "psapi.lib")

#define Dvar_List_MP 0x29383B0
#define EndOfList_MP 0x29A83B4

#define Dvar_List_ZM 0x29393B0
#define EndOfList_ZM 0x29A93B4

#define Dvar_List_SP 0x2A45F90
#define EndOfList_SP 0x2AB5F94

struct dvar_union_s
{
	union
	{
		int iValue;
		float flValue;
		char *szValue;
	};
};

typedef struct 
{
	char *szName; //0x0000 
	char _0x0004[12];
	int iType; //0x0010 
	char _0x0014[4];
	dvar_union_s uValue; //0x0018 
	char _0x001C[84];
}dvar_t; //Size=0x70

using namespace std;
ofstream ofile;
char dlldir[320];

void __cdecl add_log ( const char *fmt, ...)
{
    if(ofile != NULL)
    {
        if(!fmt) { return; }

        va_list va_alist;
        char logbuf[256] = {0};

        va_start (va_alist, fmt);
        _vsnprintf (logbuf+strlen(logbuf), sizeof(logbuf) - strlen(logbuf), fmt, va_alist);

        va_end (va_alist); 

        ofile << logbuf;
    }
}

MODULEINFO GetModuleInfo( LPCSTR szModule )
{
	MODULEINFO modinfo = {0};
	HMODULE hModule = GetModuleHandleA(szModule);
	if(hModule == 0) return modinfo;
	GetModuleInformation(GetCurrentProcess(), hModule, &modinfo, sizeof(MODULEINFO));
	return modinfo;

}

char *GetDirectoryFile(char *filename) 
{
    static char path[320];
    strcpy(path, dlldir);
    strcat(path, filename);
    return path;
}

void LogDvars()
{
	DWORD* Max, Base;

	char Process[16];
	GetModuleBaseNameA(GetCurrentProcess(), NULL, Process, 16);

	if(strcmp(Process, "t6mp.exe") == 0){
		Max = (DWORD*)EndOfList_MP;
		Base = Dvar_List_MP;

		ofile.open(GetDirectoryFile("DvarDump_MP.txt"), ios::app);
	}else if(strcmp(Process, "t6sp.exe") == 0){
		Max = (DWORD*)EndOfList_SP;
		Base = Dvar_List_SP;

		ofile.open(GetDirectoryFile("DvarDump_SP.txt"), ios::app);
	}else if(strcmp(Process, "t6zm.exe") == 0){
		Max = (DWORD*)EndOfList_ZM;
		Base = Dvar_List_ZM;

		ofile.open(GetDirectoryFile("DvarDump_ZM.txt"), ios::app);
	}else{
		MessageBoxA(NULL, "Process Name not recognized. Can't create dump file!", "Wrong Process", MB_ICONERROR);
		exit(EXIT_FAILURE);
	}

	char Name[64];
	for(int i = 0; i < *Max; i++)
	{
		dvar_t *Dvar = (dvar_t*)(Base + (DWORD)i * 0x70);
		if(Dvar != NULL){		
			sprintf(Name, "%s.", Dvar->szName);
			while(strlen(Name) < 50)
				sprintf(Name, "%s.", Name);
			add_log("%s0x%.8X\n",Name, &Dvar->uValue);
		}
	}
}

BOOL APIENTRY DllMain( HMODULE hModule, DWORD  ul_reason_for_call,LPVOID lpReserved)
{
	switch (ul_reason_for_call)
	{
	case DLL_PROCESS_ATTACH:
		GetModuleFileNameA(hModule, dlldir, 512);
		for(int i = strlen(dlldir); i > 0; i--){ 
			if(dlldir[i] == '\\'){
				dlldir[i+1] = 0;
				break;
			}
		}

		LogDvars();

		break;
	}
	return TRUE;
}
The dvar_t struct is what I "took" from g0dly source

To find new offsets, search for "Can't create Dvar" and analyze the function
thanks bro, interesting
hi ,

it's very good job thx man
hey im new to ops 2 zombies and i was wondering what a "dvar" is, what it does, and how to use it... if you can just give me the gist of it ill probably get the idea...
Quote Originally Posted by dudeletz View Post
hey im new to ops 2 zombies and i was wondering what a "dvar" is, what it does, and how to use it... if you can just give me the gist of it ill probably get the idea...
A Dvar is a variable that can be changed, that can be changed by the server.
For instance World At War (I think) has a "Godmode DVAR"
Some other dvars (For MW2 at least) let you change the game speed, gravity, ai targeting, etc.
They're useful for some hacks (for instance a "HUD Enabler for Hardcore would only work correctly with a Dvar.)
how do i make it effect my gameplay in multiplayer hypothetically? would i use cheat engine or would i have to manually go and change up specific files?
Quote Originally Posted by dudeletz View Post
how do i make it effect my gameplay in multiplayer hypothetically? would i use cheat engine or would i have to manually go and change up specific files?
You can use Cheat Engine. But most Dvars have some kinda of checking... for instance, if you try to set "perk_weapSpreadMultiplier" to 0 to get NoSpread, it won't work. The game checks the Dvar value to make sure that doesn't happen. You would've to find these checks and invert them. Some other dvars, like r_fullbright, r_nofog, don't have any checks tho, so you cna play with them :P
You know how one would find said perk check? I've been looking around but I can't seem to find it.
Quote Originally Posted by Final Byte View Post
You know how one would find said perk check? I've been looking around but I can't seem to find it.
Ask @barata55 But even if you do find, it'll only work when you're host
I've talked to barata a little, I'm currently learning basic RE though, so it's kinda hard to figure that stuff out all by myself. Any hints like when the check's performed?

Iirc I've seen hacks that do no spread by calculating what the spread is going to be based on the host time and compensating for that, I'm assuming that's what barata used for his tekno hook no spread, although that's probably more work than it's worth with mp having the report function, and being able to host in zombies and SP.
Address still work bro?
Quote Originally Posted by iHc Wasted View Post
Address still work bro?
Yep All those recent updates were just Server Stuff.. the addresses are still the same.
Posts 115 of 22 · Page 1 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?