Solved How To Freez Value C++

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

concacso

Newbie
Silenced
Full Member
Aug 1, 2017
18
194
0
I have written a file dll to inject. And i want to ask how to Freezing Value.

C++:
#include <Windows.h>
/
#define Address 0x07BC4F04
#define Offsets1 0x318
#define Address2 0x00542FE8
#define Offsets2 0x04


void NonDelay()
{
	if (GetAsyncKeyState(VK_F4)){   
		*(DWORD*)(*(DWORD*)Address + Offsets1) = 65553; //In that line, i set 0 to pointer(base + offset)
		Sleep(1);

	}
	if (GetAsyncKeyState(VK_F5)){
		*(DWORD*)(*(DWORD*)Address + Offsets1) = 72083; //In that line, i set 0 to pointer(base + offset)
		Sleep(1);//if you got 5 pointer follow like this
	}


	if (GetAsyncKeyState(VK_F6) ){
		 *(DWORD*)(*(DWORD*)Address2 + Offsets2) = 0;; //In that line, i set 0 to pointer(base + offset)
		Sleep(1);
	}
}
//General Thread void
void Start()
{
	while (true)//loop
	{
		NonDelay();//Do function no delay
		
	};
}
Please help me fix this code to freezing value. Thank you verry much.
 

Teuvin

now I am become Death
Dank Tier VIP
Trump Tier Donator
Dec 8, 2016
403
10,388
65
For achieving the "Freeze" value result you need to be constantly setting the value.
The problem with your code is that you are using the GetAsyncKeyState wrong you would need to be constantly holding the keys for the code to freeze the desired value, the best you can do is use boolean as a form to control the program flow not just the GetAsyncKeyState keys and yes you shouldn't be using preprocessor directives like that they can really fuck your code with macro expansions
C++:
namespace Addresses
{
	DWORD* Address = 0x07BC4F04;
	DWORD* Offsets1 = 0x318;
	DWORD* Address2 = 0x00542FE8;
	DWORD* Offsets2 = 0x04;
}
Is a better practice,not the best but better (your naming is also bad)
and you should also put on some Sleep() or std::this_thread::sleep_for(std::chrono::seconds(N)); to reduce some of the cpu stress in this new code:
Dont want to spoon feed you but heres some logic
C++:
bool foo = false;
void getKey()
{
	if (GetAsyncKeyState(VK_F4))
	{
		foo = !foo;
		return;
	}
}
void Start()
{
	while (true)
	{
		getKey();
		if(foo)
		{
			//do stuff
		}
	};
}
pls dont define addresses like that, it no bueno

i'll also not advise you to use my code unless you're desperate, 'cause its shit

C++:
#include <windows.h>

bool CloseF4Press{ false };
bool CloseF5Press{ false };
bool CloseF6Press{ false };

DWORD __stdcall F4Press(LPVOID lpReserved)
{
	UINT_PTR Address = 0x07BC4F04;
	UINT_P......
That's way nastier than it has to be
 

Roman_Ablo

Banned
Feb 27, 2017
355
2,402
1
pls dont define addresses like that, it no bueno

i'll also not advise you to use my code unless you're desperate, 'cause its shit

C++:
#include <windows.h>

bool CloseF4Press{ false };
bool CloseF5Press{ false };
bool CloseF6Press{ false };

DWORD __stdcall F4Press(LPVOID lpReserved)
{
	UINT_PTR Address = 0x07BC4F04;
	UINT_PTR Offsets = 0x318;

	UINT_PTR Address1 = 0x00542FE8;
	UINT_PTR Offsets1 = 0x04;

	for (;;)
	{
		*(DWORD*)(*(DWORD*)Address + Offsets1) = 65553;
		Sleep(10);
		if (CloseF4Press == true)
			break;
	}

	return true;
}

DWORD __stdcall F5Press(LPVOID lpReserved)
{
	UINT_PTR Address = 0x07BC4F04;
	UINT_PTR Offsets = 0x318;

	UINT_PTR Address1 = 0x00542FE8;
	UINT_PTR Offsets1 = 0x04;

	for (;;)
	{
		*(DWORD*)(*(DWORD*)Address + Offsets1) = 72083;
		Sleep(10);
		if (CloseF5Press == true)
			break;
	}

	return true;
}

DWORD __stdcall F6Press(LPVOID lpReserved)
{
	UINT_PTR Address = 0x07BC4F04;
	UINT_PTR Offsets = 0x318;

	UINT_PTR Address1 = 0x00542FE8;
	UINT_PTR Offsets1 = 0x04;

	for (;;)
	{
		*(DWORD*)(*(DWORD*)Address1 + Offsets1) = 0;
		Sleep(10);
		if (CloseF6Press == true)
			break;
	}

	return true;
}

DWORD __stdcall NonDelay(LPVOID lpReserved)
{
	UINT_PTR Address = 0x07BC4F04;
	UINT_PTR Offsets = 0x318;

	UINT_PTR Address1 = 0x00542FE8;
	UINT_PTR Offsets1 = 0x04;

	for (;;)
	{
		if (!GetAsyncKeyState(VK_F4));
		else
		{
			if (CloseF4Press == false)
			{
				CloseF4Press = true;
			}
			else
			{
				CloseF4Press = false;
				CreateThread(nullptr, 0, &F4Press, nullptr, 0, nullptr);
			}
		}

		if (!GetAsyncKeyState(VK_F5));
		else
		{
			if (CloseF5Press == false)
			{
				CloseF5Press = true;
			}
			else
			{
				CloseF5Press = false;
				CreateThread(nullptr, 0, &F5Press, nullptr, 0, nullptr);
			}
		}

		if (!GetAsyncKeyState(VK_F6));
		else
		{
			if (CloseF6Press == false)
			{
				CloseF6Press = true;
			}
			else
			{
				CloseF6Press = false;
				CreateThread(nullptr, 0, &F6Press, nullptr, 0, nullptr);
			}
		}
	}

	return true;
}

HANDLE Thread;

BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason,LPVOID lpReserved)
{
	if (dwReason == DLL_PROCESS_ATTACH)
	{
		Thread = CreateThread(nullptr, 0, &NonDelay, nullptr, 0, nullptr);
	}
	else if (dwReason == DLL_PROCESS_DETACH)
	{
		SuspendThread(Thread);
		CloseHandle(Thread);
                FreeLibraryAndExitThreads(hModule, 0);
	}

	return true;
}
 
Last edited:

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,101
78,998
2,374
I do like this
C++:
int* ammo = (int*)0xDEADBEEF;
int* health = (int*)0xDEADC0DE;

bool bAmmoHack = false;
bool bHealthHack = false;

void ReadKeys()
{
	if (GetAsyncKeyState(VK_F5) & 1)
	{
		bAmmoHack = !bAmmoHack;
	}
}

void FreezeHacks()
{
	if (bAmmoHack)
	{
		*ammo = 1337;
	}

	if (bHealthHack)
	{
		*health = 1337;
	}
	Sleep(10);
}

int main()
{
	//blah blah blah

	std::thread FreezeHackThread(FreezeHacks);
	FreezeHackThread.detach();

	while (1)
	{
		ReadKeys();
		Sleep(10);
	}
}
 

concacso

Newbie
Silenced
Full Member
Aug 1, 2017
18
194
0
For achieving the "Freeze" value result you need to be constantly setting the value.
The problem with your code is that you are using the GetAsyncKeyState wrong you would need to be constantly holding the keys for the code to freeze the desired value, the best you can do is use boolean as a form to control the program flow not just the GetAsyncKeyState keys and yes you

That's way nastier than it has to be
Thanks you. And How turn off it?
 
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