Source Code CoD 4 noSteam Offline External Hack

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

FloppyWhale

Jr.Coder
Full Member
Nobleman
Jan 12, 2015
65
308
0
Hi guys! I was bored and I was watching some of the videos from Daniels Tutorials on YT, which credit does goto him for I wouldn't have made this, and I decided to make an external hack. This doesn't have many features as this is only my 2nd hack I've ever made. It contains Fly Hack, Unlimited Ammo, Teleport out of Map on Crossfire (May work on other maps), and Toggle FOV. I do realize a good 20-50% of the code is probably not needed but eh. Any suggestions/fixes would be greatly appreciated :D!

C++:
#include <iostream>
#include <Windows.h>

using namespace std;
DWORD pID;

DWORD myX = 0x13255C8;
DWORD myY = 0x13255CC;
DWORD myZ = 0x13255C4;

DWORD myFOV = 0xCBAF114;

DWORD primaryAmmo = 0x1325940;
DWORD secondaryAmmo = 0x13259BC;

char user;

float X, Y, Z;

float outOfMapX = -88;
float outOfMapY = -27;
float outOfMapZ = 3433;

bool flyHack = false;

bool toggleFOV;
float proFOV = 90;
float normFOV;
float stockFOV = 65;

bool infiniteAmmo = false;
int storePrimary, storeSecondary;
int maxAmmo = 9999;

int main()
{
	cout << "Please Enter a Name. (NO SPACES & ONLY 1 CAPITAL LETTER)" << endl;
	cin >> user;
	cout << "******************************************************************************" << endl;
	cout << "*Welcome " << user << " to FloppyWhale's External CoD 4 Test Hack!            *" << endl;
	cout << "*These Hacks are for OFFLINE ONLY!                                            *" << endl;
	cout << "******************************************************************************" << endl;
	cout << "Press F1 In-Game to Teleport to the Outside of Crossfire. (MAY WORK ON OTHER MAPS)" << endl;
	cout << endl;
	cout << "Press F2 to Toggle FOV. (BUGGY)" << endl;
	cout << endl;
	cout << "Press F3 to Toggle Infinite Ammo." << endl;
	cout << endl;
	cout << "Hold SPACE In-Game to Fly." << endl;
	cout << endl;

	while(true)
	{
		HWND hWnd = FindWindowA(0, ("Call of Duty 4"));
		GetWindowThreadProcessId(hWnd, &pID);
		HANDLE pHandle = OpenProcess(PROCESS_ALL_ACCESS, false, pID);

		ReadProcessMemory(pHandle, (LPVOID)myY, &Y, sizeof(Y), 0);
		ReadProcessMemory(pHandle, (LPVOID)myX, &X, sizeof(X), 0);
		ReadProcessMemory(pHandle, (LPVOID)myZ, &Z, sizeof(Z), 0);
		ReadProcessMemory(pHandle, (LPVOID)myFOV, &normFOV, sizeof(normFOV), 0);

		if (GetAsyncKeyState(VK_F1))
		{
			WriteProcessMemory(pHandle, (LPVOID)myY, &outOfMapY, sizeof(outOfMapY), 0);
			WriteProcessMemory(pHandle, (LPVOID)myX, &outOfMapX, sizeof(outOfMapX), 0);
			WriteProcessMemory(pHandle, (LPVOID)myZ, &outOfMapZ, sizeof(outOfMapZ), 0);
		}

		if (GetAsyncKeyState(VK_F2))
		{
			if (!toggleFOV)
			{
				WriteProcessMemory(pHandle, (LPVOID)myFOV, &proFOV, sizeof(proFOV), 0);
				toggleFOV = true;
			}
			else
			{
				WriteProcessMemory(pHandle, (LPVOID)myFOV, &stockFOV, sizeof(stockFOV), 0);
				toggleFOV = false;
			}
				
		}

		if (GetAsyncKeyState(VK_F3))
		{
			if (!infiniteAmmo)
			{
				ReadProcessMemory(pHandle, (LPVOID)primaryAmmo, &storePrimary, sizeof(storePrimary), 0);
				ReadProcessMemory(pHandle, (LPVOID)secondaryAmmo, &storeSecondary, sizeof(storeSecondary), 0);

				WriteProcessMemory(pHandle, (LPVOID)primaryAmmo, &maxAmmo, sizeof(maxAmmo), 0);
				WriteProcessMemory(pHandle, (LPVOID)secondaryAmmo, &maxAmmo, sizeof(maxAmmo), 0);

				infiniteAmmo = true;
			}
			else
			{
				WriteProcessMemory(pHandle, (LPVOID)primaryAmmo, &storePrimary, sizeof(storePrimary), 0);
				WriteProcessMemory(pHandle, (LPVOID)secondaryAmmo, &storeSecondary, sizeof(storeSecondary), 0);

				infiniteAmmo = false;
			}
		}

		if (GetAsyncKeyState(VK_SPACE))
		{
			float newY = Y += 0.01;
			WriteProcessMemory(pHandle, (LPVOID)myY, &newY, sizeof(newY), 0);
		}

		Sleep(100);
	}
}
 

mambda

headass
Escobar Tier VIP
Trump Tier Donator
Jun 25, 2014
2,295
37,938
269
Well protip for if you want to improve this
Make your DWORDs for position just one address, starting at the lowest, because position is always next to each other in memory, just having the address of the first one gives you the others

Then instead of 3 rpm calls you can do ReadProcessMemory( Handle, XPosition, sizeof(float)*3 ( because you have 3 floats you want to read ), etc. etc. )
in that same vein also make your float containing position either a class like Vector 3, or just a float[3], all for saving them rpm calls.

Same can be said for your "OutOfMap" floats.

If you'd like to be really fancy you can also map out a quick struct/class for primary & secondary ammo since they're so close together.

Just my $0.02, cool stuff tho bro.
 

FloppyWhale

Jr.Coder
Full Member
Nobleman
Jan 12, 2015
65
308
0
Well protip for if you want to improve this
Make your DWORDs for position just one address, starting at the lowest, because position is always next to each other in memory, just having the address of the first one gives you the others

Then instead of 3 rpm calls you can do ReadProcessMemory( Handle, XPosition, sizeof(float)*3 ( because you have 3 floats you want to read ), etc. etc. )
in that same vein also make your float containing position either a class like Vector 3, or just a float[3], all for saving them rpm calls.

Same can be said for your "OutOfMap" floats.

If you'd like to be really fancy you can also map out a quick struct/class for primary & secondary ammo since they're so close together.

Just my $0.02, cool stuff tho bro.
Thanks. Will definitely use these.
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods