Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › MultiPlayer Game Hacks & Cheats › Call of Duty Hacks & Cheats › Call of Duty 6 - Modern Warfare 2 (MW2) Hacks › Call of Duty Modern Warfare 2 Coding / Programming / Source Code › Force DVAR Change Hack with Source code

WinkForce DVAR Change Hack with Source code

Posts 1–9 of 9 · Page 1 of 1
SH
shryder
Force DVAR Change Hack with Source code
Hey everybody ,
after i saw that so many people need some help in learning hacking and stuff ...
i wanted to share my little source code which Forces DVAR to change ... this will work fine on other CoD series if you just change the offsets and addresses.
alright , this is the code where i explained EVERYTHING in the comments

Some of you may don't know how to get the code running , its just easy as ABC , follow these steps:
  1. Make a new Win32 Project and select DLL when you see a BOX ...
  2. open dllmain.cpp and past the code inside it

Easy eh?

after all , you can still download the attachements and run the VS Solution on your PC if it just doesn't work for some reason... feel free to PM me through MPGH.NET ...

note that i used VS 2012 to make this.
 
Show Code

Code:
// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"
//MADE WITH <3 by ShRyDeR.

#include <Windows.h>
#include <iostream>
using namespace std;


//Special Thanks for Kenshin13 which helped me to do this ^^ <3 

template <class Value>
//function that writes into the Pointer.
void WritePointer(DWORD pointer, DWORD pointerofs, Value value)
{
	DWORD dwPointer = *(DWORD*)pointer;
	*(Value*)(dwPointer + pointerofs) = value;
}
//function that writes into the memory 
void Writing()
{
	//use it at your own risk , u don't need to credit me if you want to use it ^^ Have fun 

	//Some other addresses, if you want more then contact me ... and i will show you how to get addresses easily :) ;) ... Note : i used IDA to get the addresses so easily , not Cheat engine.
	// cg_gun_x 9FD42C
	// cg_gun_y 9FD404
	// cg_fun_z = 9FD414
	// Draw Gun 7ED384

	//now let's write to the Addresses 

	//note that the offset is always 0x10 ... 

	//Structure ==> WritePointer<FLOATorINT>(ADDRESS,OFFSET,VALUE);

	//if you don't know the difference between float & int then just try both of them , lel... 

			//FOG , address 69F1050
	WritePointer<float>(0x69F1050, 0x10, 0);
			//cg_fov , address 9FBE24
	WritePointer<float>(0x9FBE24, 0x10, 140.f);
			//r_fullbright, address 69F0EB0
	WritePointer<int>(0x69F0EB0, 0x10, 1);
			//laserForceOn , address 7DBA50
	WritePointer<int>(0x7DBA50, 0x10, 1);
	
	//Have Fun ;) 
}
/*Create a thread which loops and writes to the memory over and over ... */
LRESULT CALLBACK Thread( LPVOID arg ){
     while( true )
     {
           Writing();
           Sleep ( 100 );
     }
}
// Entry Point
BOOL APIENTRY DllMain( HANDLE, DWORD d, LPVOID ){
  if( d == DLL_PROCESS_ATTACH )
	
    CreateThread( NULL, NULL, LPTHREAD_START_ROUTINE( Thread ), NULL, NULL, NULL );
  return TRUE;
}

CREDITS:Kenshin13 because he helped me in almost every problem i got, until the end where i got the code working <3 <3 :D

AGAAIN: IF YOU NEED ANY HELP JUST PM ME OR MESSAGE ME ON *******!!!

Thank You :)
DLLMW2Hack_mpgh.net.rar
#1 · edited 6y ago · 10y ago
Democritus
[MPGH]Democritus
//Approved, nice code.
#2 · 10y ago
GE
gerherhtherherdhher
I got a few suggestions for you:

- none of the addresses work. Since I don't think you uploaded it without testing, you might have found some wrong ones that only work for you
- the struct offset for the current dvar value you are using is wrong, try xrefing some dvars and you will immediately see what the right one is
- I would suggest using the dvar struct and Dvar_FindVar, since you are using a dll. If you want to use addresses though, just search for the dvars name in IDA, xref it, find the correct cross reference in one of the dvar registering functions and then you can immediatly see the correct address. (The one where the result of Dvar_RegisterXXX is stored). Note that that would be a double pointer

Greetings
#3 · 10y ago
SH
shryder
Quote Originally Posted by __Xen0 View Post
I got a few suggestions for you:

- none of the addresses work. Since I don't think you uploaded it without testing, you might have found some wrong ones that only work for you
- the struct offset for the current dvar value you are using is wrong, try xrefing some dvars and you will immediately see what the right one is
- I would suggest using the dvar struct and Dvar_FindVar, since you are using a dll. If you want to use addresses though, just search for the dvars name in IDA, xref it, find the correct cross reference in one of the dvar registering functions and then you can immediatly see the correct address. (The one where the result of Dvar_RegisterXXX is stored). Note that that would be a double pointer

Greetings
Hey ,
thanks for your suggestions.

i used IDA to find the addresses and the code is perfectly working for me , the reason why its not working should be probably because you are using a different version of iw4mp.exe , because afaik the addresses change every time they compile the code (I'm not sure about it tho)...
for the Dvar_FindVar function , i don't know how to use it , i would like to know how it works.
Note that this is the first hack i ever made and i'm trying to learn how to make a wallhack now.
Thank you again , @__Xen0. ^^
#4 · edited 10y ago · 10y ago
GE
gerherhtherherdhher
I will write some code for you later today! Fyi, I am using the newest iw4mp.exe which is 1.2.211! Is your code maybe for one of the iw4 projects?
#5 · 10y ago
SH
shryder
Quote Originally Posted by __Xen0 View Post
Aren't you admin there? Although this tool is rather harmless, why would you make hacks for your own client?
Yes i am admin there , and nop i won't use it online ... I'm just learning game hacking and some reverse engineering.....
#6 · 10y ago
GE
gerherhtherherdhher
Code:
Dvar* (__cdecl* Dvar_FindVar)(const char* dvarName) { reinterpret_cast<decltype(Dvar_FindVar)>(0x004D5390) };

Dvar* cg_fov { Dvar_FindVar("cg_fov") };
cg_fov->current.value = 90.0f;
I couldn't test this code because I don't have V2 or Union installed. If you don't know the dvar struct, just look into the Union source code, I am sure it's there.

Also please leave a thanks, my post-thanks ratio suffers under the discussions I have
#7 · edited 10y ago · 10y ago
SH
shryder
Quote Originally Posted by __Xen0 View Post
Code:
Dvar* (__cdecl* Dvar_FindVar)(const char* dvarName) { reinterpret_cast<decltype(Dvar_FindVar)>(0x004D5390) };

Dvar* cg_fov { Dvar_FindVar("cg_fov") };
cg_fov->current.value = 90.0f;
I couldn't test this code because I don't have V2 or Union installed. If you don't know the dvar struct, just look into the Union source code, I am sure it's there.

Also please leave a thanks, my post-thanks ratio suffers under the discussions I have
Thank you so much mate, i appreciate that... and yep i just did a thanks for your post and already +rep you
#8 · 10y ago
significance
significance
Quote Originally Posted by __Xen0 View Post
Code:
Dvar* (__cdecl* Dvar_FindVar)(const char* dvarName) { reinterpret_cast<decltype(Dvar_FindVar)>(0x004D5390) };

Dvar* cg_fov { Dvar_FindVar("cg_fov") };
cg_fov->current.value = 90.0f;
I couldn't test this code because I don't have V2 or Union installed. If you don't know the dvar struct, just look into the Union source code, I am sure it's there.

Also please leave a thanks, my post-thanks ratio suffers under the discussions I have
umm, i'm sorry if i'm resurrecting this thread but is there any chance i can add you on d1scord,steam or something. I have a few questions about dvar changing and all that stuff.
#9 · 8y ago
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Similar Threads

  • Simple Prestige Hack (With Source Code)By bballchamp99 in Call of Duty 8 - Modern Warfare 3 (MW3) Hacks & Cheats
    11Last post 13y ago
  • PLz help noobs with source code of hacking plz READ ADMINSBy gul in All Points Bulletin Reloaded Hacks
    5Last post 14y ago
  • Freebase - GunZ: The Duel Hack Dll + Source Code (69 Hacks Included!)By [V]xT3~23x in Gunz Hacks
    1Last post 17y ago
  • Help with source code! Easy fast scope bot!By Zoom in C++/C Programming
    22Last post 17y ago
  • Stamina Hack and source code ?By Teh Sasuke in C++/C Programming
    0Last post 18y ago

Tags for this Thread

#dll#force dvar change#hacks#mw2#mw2 hacks#mw2 source code