Solved Menu won't show IG

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

tvojama

uz42&4fd
Meme Tier VIP
Dank Tier Donator
Apr 1, 2015
377
2,498
10
I followed Fleeps steps in a menu tut, but the menu wont show Ig.
Did I do something wrong in the code?

Hacks.h
C++:
#pragma once

#include <Windows.h>
#include "d3d9.h"
#include <ctime> 
#include <iostream>

#define D3DHOOK_TEXTURES 
#define MAX_MENU_ITEMS 6


#define WALLHACK 0
#define CUSTOM_CROSSHAIR 1
#define NO_RECOIL 2
#define UNLIM_AMMO 3
#define AUTO_FIRE 4
#define HIDE_MENU 5

class Hacks
{
public:
	int m_Stride;

	void Hacks::CreateFont(IDirect3DDevice9 *d3dDevice, std::string choiceFont);
	void Hacks::InitializeMenuItems();
	void Hacks::Draw_Text(LPCSTR TextToDraw, int x, int y, D3DCOLOR Colour);
	void Hacks::DrawMenu(IDirect3DDevice9 *d3dDevice);
	void Hacks::DrawFilledRect(int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* d3dDevice);
	void Hacks::DrawBorderBox(int x, int y, int w, int h, int thickness, D3DCOLOR Colour, IDirect3DDevice9 *d3dDevice);
	void Hacks::KeyboardInput();

LPDIRECT3DTEXTURE9 texRed;
LPDIRECT3DTEXTURE9 texGreen;

LPDIRECT3DTEXTURE9 texBlue;
LPDIRECT3DTEXTURE9 texWhite;

LPD3DXFONT m_font;

struct d3dMenuHack
{
	bool on;
	std::string name;
};

d3dMenuHack hack[MAX_MENU_ITEMS];
};#pragma once

#include <Windows.h>
#include "d3d9.h"
#include <ctime> 
#include <iostream>

#define D3DHOOK_TEXTURES 
#define MAX_MENU_ITEMS 6


#define WALLHACK 0
#define CUSTOM_CROSSHAIR 1
#define NO_RECOIL 2
#define UNLIM_AMMO 3
#define AUTO_FIRE 4
#define HIDE_MENU 5

class Hacks
{
public:
	int m_Stride;

	void Hacks::CreateFont(IDirect3DDevice9 *d3dDevice, std::string choiceFont);
	void Hacks::InitializeMenuItems();
	void Hacks::Draw_Text(LPCSTR TextToDraw, int x, int y, D3DCOLOR Colour);
	void Hacks::DrawMenu(IDirect3DDevice9 *d3dDevice);
	void Hacks::DrawFilledRect(int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* d3dDevice);
	void Hacks::DrawBorderBox(int x, int y, int w, int h, int thickness, D3DCOLOR Colour, IDirect3DDevice9 *d3dDevice);
	void Hacks::KeyboardInput();

LPDIRECT3DTEXTURE9 texRed;
LPDIRECT3DTEXTURE9 texGreen;

LPDIRECT3DTEXTURE9 texBlue;
LPDIRECT3DTEXTURE9 texWhite;

LPD3DXFONT m_font;

struct d3dMenuHack
{
	bool on;
	std::string name;
};

d3dMenuHack hack[MAX_MENU_ITEMS];
};
Hacks.cpp
C++:
#include "hacks.h"



int MenuIndex = 0;


D3DCOLOR fontRed = D3DCOLOR_ARGB(255, 255, 0, 0);
D3DCOLOR fontGreen = D3DCOLOR_ARGB(255, 0, 255, 0);
D3DCOLOR fontBlue = D3DCOLOR_ARGB(255, 0, 42, 255);
D3DCOLOR fontWhite = D3DCOLOR_ARGB(255, 255, 255, 255);
D3DCOLOR fontBlack = D3DCOLOR_ARGB(255, 0, 0, 0);



void Hacks::CreateFont(IDirect3DDevice9 *d3dDevice, std::string choiceFont)
{
	D3DXCreateFont(d3dDevice, 62 * 20, 0, FW_BOLD, 0, FALSE, DEFAULT_CHARSET,
		OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE,
		choiceFont.c_str(), &m_font);
}


