Solved Overlay drawing

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

j3b

Jr.Coder
Full Member
Nobleman
Dec 18, 2012
67
408
1
Hello. Ive finnished my external cheat now ( ESP, Aimbot,Radar,CrossHair ). Problem is that my computer isnt the best, and its lagging abit in windowmode + with the overlay ( using DirectX )
So i want to be able to draw in fullscreen mode and i was reading about DirectXhooking and Enginedrawing.
It seems like Enginedrawing is detected, since you modify the game. So i was thinking about DirectXhooking? But i dont know if this is what im looking for?

How do you draw in fullscreen mode?
Is it detected? ( doing it for CSGO, using VAC )

I dont want you to give me code or anything, just point me in the right direction ;)

Thanks!
 

NTvalk

Hacker
Meme Tier VIP
Jul 6, 2013
499
3,108
8
Yes you need to hook endscene (or a similar function), best way is to do it through the vtable:

Whenever a class defines a virtual function (or method), most compilers add a hidden member variable to the class which points to a so called virtual method table (VMT or Vtable). This VMT is basically an array of pointers to (virtual) functions. At runtime these pointers will be set to point to the right function, because at compile time, it is not yet known if the base function is to be called or a derived one implemented by a class that inherits from the base class. The code below shows an example of a VMT hook, if you want to implement this in direct3d you need to create a new device, and use that to replace the original function in the original device.

You need to get a pointer to the d3d device (can be done by reversing) and from there patch endscene at a certain index (42 out of my head).
Example of a vtable hook (not directx):
C++:
class VirtualTable {  // example class 
public: 
virtual void VirtualFunction01( void ); 
}; 
void VirtualTable::VirtualFunction01( void )  {  // just a function as example
cout << "VirtualFunction01 called" << endl; 
} 
// pointer to original function 
typedef void ( __thiscall* VirtualFunction01_t )( void* thisptr ); 
VirtualFunction01_t g_org_VirtualFunction01; 
//our detour function 
void __fastcall hk_VirtualFunction01( void* thisptr, int edx )  { 
cout << "Custom function called" << endl; 
//call the original function 
g_org_VirtualFunction01(thisptr); 
} 
int _tmain(int argc, _TCHAR* argv[])  { 
VirtualTable* myTable = new VirtualTable(); 
//get the pointer to the actual virtual method table from our pointer to our class instance 
void** base = *(void***)myTable; 
DWORD oldProtection; 
// protection
VirtualProtect( &base[0], 4, PAGE_EXECUTE_READWRITE, &oldProtection ); 
//save the original function 
g_org_VirtualFunction01 = (VirtualFunction01_t)base[0]; 
//overwrite 
base[0] = &hk_VirtualFunction01; 
//restore page protection 
VirtualProtect( &base[0], 4, oldProtection, 0 ); 
//call the virtual function (now hooked) from our class instance 
myTable->VirtualFunction01(); 
return 0; 
}
https://guidedhacking.com/threads/how-to-get-started-with-directx-9-make-your-menu-hacks.10402
 
Last edited by a moderator:

j3b

Jr.Coder
Full Member
Nobleman
Dec 18, 2012
67
408
1
Yes you need to hook endscene (or a similar function), best way is to do it through the vtable:

Whenever a class defines a virtual function (or method), most compilers add a hidden member variable to the class which points to a so called virtual method table (VMT or Vtable). This VMT is basically an array of pointers to (virtual) functions. At runtime these pointers will be set to point to the right function, because at compile time, it is not yet known if the base function is to be called or a derived one implemented by a class that inherits from the base class. The code below shows an example of a VMT hook, if you want to implement this in direct3d you need to create a new device, and use that to replace the original function in the original device.

You need to get a pointer to the d3d device (can be done by reversing) and from there patch endscene at a certain index (42 out of my head).
Example of a vtable hook (not directx):
C++:
class VirtualTable {  // example class  
 public:  
 virtual void VirtualFunction01( void );  
 };  
 void VirtualTable::VirtualFunction01( void )  {  // just a function as example
 cout << "VirtualFunction01 called" << endl;  
 }  
 // pointer to original function  
 typedef void ( __thiscall* VirtualFunction01_t )( void* thisptr );  
 VirtualFunction01_t g_org_VirtualFunction01;  
 //our detour function  
 void __fastcall hk_VirtualFunction01( void* thisptr, int edx )  {  
 cout << "Custom function called" << endl;  
 //call the original function  
 g_org_VirtualFunction01(thisptr);  
 }  
 int _tmain(int argc, _TCHAR* argv[])  {  
 VirtualTable* myTable = new VirtualTable();  
 //get the pointer to the actual virtual method table from our pointer to our class instance  
 void** base = *(void***)myTable;  
 DWORD oldProtection;  
 // protection 
 VirtualProtect( &base[0], 4, PAGE_EXECUTE_READWRITE, &oldProtection );  
 //save the original function  
 g_org_VirtualFunction01 = (VirtualFunction01_t)base[0];  
 //overwrite  
 base[0] = &hk_VirtualFunction01;  
 //restore page protection  
 VirtualProtect( &base[0], 4, oldProtection, 0 );  
 //call the virtual function (now hooked) from our class instance  
 myTable->VirtualFunction01();  
 return 0;  
 }

Thanks alot, i will look more into it.
By the way... does VAC detect hooking..?
 
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