Solved Draw:_Text func dont work

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Killerzwerg

Newbie
Full Member
Jun 3, 2017
13
184
0
Hey guys,
i dont can figure out why the engine draw_text func dont work hope you can help me :)
Code:
#include <Windows.h>

void EngineDrawString(char *pText, int x, int y, int r, int g, int b, int pUnknown, int pUnknown2)
{
	__asm
	{
		push pUnknown2;
		push pUnknown;
		push b;
		push r;
		push y;
		push x;
		push pText;
		mov eax, g;
		mov ecx, 0x41A150;
		call ecx;
		add esp, 0x1C;
	}
}

bool Hook(void * toHook, void * ourFunct, int len) {
	if (len < 5) {
		return false;
	}

	DWORD curProtection;
	VirtualProtect(toHook, len, PAGE_EXECUTE_READWRITE, &curProtection);

	memset(toHook, 0x90, len);

	DWORD relativeAddress = ((DWORD)ourFunct - (DWORD)toHook) - 5;

	*(BYTE*)toHook = 0xE9;
	*(DWORD*)((DWORD)toHook + 1) = relativeAddress;

	DWORD temp;
	VirtualProtect(toHook, len, curProtection, &temp);

	return true;
}

DWORD jmpBackAddy = NULL;
void __declspec(naked) ourFunct() 
{
	__asm 
	{
		__asm push ebp;
		__asm mov ebp, esp;
		__asm jmp[jmpBackAddy];
	}
}

DWORD WINAPI MainThread(LPVOID param) {
	int hookLength = 6;
	DWORD hookAddress = 0x40AAF0;//draw_hud
	jmpBackAddy = hookAddress + hookLength;

	Hook((void*)hookAddress, ourFunct, hookLength);

	while (true)
	{
		EngineDrawString("String", 10, 10, 255, 0, 0, 0, 50);
	}
	
	uintptr_t base = (uintptr_t)GetModuleHandle("ac_client.exe");

	FreeLibraryAndExitThread((HMODULE)param, 0);

	return 0;
}

BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpReserved) {
	switch (dwReason) {
	case DLL_PROCESS_ATTACH:
		CreateThread(0, 0, MainThread, hModule, 0, 0);
		break;
	}
	return TRUE;
}
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,118
78,998
2,392
If you look at A200K's code you're not doing the same thing he's doing and that's why the C&P ain't working, you have to C&P the whole thing to get it to work

https://github.com/A200K/AssaultCube_Hack/blob/master/AssaultCube Hack/Hooks.cpp

He also uses inline ASM to do his DrawHUD mid function Hook at the end of the function rather than at the beginning

Inside the gl_DrawHud Hook, it calls PreRenderFrame, which Calls OnRenderFrame which calls MenuRender, which calls DrawString and there is a whole lot of openGL magic in between those calls that if not replicated correctly it won't draw on top of the frame correctly and preserve the openGL state machine before and after
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,118
78,998
2,392
Killerzwerg what the fuck was wrong with your other account and your other shitpost exactly that you were required to make duplicates?
 

Killerzwerg

Newbie
Full Member
Jun 3, 2017
13
184
0
i forgot the pw from my other acc and the site dont send me the e-mail and i dont want to spam/duplicating sry for that you can delete the other post when you will!
sry for my bad english :)
 
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