void Hacks::InitializeMenuItems()
{
	hack[WALLHACK].name = " WallHack and chams";
	hack[CUSTOM_CROSSHAIR].name = " Show custom crosshair";
	hack[NO_RECOIL].name = " No Recoil";
	hack[UNLIM_AMMO].name = " Unlimited ammo";
	hack[AUTO_FIRE].name = "Rapid fire";
	hack[HIDE_MENU].name = " Hide hack [INSERT]";
	hack[HIDE_MENU].on = true; 
}

void Hacks::DrawMenu(IDirect3DDevice9 *d3dDevice)
{
	if (!hack[HIDE_MENU].on)
	{
	
		DrawFilledRect(55, 20, 200, 50, fontBlue, d3dDevice);
		DrawBorderBox(55, 20, 200, 50, 4, fontBlack, d3dDevice);
		Draw_Text("COD 4 MP hack", 190, 30, fontWhite);

		
		DrawFilledRect(30, 55, 250, (62 * MAX_MENU_ITEMS), fontBlue, d3dDevice);
		
		DrawBorderBox(30, 55, 250, (62 * MAX_MENU_ITEMS), 6, fontBlack, d3dDevice);

		int y = 40;
		for (int i = 0; i < MAX_MENU_ITEMS; i++)
		{

			DrawFilledRect(45, 30 + y, 220, 40, hack[i].on ? fontGreen : fontRed, d3dDevice);

			DrawBorderBox(45, 30 + y, 220, 40, 4, fontBlack, d3dDevice);

		
			if (MenuIndex == i)
			{
				DrawBorderBox(41, 26 + y, 228, 48, 4, fontWhite, d3dDevice);
			}

			
			Draw_Text(hack[i].name.c_str(), 170, 39 + y, fontBlack);
		
			
			y += 50;
		}
		Draw_Text("Select using arrow keys", 170, ((62 * MAX_MENU_ITEMS) + 7), fontWhite);
		Draw_Text("Turn ON/OFF [END] key", 170, ((62 * MAX_MENU_ITEMS) + 27), fontWhite);
	}
}

void Hacks::DrawBorderBox(int x, int y, int w, int h, int thickness, D3DCOLOR Colour, IDirect3DDevice9 *pDevice)
{
	
	DrawFilledRect(x, y, w, thickness, Colour, pDevice);
	
	DrawFilledRect(x, y, thickness, h, Colour, pDevice);
	
	DrawFilledRect((x + w), y, thickness, h, Colour, pDevice);
	
	DrawFilledRect(x, y + h, w + thickness, thickness, Colour, pDevice);
}



void Hacks::DrawFilledRect(int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* dev)
{
	
	D3DRECT BarRect = { x, y, x + w, y + h };

	dev->Clear(1, &BarRect, D3DCLEAR_TARGET | D3DCLEAR_TARGET, color, 0, 0);
}


void Hacks::Draw_Text(LPCSTR TextToDraw, int x, int y, D3DCOLOR Colour)
{
	
	RECT rct = { x - 120, y, x + 120, y + 15 };

	 
	m_font->DrawText(NULL, TextToDraw, -1, &rct, DT_NOCLIP, Colour);
}


void Hacks::KeyboardInput()
{
	if (GetAsyncKeyState(VK_UP) & 1)
	{
		if (MenuIndex > 0)
		{
			MenuIndex--;
		}
	}

	if (GetAsyncKeyState(VK_DOWN) & 1)
	{
		if (MenuIndex < MAX_MENU_ITEMS - 1)
		{
			MenuIndex++;
		}
	}

	if (GetAsyncKeyState(VK_END) & 1)
	{
		hack[MenuIndex].on = !hack[MenuIndex].on;
		if (MenuIndex == NO_RECOIL)
		{
			
		}
		if (MenuIndex == UNLIM_AMMO)
		{
			
		}
	}

	if (GetAsyncKeyState(VK_INSERT) & 1)
	{
		
		hack[HIDE_MENU].on = !hack[HIDE_MENU].on;
	}
}
 
Last edited:

Liduen

Hacker
Dank Tier VIP
May 19, 2013
702
8,478
33
If you're wondering why you won't see a messagebox if you put the instruction behind the return statement, you REALLY should go back to the basics.

