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 › D3D Menu Help

D3D Menu Help

Posts 1–8 of 8 · Page 1 of 1
ac1d_buRn
ac1d_buRn
D3D Menu Help
Hey

Well im tryning to move on from hotkeys to a menu.
Im using hans base.

When i inject into CA, The menu shows up, But when i go ingame i DC.

I can stay in the lobby for as long as i want, But as soon as i go ingame, I DC

Could someone please tell me how to fix this?

Heres the source

Code:
#include "d3dbase.h"
#include "d3dfont9.cpp"

oEndScene	pEndScene;
oReset		pReset;

CD3DFont	*pFont=NULL;


void PreReset(pD3DdeviceX pDevice)
{
	if (pFont) {
		pFont->InvalidateDeviceObjects();
		pFont->DeleteDeviceObjects();
		pFont = NULL;
	}
}

void PostReset(pD3DdeviceX pDevice)
{
	pFont = new CD3DFont("Tahoma", 10, D3DFONT_BOLD);
	if (pFont) {
		pFont->InitDeviceObjects(pDevice);
		pFont->RestoreDeviceObjects();
	}
}

HRESULT WINAPI myReset ( pD3DdeviceX pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters )
{
    PreReset(pDevice);
    return pReset(pDevice, pPresentationParameters);
}

HRESULT WINAPI myEndScene (pD3DdeviceX pDevice)
{
	if (pFont==NULL) 
	    PostReset(pDevice);			// Create font
	else 
		DoMenu(pDevice);
	return pEndScene(pDevice);
}

void DrawBox(pD3DdeviceX pDevice, int x, int y, int w, int h, D3DCOLOR col)
{
	struct {
		float x,y,z,rhw;
		DWORD dwColor;
	} qV[4] = { { (float)x    , (float)(y+h), 0.0f, 0.0f, col},
				{ (float)x    , (float)y    , 0.0f, 0.0f, col},
				{ (float)(x+w), (float)(y+h), 0.0f, 0.0f, col},
				{ (float)(x+w), (float)y    , 0.0f, 0.0f, col} };

	pDevice->SetPixelShader(NULL);
    pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE,true);
    pDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA);
    pDevice->SetTexture(0, NULL);
    pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,qV,sizeof(qV[0]));
}

bool bCompare(const BYTE* pData, const BYTE* bMask, const char* szMask)
{
	for(;*szMask;++szMask,++pData,++bMask)
		if(*szMask=='x' && *pData!=*bMask)   return 0;
	return (*szMask) == NULL;
}

DWORD FindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char * szMask)
{
	for(DWORD i=0; i<dwLen; i++)
		if (bCompare((BYTE*)(dwAddress+i),bMask,szMask))  return (DWORD)(dwAddress+i);
	return 0;
}

void *DetourCreate(BYTE *src, const BYTE *dst, const int len)
{
	BYTE *jmp = (BYTE*)malloc(len+5);
	DWORD dwBack;

	VirtualProtect(src, len, PAGE_EXECUTE_READWRITE, &dwBack);
	memcpy(jmp, src, len);	
	jmp += len;
	jmp[0] = 0xE9;
	*(DWORD*)(jmp+1) = (DWORD)(src+len - jmp) - 5;
	src[0] = 0xE9;
	*(DWORD*)(src+1) = (DWORD)(dst - src) - 5;
	for (int i=5; i<len; i++)  src[i]=0x90;
	VirtualProtect(src, len, dwBack, &dwBack);
	return (jmp-len);
}

int D3Dinit(void)
{
	DWORD		hD3D, adr, *vtbl;

	// wait for the d3dx dll
	hD3D=0;
	do {
		hD3D = (DWORD)GetModuleHandle(D3Ddllname);
		Sleep(10);
	} while(!hD3D);
	adr = FindPattern(hD3D, 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx");
	if (adr) {
		memcpy(&vtbl,(void *)(adr+2),4);
		pReset	  = (oReset)	DetourCreate((PBYTE)vtbl[RESET]   , (PBYTE)myReset   ,5);
 		pEndScene = (oEndScene)	DetourCreate((PBYTE)vtbl[ENDSCENE], (PBYTE)myEndScene,5);
 	}
	CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)HACKthread, NULL, NULL, NULL);
	return 0;
}

BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
	DisableThreadLibraryCalls(hDll);
	if (dwReason == DLL_PROCESS_ATTACH) {		
		CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)D3Dinit, NULL, NULL, NULL);
	}
	return TRUE;
}
Can someone please help me?

Thanks,
acid_buRn
#1 · 16y ago
MI
MintSlice
i dont no much about D3D menu's so i couldn't tell you whats wrong.. ill copy the code and try mess around with it
#2 · 16y ago
AeroMan
AeroMan
i think Hans base is patched...
also wrong addies i think,
#3 · 16y ago
Zoom
Zoom
I guess you need to update the pDevice addie and make an undetected detour.
#4 · 16y ago
why06
why06
You might need to wait for: ClientFX.fxd and CShell.dll as well. it could be detected, but I don't think so.

Also for reset all you need to do is call OnLostDevice on pfont for preReset and OnResetDevice in PostReset. Also you don't include post reset in your reset.

My theory: SInce your reset is failing, the game probably calls reset once you enter the game, but at that time your pfont has already been lost and has not been restored because you failed to do so. For that reason your game crashes.

EDIT: and oh lord you have post reset in your endscene, though I suppose it works. It looks like you just stuck these function any old place. In quite a few places the logic is a tad off. Lastly you might want to draw something, just to see if you can. Finally I'd recommend using a test environment first. I found I was able to debug a lot faster with one. Props to Voltage for that.
#5 · edited 16y ago · 16y ago
Void
Void
I kind of suggest this to everyone having problems with hooking. =\

Remove everything from your hook function and return normally. See if that crashes, if it doesn't, then there is something wrong in your code. From there you can slowly debug everything.

Hmm..
[php]
HRESULT PresentHook(Params)
{
return pPresent(Params); //return normally
}
[/php]
#6 · 16y ago
why06
why06
No! No! No1 WINAPI or stdcall. Remember? like u told me you need to specify its stdcall D:
#7 · 16y ago
Void
Void
But he did that already. And WINAPI == __stdcall, same thing.
#8 · 16y ago
Posts 1–8 of 8 · Page 1 of 1

Post a Reply

Similar Threads

  • D3D menu HelpBy SteamAss in CrossFire Help
    5Last post 15y ago
  • D3D menu Help Please....By ~InsaneWayne~ in C++/C Programming
    14Last post 16y ago
  • [Help]D3D Menu DevelopmentBy why06 in DirectX/D3D Development
    7Last post 15y ago
  • [HELP]D3D Menu Won't WorkBy Lonly in Combat Arms Hack Coding / Programming / Source Code
    31Last post 16y ago
  • [Help]D3D MenuBy cothen12 in C++/C Programming
    13Last post 18y ago

Tags for this Thread

None