HelpEngine text

Posts 1–4 of 4 · Page 1 of 1
Engine text
Just found some info about engine text on another forum and decided to use it in my hack, but for some reason game crashes after start. It crashes when i'm calling DrawEngineString function which is obviously, i've tried to call it when i'm pressing a button when i am in a game room, but it doesn't affect on a game. Addresses for NA, i'm almost sure that they are correct, thought about they added another bool or something, i've tried to play with some parameters but no luck. Ofc i looked attentively at this function in Olly, don't saw much difference. Maybe i'm blind, idk:/ Any help (regarding of my question instead, not by saying learn asm etc) would be appreciated.

Code:

Code:
unsigned long ulCShell_Module = 0;

typedef void ( __thiscall *lpDrawEngineString ) ( unsigned long ulFontBase, char* szString, int xCoord, int yCoord, unsigned long clColor, bool bShadow, bool bUnk);
lpDrawEngineString DrawEngineString;

unsigned long __stdcall runMem(void* lParam)
{
	while( !ulCShell_Module )
	{
		ulCShell_Module = (unsigned long)GetModuleHandle("CShell.dll");
		Sleep(10);
	}

	DrawEngineString = (lpDrawEngineString ) ( ulCShell_Module + 0x002DB8A0 );

	unsigned long ulFontBase = *(unsigned long*) ( ulCShell_Module + 0xDBD1C8 );

	DrawEngineString(ulFontBase, "Hello World", 30, 80, D3DCOLOR_XRGB(255, 0, 0), true, false);

	return 0;
}
ulFontBase is a pointer try to check if it's null. you're missing one parameter. you can't use drawenginestring in a thread you need to use it in a hooked function like endscene or any like that.

Code:
typedef void ( __thiscall *lpDrawEngineString ) ( unsigned long ulFontBase, char* szString, int xCoord, int yCoord, unsigned long clColor, bool bShadow, bool bUnderline, bool bUnk);
The typedef way is fine for people that dont wanna mess too much asm and looks a bit cleaner. You can still use reinterpret_cast to make it clean also.
About the pointers :
Code:
#define DrawEngineString_Call 0x2DB8A0
#define DrawEngineString_ulBase 0xDBD1C8
so it seems to be correct.

That's what I use to make my menu in my sig.
Thanks, Ultra! Text is drawning correctly now (if i put function call in EndScene), but main reason why i looked at engine drawning it's because hook which i am using is detected on a latest X-TRAP version (87xx, i don't remember exactly).

Is there any ways to draw text without hooking d3d functions? I heard about Start3D/FlipScreen/End3D, would it work if i hook one of them correctly and call DrawEngineString inside hooked function? I'm actually reading and trying something now, but i still want to heard some advises from more experienced people, should i use it or better find another solution to hook es/present ud?

Here is the function description for End3D in NOLF2 SDK, i'm right understanding that it's actually the same thing as EndScene?

Code:
LTRESULT(* ILTClient::End3D)(uint32 flags)  
 
Parameters:
 flags  Flags to use when performing the flip (a combination of END3D_ flags in ltcodes.h).  

Returns:
LT_OK, LT_NOTINITIALIZED, or LT_NOTIN3D.
End a Start3D/End3D block.

Note:
You must be in a Start3D()/End3D() block in order to render through any cameras.
It should work on End3D. But I didn't test yet. I hooked somewhere else in win32 api functions (a time based function).
Btw my method doesn't do well when it comes to draw ingame it makes me lag so much.
You should definitely try End3D. Give me some feedback if it works.
You can still try to hook Endscene and Present with a new hook but trying new methods is always better.
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us