Maybe start with learning simple trainers and not jump right into hooks?

https://guidedhacking.com/starthere
 
Last edited by a moderator:

Luciz

Coder
Dank Tier Donator
Nobleman
Jul 10, 2014
101
458
3
Use char* instead of std::string.

Are you sure that the hook is even working?

Also, inside of your class there is no need for Hacks::, and why do you have a struct in a class o_O.
 

tvojama

uz42&4fd
Meme Tier VIP
Dank Tier Donator
Apr 1, 2015
377
2,498
10
In endscene type MessageBox(0, "EndScene", "", 0);
Like that?
C++:
HRESULT APIENTRY hkIDirect3DDevice9::EndScene()
{
	//Move our menu through keyboard import
	hacks.KeyboardInput();
	//Draws our menu with a ton of different colours
	hacks.DrawMenu(m_pD3Ddev);
	return m_pD3Ddev->EndScene();
	MessageBox(0, "EndScene", "", 0);
}
 

tvojama

uz42&4fd
Meme Tier VIP
Dank Tier Donator
Apr 1, 2015
377
2,498
10
C++:
HRESULT APIENTRY hkIDirect3DDevice9::EndScene()
{
	//Move our menu through keyboard import
	hacks.KeyboardInput();
	//Draws our menu with a ton of different colours
	hacks.DrawMenu(m_pD3Ddev);
	MessageBox(0, "EndScene", "", 0);
	return m_pD3Ddev->EndScene();
}
The messagebox must be put above the return statement.
Still nothing, I would upload the dll but I cant
 

Solaire

Respected Hacker
Dank Tier VIP
Dec 15, 2013
1,051
16,353
62
Still nothing, I would upload the dll but I cant
It's probably the hook then. There have been several threads about the hook in Fleep's source not working, I recommend trying to write a new one.
 

till0sch

Respected Hacker
Dank Tier VIP
Dank Tier Donator
Oct 14, 2012
1,104
12,593
51
When Superspinne said there was no hook and that was the issue, he was right.

Also, to draw a menu, you need Reset and EndScene only. No reason to hook all device's functions as you just return them in your hook.
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,074
78,998
2,371
If you're wondering why you won't see a messagebox if you put the instruction behind the return statement, you REALLY should go back to the basics.

Maybe start with learning simple trainers and not jump right into hooks?

Just saying tho :cri:
That's the problem with 97% of the people I'm afraid.

If you manage to put a messagebox after return then you really need to go over the basics again. Why rush? There is nothing to gain in the end.
 

Solaire

Respected Hacker
Dank Tier VIP
Dec 15, 2013
1,051
16,353
62
That's the problem with 97% of the people I'm afraid.

If you manage to put a messagebox after return then you really need to go over the basics again. Why rush? There is nothing to gain in the end.
Meh, it's just a phase that determines if they'll keep hacking or not. I was in the same place, I made tons of C&P hacks and learned very little, and now that I know enough I've started writing most everything on my own. Whether or not the C&Ping and not doing real work continues is completely up to the one learning. Just let the masses filter themselves :)
 

till0sch

Respected Hacker
Dank Tier VIP
Dank Tier Donator
Oct 14, 2012
1,104
12,593
51
Meh, it's just a phase that determines if they'll keep hacking or not. I was in the same place, I made tons of C&P hacks and learned very little, and now that I know enough I've started writing most everything on my own. Whether or not the C&Ping and not doing real work continues is completely up to the one learning. Just let the masses filter themselves :)
I sometimes c&p my own codenz. is that ok?
 

tvojama

uz42&4fd
Meme Tier VIP
Dank Tier Donator
Apr 1, 2015
377
2,498
10
Meh, it's just a phase that determines if they'll keep hacking or not. I was in the same place, I made tons of C&P hacks and learned very little, and now that I know enough I've started writing most everything on my own. Whether or not the C&Ping and not doing real work continues is completely up to the one learning. Just let the masses filter themselves :)
I just do this for learning and I agree with you, masses will filter them selves :)
In two months my "standard" school ends and I can continue my education in a more technical school where I will learn programming, then come back here and make a bunch of hacks because there is something special about coding I cannot describe, the feeling I get when I start learning or making a project in C++, or even when making a site in HTML and CSS :D
 
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