Tutorial How to make a DLL hack for BO2

Hue

Well-Known Member
Messages
20
Points
218
This is a tutorial on how to make a dll hack for BO2 or it could be transfered to any other PC game but you need the offsets.

Step 1:
Image
Create a new project in Visual Studio (You Can Use Any Visual Studio)
"File" > "New" > "Project"

Step 2:
Image
Click Visual C++ Then click Win32 Project and click "OK"

Step 3:
Image
Click "DLL" > "Empty Project" > "Finish"

Step 4:
Image
Right click "Source Files" > "Add" > "New Item"

Step 5:
Image
Then click C++ File and name it "main"

Step 6:
At the top put this
#include <windows.h>
#include <stdio.h>
#include <iostream>
#include <conio.h>
#include <string>
#include <fstream>
#include <float.h>
using namespace std;

Step 7:
Hit enter and add this
DWORD WINAPI LoopFunction( LPVOID lpParam )
{

HANDLE Daddy = GetCurrentProcess();

cout << "<Hues BO2 Dll Hack>" << endl;
cout << endl;
cout << "F1 = Cycle Camos" << endl;
cout << "F2 = Toggle Recoil" << endl;
cout << "F3 = Toggle FPS" << endl;
cout << "F11 = Close Console" << endl;

while(1)
{
if(GetAsyncKeyState(VK_F11))
{
FreeConsole();
}
Sleep(1000);
return 0;
}

For the "if(GetAsyncKeyState(VK_F11))" you can change the "VK_F11" to any key

Step 8:
At the bottom put this
BOOL WINAPI DllMain (HINSTANCE hModule, DWORD dwAttached, LPVOID lpvReserved)
{
if (dwAttached == DLL_PROCESS_ATTACH)
{
CreateThread(NULL,0,&LoopFunction,NULL,0,NULL);
AllocConsole();
AttachConsole(ATTACH_PARENT_PROCESS);
system("Color A");
}
return 1;
}

Step 9:
Heres how to add a mod


bool Recxil = false;

BYTE RecoilOn[] = {0x75};
BYTE RecoilOff[] = {0x74};



if(GetAsyncKeyState(VK_F2))
{
if(Recxil == false)
{
Recxil = true;
WriteProcessMemory(Daddy,(void*)(0x5C6219), &RecoilOff, 1, 0);
}
else
{
WriteProcessMemory(Daddy,(void*)(0x5c6219), &RecoilOn, 1, 0);
Recxil = false;
}
}

Again you can change the "VK_F2" to your liking

Step 10:
Image
For this step all you do is click "Build" then "Rebuild Solution"

Step 11:
Image
The DLL should appear in the "Debug" folder, Now you just inject the dll while BO2 is running

How to inject the dll:
Lastly you click "Memory View" > "Tools" > "Inject DLL" and select the DLL


Hope you enjoyed this tutorial!
Download Cheat Engine:
You have to be logged in to view links Log in or register now.
 

WoodenFloorBoard

New Member
Messages
16
Points
3
This is a tutorial on how to make a dll hack for BO2 or it could be transfered to any other PC game but you need the offsets.

Step 1:
Image
Create a new project in Visual Studio (You Can Use Any Visual Studio)
"File" > "New" > "Project"

Step 2:
Image
Click Visual C++ Then click Win32 Project and click "OK"

Step 3:
Image
Click "DLL" > "Empty Project" > "Finish"

Step 4:
Image
Right click "Source Files" > "Add" > "New Item"

Step 5:
Image
Then click C++ File and name it "main"

Step 6:
At the top put this
#include <windows.h>
#include <stdio.h>
#include <iostream>
#include <conio.h>
#include <string>
#include <fstream>
#include <float.h>
using namespace std;

Step 7:
Hit enter and add this
DWORD WINAPI LoopFunction( LPVOID lpParam )
{

HANDLE Daddy = GetCurrentProcess();

cout << "<Hues BO2 Dll Hack>" << endl;
cout << endl;
cout << "F1 = Cycle Camos" << endl;
cout << "F2 = Toggle Recoil" << endl;
cout << "F3 = Toggle FPS" << endl;
cout << "F11 = Close Console" << endl;

while(1)
{
if(GetAsyncKeyState(VK_F11))
{
FreeConsole();
}
Sleep(1000);
return 0;
}

For the "if(GetAsyncKeyState(VK_F11))" you can change the "VK_F11" to any key

Step 8:
At the bottom put this
BOOL WINAPI DllMain (HINSTANCE hModule, DWORD dwAttached, LPVOID lpvReserved)
{
if (dwAttached == DLL_PROCESS_ATTACH)
{
CreateThread(NULL,0,&LoopFunction,NULL,0,NULL);
AllocConsole();
AttachConsole(ATTACH_PARENT_PROCESS);
system("Color A");
}
return 1;
}

Step 9:
Heres how to add a mod


bool Recxil = false;

BYTE RecoilOn[] = {0x75};
BYTE RecoilOff[] = {0x74};



if(GetAsyncKeyState(VK_F2))
{
if(Recxil == false)
{
Recxil = true;
WriteProcessMemory(Daddy,(void*)(0x5C6219), &RecoilOff, 1, 0);
}
else
{
WriteProcessMemory(Daddy,(void*)(0x5c6219), &RecoilOn, 1, 0);
Recxil = false;
}
}

Again you can change the "VK_F2" to your liking

Step 10:
Image
For this step all you do is click "Build" then "Rebuild Solution"

Step 11:
Image
The DLL should appear in the "Debug" folder, Now you just inject the dll while BO2 is running

How to inject the dll:
Lastly you click "Memory View" > "Tools" > "Inject DLL" and select the DLL


Hope you enjoyed this tutorial!
Download Cheat Engine:
You have to be logged in to view links Log in or register now.
I thought you weren't going to try and make DLL hacks? :tonguewink: Anyways, good job!
 

Throwie

Insane-Known Member
Messages
312
Points
378
Really good for beginners to scripting. Its way more easier to follow than making a menu from scratch!
 

isaiah johnson

New Member
Messages
1
Points
1
hey i dont know if you'll respond and im new to coding, i understand some of it. but when i build it, i get errors :disappointed:
i got 6 errors and some have to do with "dwattached" not being defined maybe you vould post a pic of how its supposed to look?
 

Top