Solved C++ Adding GUI to a Dll?

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Froze

Newbie
Full Member
Dec 21, 2012
11
244
0
I think the title is really confusing but anyway, I'm trying to create my own hack for a certain game and I found this tutorial from a certain forum about creating a Dll Hack(OOP) and I tried that and I was successful. And today what I wanna do is to implement a User Interface for it so that I wont use hotkeys anymore. I copied the source of my hack and posted it here. If you don't mind looking at it and give some hints about improving it that would be great, and about how I can integrate a GUI to it ;)


Main.cpp
C++:
#include <windows.h>
extern void Start();

BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpvReserved)
{
	switch (dwReason) {
	case DLL_PROCESS_ATTACH:

		DisableThreadLibraryCalls(hModule);

		CreateThread(0, 0, (LPTHREAD_START_ROUTINE)Start, 0, 0, 0);
		MessageBoxA(NULL, "Cheat Activated", "My Trainer", MB_OK);
		break;
	case DLL_PROCESS_DETACH:
		break;
	case DLL_THREAD_ATTACH:
		break;
	case DLL_THREAD_DETACH:
		break;
	}
	return TRUE;
}
AllDefines.h
C++:
//Address needs to be updated
//BASE ADDRESS
#define ADDR_BASE    0x010F4050

//MOVEMENT SPEED=600 FLOAT
#define MOVEMENT_OFFSET 0x204

//NATION (0x0370)
#define NATION_OFFSET 0x35c

//BM3 POINTERS=0
#define BM3_PTR1 0x4a1c
#define BM3_PTR2 0x128
#define BM3_PTR3 0x20

//PERFECT COMBO=0
#define CBO_MAIN1 0x7384
#define CBO_PTR1 0x73a0

//NO SKILL DELAY
#define NSD_PTR1 0x72d4

//WALLHACK
#define WH_BASE 0x10838D8

//BM2 POINTERS=0
#define BM2_PTR1 0x4a1c
#define BM2_PTR2 0x124
#define BM2_PTR3 0x20

//BM1 POINTERS =0
#define BM1_PTR1 0x4a1c
#define BM1_PTR2 0x120
#define BM1_PTR3 0x20

//AURA POINTERS=0
#define AURA_PTR1 0x4a1c
#define AURA_PTR2 0x118
#define AURA_PTR3 0x20

//KILL GATE=1 DP HACK=57
#define KG_PTR1 0x72e4

//CURRENT MAP
#define CURRENT_MAP 0x00BA0760

//X & Y COORDINATES
#define X_OFFSET 0x250
#define Y_OFFSET 0x254

//NO CAST TIME=1082514380
#define NCT_OFFSET 0x3578

//LONG RANGE LOOT 1=2425294602 2=1452216074
#define LOOT_1 0x0055BBDB
#define LOOT_2 0x0055BC15

//GM=2/AOE=100/RANGE=8
#define GM 0x0107D58
#define AOE 0x0B61004
#define RANGE 0x10cdc40

//NO STUN =7
#define NS_OFFSET 0x1f4

//SHOW HP 0=OFF 1=ON
#define HP 0x010CDF50

//DARK=1 LIGHT=0
#define DL 0x01083838

//HIDE CHALLENGE WINDOW
#define BASE 0x010ADA38
#define HCW_0 0x0
#define HCW_1 0x10
#define HCW_2 0x70

//MOVE IN DUNGEON
#define MIV_1 0x729c
Cheat.h
C++:
#include "AllDefines.h"
//========== CHANGE NATION ==========
void CHANGE_NATION()
{
	if (*(DWORD*)(*(DWORD*)ADDR_BASE + NATION_OFFSET) == 3)
		*(DWORD*)(*(DWORD*)ADDR_BASE + NATION_OFFSET) = 0;
	else
		*(DWORD*)(*(DWORD*)ADDR_BASE + NATION_OFFSET) += 1;

	Sleep(300);
}
//===============================

