Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › C++/C Programming › Easy VTable Hook (D3D9)

PostEasy VTable Hook (D3D9)

Posts 1–6 of 6 · Page 1 of 1
SU
Superspinne
Easy VTable Hook (D3D9)
Yo MPGH peoplz,

I just want to share my method to get the VTable which points to the neat functions like Present/EndScene/DrawIndexedPrimitive etc.
Since I didn't found an easier or similar method I just can pray I didn't double post this:

Code:
DWORD* GetVTable()
{
     D3DPRESENT_PARAMETERS D3D_Present_Param={0,0,D3DFMT_UNKNOWN,0,D3DMULTISAMPLE_NONE,0,D3DSWAPEFFECT_DISCARD,0,1,0,D3DFMT_UNKNOWN,0,0,0};
     IDirect3DDevice9* pDummy;
     Direct3DCreate9(D3D_SDK_VERSION)->CreateDevice(0,D3DDEVTYPE_HAL,GetForegroundWindow(),D3DCREATE_SOFTWARE_VERTEXPROCESSING,&D3D_Present_Param,&pDummy);
     return (DWORD*)((DWORD*)pDevice)[0];
}
This method is based on creating your own IDirect3DDevice9* (with some lame standard parameters).
You can just use it like this:

Code:
DWORD* pVTable=GetVTable();
//Present example:
pPresent=(nPresent)DetourFunction(pVTable[17],hkPresent);
I don't know who came up with the idea of creating your own dummy device first so I can't give any credits

Anyways I hope this is usefull to some of you

Ps. I know this isn't nicely coded - it's just as compact as possible. To make it more save make sure the d3d9.dll is loaded and CreateDevice/Direct3DCreate9 didn't fail. And don't c-cast like I did if you want a stable code
#1 · edited 11y ago · 11y ago
MI
MineCore
You are using the Microsoft Detour right ? They are detected or you know for VAC3 or ??
#2 · 11y ago
SU
Superspinne
Hooking via VTable is detected by VAC.
#3 · 11y ago
BL
blackstab1337
Quote Originally Posted by Superspinne View Post
Hooking via VTable is detected by VAC.
No, it isn't.
#4 · 11y ago
SU
Superspinne
Quote Originally Posted by blackstab1337 View Post
No, it isn't.
Got banned for hooking present once via VTable - in my opinion I call that detected.
VAC isn't be that dumb to not check the well known d3d9 functions.
#5 · 11y ago
SU
Superspinne
If people have trouble using this - I'm just dumb. There's a typo in the return line.
It should (of course) be:
return (DWORD*)((DWORD*)pDummy)[0];
#6 · 11y ago
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Similar Threads

  • [Source]Vtable Hook?By SoreBack in Combat Arms Hacks & Cheats
    17Last post 17y ago
  • Vtable hooking/Vmt hookingBy SirKinky in Alliance of Valiant Arms (AVA) Discussions
    2Last post 14y ago
  • [CODE]VTable hookingBy Hell_Demon in C++/C Programming
    4Last post 15y ago
  • Vtable hook sourceBy nitega in All Points Bulletin Reloaded Hacks
    26Last post 14y ago
  • -How to make .dll[Vtable Hook]-By gokhanw in All Points Bulletin Reloaded Hacks
    16Last post 14y ago

Tags for this Thread

#d3d hook#d3d9#endscene#menu#present#swag#vtable