D3D Menu Detected

Posts 1–5 of 5 · Page 1 of 1
D3D Menu Detected
Please Give Me D3D Menu Hook !
Quote Originally Posted by Kzmcheater View Post
Please Give Me D3D Menu Hook !
Begging sure won't get you a D3D Menu Hook
Code:
typedef HRESULT(WINAPI* tReset)(LPDIRECT3DDEVICE9 pDevice,D3DPRESENT_PARAMETERS* Parametri);
tReset oReset;

typedef HRESULT(WINAPI* tPresent)(LPDIRECT3DDEVICE9 pDevice,CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion);
tPresent oPresent;


void CreateDev(DWORD * dwVTable){
LPDIRECT3D9 pD3d9 = NULL;
LPDIRECT3DDEVICE9 pD3DDevice = NULL;
pD3d9 = Direct3DCreate9(32);
if(pD3d9 == NULL)
return;
D3DPRESENT_PARAMETERS pPresentParms;
ZeroMemory(&pPresentParms,sizeof(pPresentParms));
pPresentParms.Windowed = TRUE;
pPresentParms.BackBufferFormat = D3DFMT_UNKNOWN;
pPresentParms.SwapEffect = D3DSWAPEFFECT_DISCARD;
if(FAILED(pD3d9->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,GetDesktopWindow(),D3DCREATE_SOFTWARE_VERTEXPROCESSING,&pPresentParms,&pD3DDevice)))
return;
DWORD * dwTable = ( DWORD* )pD3DDevice;
dwTable = ( DWORD* ) dwTable[0];
dwVTable[0] = dwTable[16];
dwVTable[1] = dwTable[17];
dwVTable[2] = dwTable[82];
}

void *Salta (BYTE *src, const BYTE *dst, const int len)
{
    BYTE *jmp = (BYTE *)malloc(len + 5);
	DWORD dwback;
	VirtualProtect(src, len, PAGE_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);
} 
HRESULT WINAPI hkPresent(LPDIRECT3DDEVICE9 pDevice,CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion){
_asm PUSHAD;

if(Directx_Font == NULL)D3DXCreateFontA(pDevice, 14, 6, FW_BOLD, 1, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial", &Directx_Font);
_asm POPAD;
return oPresent(pDevice, pSourceRect,  pDestRect,  hDestWindowOverride,  pDirtyRegion);
}

HRESULT WINAPI hkReset(LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS *a)
{
	pFont->OnLostDevice();

	HRESULT hTorna = oReset(pDevice, a);

	if(SUCCEEDED(hTorna)) pFont->OnResetDevice();

	return oReset(pDevice, a);
}


DWORD WINAPI Hook(LPVOID lpArgs)
{
	DWORD dwD3D9 = 0;
	
	while(!dwD3D9)
	{
		Sleep(100);
		dwD3D9 = (DWORD)GetModuleHandle(/*d3d9.dll*/XorStr<0x2A,9,0xE84E0554>("\x4E\x18\x48\x14\x00\x4B\x5C\x5D"+0xE84E0554).s);
	}

	DWORD dwVTable[1] = { 0 };
	CreateDev(dwVTable);

	oReset   = (tReset) Salta((PBYTE) dwVTable[1], (PBYTE) &hkReset, 5);
	oPresent = (tPresent) Salta((PBYTE) dwVTable[2], (PBYTE) &hkPresent, 5);

	return 0;
}
its a detected combat arms hook... go for it.
Credits go to NubzGetKillz i think
is this really what this section has become? How has it been 19 hours without someone deleting this thread?
Quote Originally Posted by Void View Post
is this really what this section has become? How has it been 19 hours without someone deleting this thread?
Because the minion gives negative 3 damns about the section
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us