//========= MOVEMENT SPEED ==========
void MOVE_SPEED(float Speed)
{
	*(float*)(*(DWORD*)ADDR_BASE + MOVEMENT_OFFSET) = Speed;

	Sleep(1);

//===============================

//====================== BM ======
void NOCD_BM()
{
	DWORD *BM3_1 = (DWORD*)(*(DWORD*)ADDR_BASE + BM3_PTR1);
	DWORD *BM3_2 = (DWORD*)(*(DWORD*)BM3_1 + BM3_PTR2);
	*(DWORD*)(*(DWORD*)BM3_2 + BM3_PTR3) = 0x0;

	DWORD *BM2_1 = (DWORD*)(*(DWORD*)ADDR_BASE + BM2_PTR1);
	DWORD *BM2_2 = (DWORD*)(*(DWORD*)BM2_1 + BM2_PTR2);
	*(DWORD*)(*(DWORD*)BM2_2 + BM2_PTR3) = 0x0;

	DWORD *BM1_1 = (DWORD*)(*(DWORD*)ADDR_BASE + BM1_PTR1);
	DWORD *BM1_2 = (DWORD*)(*(DWORD*)BM1_1 + BM1_PTR2);
	*(DWORD*)(*(DWORD*)BM1_2 + BM1_PTR3) = 0x0;

	DWORD *AURA_1 = (DWORD*)(*(DWORD*)ADDR_BASE + AURA_PTR1);
	DWORD *AURA_2 = (DWORD*)(*(DWORD*)AURA_1 + AURA_PTR2);
	*(DWORD*)(*(DWORD*)AURA_2 + AURA_PTR3) = 0x0;

	Sleep(1);
}
//============================================

//====================== PERFECT COMBO =========
void NOCD_COMBO()
{
	//SIMILAR POINTER
	*(DWORD*)(*(DWORD*)ADDR_BASE + CBO_MAIN1) = 0x0;
	//COMBO
	*(DWORD*)(*(DWORD*)ADDR_BASE + CBO_PTR1) = 0x0;

	Sleep(1);
}
//====================================================================

//====================== NO SKILL DELAY ==============================
void NSD()
{
	*(DWORD*)(*(DWORD*)ADDR_BASE + NSD_PTR1) = 1629381; //3257000 to use ODD
	
	Sleep(300);
}
//====================================================================

//====================== WALLHACK ====================================
void WH()
{	
	DWORD *WH_Start = (DWORD*)(*(DWORD*)WH_BASE + 0x40814);
	memset(WH_Start, 0x0, 0x40000);
	Sleep(1);
}
//====================================================================

//======================== WALLHACK OFF ==============================
void WH1()
{
	DWORD *WH_Start = (DWORD*)(*(DWORD*)WH_BASE + 0x40814);
	memset(WH_Start, 0x7, 0x40000);
	Sleep(1);
}
//=======================================================================

//======================== GET CURRENT MAP ================================
int GetCurrentMap()
{
	return *(DWORD*)CURRENT_MAP;
	Sleep(1);
}
//=====================================================================

//======================== KILLGATE ===================================
void KILLGATEON()
{
	*(DWORD*)(*(DWORD*)ADDR_BASE + KG_PTR1) = 1;
	Sleep(100);
}
//======================================================================

//======================== KILLGATE OFF ===============================
void KILLGATEOFF()
{
	*(DWORD*)(*(DWORD*)ADDR_BASE + KG_PTR1) = GetCurrentMap();
	Sleep(100);
}
//======================================================================

//========================= WARP HACK ==================================
void SET_POSITION(float X,float Y)
{
	*(float*)(*(DWORD*)ADDR_BASE + X_OFFSET) = X;
	*(float*)(*(DWORD*)ADDR_BASE + Y_OFFSET) = Y;
	Sleep(100);
}
//========================================================================

//============================== NO CAST TIME ============================
void NCT()
{
	*(DWORD*)(*(DWORD*)ADDR_BASE + NCT_OFFSET) = 1082514380;
	Sleep(300);
}
//========================================================================

//============================== LOOT =================================== NOT WORKING YET
void LOOT(byte loot1,byte loot2)
{
	*(DWORD*)LOOT_1 = 10;
	*(DWORD*)LOOT_2 = 10;
	Sleep(1);
}
//======================================================================= 

//============================== ZOOM =================================== NOT WORKING YET
void Zoom()
{
	*(int*)(*(DWORD*)ZOOM) = 2341507216;
	Sleep(100);
}
//======================================================================= 

//============================== SHOW HP  ===============================
void HPSHOW(int value)
{
	*(DWORD*)HP = value;
	Sleep(100);
}
//=======================================================================

//============================== DARK & LIGHT ===========================
void DLSHOW(int value)
{
	*(DWORD*)DL = value;
	Sleep(100);
}

//============================== NO ENTRY HACK ==========================
void NOENTRY(byte value, byte value1)
{
	//HIDE WINDOW
	DWORD *HCW1 = (DWORD*)(*(DWORD*)BASE + HCW_0);
	DWORD *HCW2 = (DWORD*)(*(DWORD*)HCW1 + HCW_1);
	*(DWORD*)(*(DWORD*)HCW2 + HCW_2) = value;
	//MOVE
	*(DWORD*)(*(DWORD*)ADDR_BASE + MIV_1) = value1;
	
	Sleep(100);
}
//========================================================================
Cheat.cpp
C++:
#include <windows.h>
#include "MyCheat.h"

void Start()
{
	bool OnSpeed = 0, OnBM = 0, OnCombo = 0, OnNSD = 0, OnNCT = 0, OnDisplay = 0, OnNOENTRY = 0, OnVisual = 0;
	char * CAPTION = "My Trainer";

	while (true)
	{
		//================================ CHANGE NATION ===================================================
		if (GetKeyState(VK_F11) < 0) { CHANGE_NATION(); }
		//==================================================================================================

		//================================ MOVEMENT SPEED ==================================================
		if (GetKeyState(VK_F12) < 0)
		{
			if (!OnSpeed){
				OnSpeed = true;
				MessageBoxA(NULL, "MOVEMENT SPEED ON", CAPTION, MB_OK);
			}
			else{
				OnSpeed = false;
				MOVE_SPEED(450.0);
				MessageBoxA(NULL, "MOVEMENT SPEED OFF", CAPTION, MB_OK);
			}
		}
		//==================================================================================================

		//THIS BM2, COMBO AND NSD IS ONLY WORK IN WIN 7 32BIT AND 64BIT

		//================================ NO COOLDOWN BM =================================================
		if (GetKeyState(VK_F10) < 0)
		{
			if (!OnBM)
			{ 
				OnBM = true; 
				MessageBoxA(NULL, "NO CD BM ON", CAPTION, MB_OK);
			}
			else
			{
				OnBM = false;
				MessageBoxA(NULL, "NO CD BM OFF", CAPTION, MB_OK);
			}
		}
		//==================================================================================================

		//================================ PERFECT COMBO ===================================================
		if (GetKeyState(VK_F9) < 0)
		{
			if (!OnCombo){
				OnCombo = true;
				MessageBoxA(NULL, "PERFECT COMBO ON", CAPTION, MB_OK);
			}
			else{
				OnCombo = false;
				MessageBoxA(NULL, "PERFECT COMBO OFF", CAPTION, MB_OK);
			}
		}
		//==================================================================================================
		
		if (GetKeyState(VK_SHIFT) < 0) //SHIFT
		//================================ NO CAST TIME ====================================================
		{
			if (GetKeyState(VK_F8) < 0) //F8
			{
				if (!OnNCT){
					OnNCT = true;
					MessageBoxA(NULL, "NO CAST TIME ON", CAPTION, MB_OK);
				}
				else{
					OnNCT = false;
					MessageBoxA(NULL, "NO CAST TIME OFF", CAPTION, MB_OK);
				}
			}
			//=================================================================================================

			//======================================= MAP ID ==================================================
			if (GetKeyState(VK_F6) < 0) //F6
			{
				KILLGATEOFF();
				MessageBoxA(NULL, "KILLGATE OFF", CAPTION, MB_OK);
			}
			//==================================================================================================
			
			//========================================= NO ENTRY ===================================================
			if (GetKeyState(VK_F5) < 0)
			{
				if (!OnNOENTRY){
					OnNOENTRY = true;
				}
				else{
					OnNOENTRY = false;
					NOENTRY(1, 1);
				}
			}
			//===============================================================================================

			//===================================== WALLHACK OFF =============================================
			if (GetKeyState(VK_F7) < 0) //F7
			{
				WH1();
				MessageBoxA(NULL, "WALLHACK OFF", CAPTION, MB_OK);
			}
			//==============================================================================================
		}

		//================================ NO SKILL DELAY ==================================================
		if (GetKeyState(VK_F8) < 0)
		{
			if (!OnNSD){
				OnNSD = true;
				MessageBoxA(NULL, "NO SKILL DELAY ON", CAPTION, MB_OK);
			}
			else{
				OnNSD = false;
				MessageBoxA(NULL, "NO SKILL DELAY OFF", CAPTION, MB_OK);
			}
		}
		//==================================================================================================

		//================================ WALLHACK ========================================================
		if (GetKeyState(VK_F7) < 0)
		{
			WH();
			MessageBoxA(NULL, "WALLHACK ON", CAPTION, MB_OK);
		}
		//==================================================================================================

		//================================== KILLGATE ======================================================
		if (GetKeyState(VK_F6) < 0)
		{
			KILLGATEON();
			MessageBoxA(NULL, "KILLGATE ON", CAPTION, MB_OK);
		}
		//==================================================================================================
	
		//===================================== HP & DISPLAY ===============================================
		if (GetKeyState(VK_F5) < 0) // F5
		{
			if (!OnVisual){
				OnVisual = true;
			}
			else {
				OnVisual = false;
				HPSHOW(0);
				DLSHOW(0);
			}
		}
		//========================================= WARP ===================================================
		switch (GetCurrentMap())
		{
		case 1://BLOODY ICE 
			//UNDEAD GROUND 
			if (GetKeyState(VK_HOME) < 0){ SET_POSITION(23797.41406, 11385.16211); }
			//COTACOMB FROST 
			if (GetKeyState(VK_INSERT) < 0){ SET_POSITION(21736.58594, 18274.71094); }
			break;
		case 2://DESERT SCREAM 
			//FORGOTTEN RUIN 
			if (GetKeyState(VK_HOME) < 0){ SET_POSITION(24657.47266, 2469.552734); }
			//PANIC CAVE 
			if (GetKeyState(VK_INSERT) < 0){ SET_POSITION(12678.3457, 10794.87988); }
			break;
		case 3://GREEN DESPAIR 
			//MUTANT FOREST 
			if (GetKeyState(VK_HOME) < 0){ SET_POSITION(5048.291016, 2486.612061); }
			//HAZARDOUS VALLEY 
			if (GetKeyState(VK_INSERT) < 0){ SET_POSITION(2467.1679692, 24710.46094); }
			break;
		case 4://PORT LUX 
			//FORBIDDEN ISLAND 
			if (GetKeyState(VK_HOME) < 0){ SET_POSITION(23650, 950); }
			//THE VOLCANIC CITADEL 
			if (GetKeyState(VK_DELETE) < 0){ SET_POSITION(20311.46875, 3191.250488); }
			//LAVA HELLFIRE 
			if (GetKeyState(VK_INSERT) < 0){ SET_POSITION(22938.10547, 6141.678223); }
			break;
		case 5://FORT. RUINA 
			//PONTUS FERRUM 
			if (GetKeyState(VK_HOME) < 0){ SET_POSITION(24205.88281, 7455.765137); }
			//STEAMER CRAZY 
			if (GetKeyState(VK_INSERT) < 0){ SET_POSITION(4254.29541, 17575.40625); }
			break;
		case 6://LAKESIDE 
			//ILLUSION CASTLE/RADIANT HALL 
			if (GetKeyState(VK_HOME) < 0){ SET_POSITION(17387.89062, 17631.6582); }
			break;
		case 7://UNDEAD GROUND 
			//FROZEN TOWER OF DEAD B1F/B2F 
			if (GetKeyState(VK_HOME) < 0){ SET_POSITION(11279.3418, 13259.63477); }
			break;
		case 8://FORGOTTEN RUIN 
			//FT1/FT2 
			if (GetKeyState(VK_HOME) < 0){ SET_POSITION(19323.57422, 3670.299316); }
			break;
		case 9://MUTANT FOREST 
			//ALTAR SIENNA 1/ALTAR SIENNA 2 
			if (GetKeyState(VK_HOME) < 0){ SET_POSITION(12121.22461, 9827.890625); }
			break;
		case 10://PONTUS FERRUM 
			//MAQUINAS OUTPOST 
			if (GetKeyState(VK_HOME) < 0){ SET_POSITION(9518.501953, 12790.83984); }
			break;
		}

		//================================ FREEZING VALUE ==================================================
		if (OnSpeed) MOVE_SPEED(600.0);
		if (OnBM) NOCD_BM();
		if (OnCombo) NOCD_COMBO();
		if (OnNSD) NSD();
		if (OnNCT) NCT();
		if (OnNOENTRY) NOENTRY(0,0);
		if (OnVisual) HPSHOW(1), DLSHOW(1);
		//==================================================================================================

		Sleep(1);
	}
}
 

rN'

Jr.Hacker
Meme Tier VIP
Jan 19, 2014
340
5,268
41
Create a drawing class or use a public one and hook EndScene
 

Froze

Newbie
Full Member
Dec 21, 2012
11
244
0
I completely have no idea about what you said xD. but anyways ill try googling it.
 

dmo

Coder
Full Member
Nobleman
Nov 8, 2014
145
678
5
Hi,

Could you please tell how do you find your wallhack address? :eek:

Ty!
 
Last edited:

Solaire

Respected Hacker
Dank Tier VIP
Dec 15, 2013
1,051
16,353
62
Hi,

Could you please tell how do you find your wallhack address? :eek:

Ty!
You don't find a wallhack "address". You have to get a model logger, then find the strides for the characters. Fleep goes over how to use one in his wallhack and chams video tutorial.
 
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