LightbulbUndetected D3D HOOK

Posts 1–14 of 14 · Page 1 of 1
Undetected D3D HOOK
CPP:
Code:
extern "C" __declspec(dllexport) BOOL WINAPI DllMain(HMODULE hDLL, DWORD dwReason, LPVOID lpvRe)
{
	DisableThreadLibraryCalls(hDLL);

	if(dwReason == DLL_PROCESS_ATTACH)
	{
		MID_D3DX9_29();
	}
	return true;
}
H:
Code:
DWORD jump_Font,jump_Present,jump_DrawIndexedPrimitive;


/*========================================*/
__declspec(naked) DWORD __stdcall pPresent( LPDIRECT3DDEVICE9 pDevice, CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion)
{
	__asm 
	{
		MOV EDI,EDI
		PUSH EBP
		MOV EBP,ESP   
		jmp jump_Present
	}
}
HRESULT _stdcall  my_Present(LPDIRECT3DDEVICE9 pDevice, CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) 
{

	return pPresent(pDevice, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
}
/*========================================*/








__declspec(naked) DWORD __stdcall pDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinIndex,UINT NumVertices, UINT StartIndex, UINT PrimitiveCount)
{
	__asm 
	{
		MOV EDI,EDI
		PUSH EBP
		MOV EBP,ESP   
		jmp jump_DrawIndexedPrimitive
	}
}

HRESULT _stdcall  my_DrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinIndex,UINT NumVertices, UINT StartIndex, UINT PrimitiveCount) 
{
	
	return pDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinIndex, NumVertices, StartIndex, PrimitiveCount);
} 
/*========================================*/









/*========================================*/
__declspec(naked) DWORD __stdcall D3DXCreateFont(DWORD A, DWORD B, DWORD C, DWORD D, DWORD E, DWORD F, DWORD G, DWORD H, DWORD I, DWORD J, DWORD K, DWORD L)
{
	__asm 
	{
		MOV EDI,EDI
		PUSH EBP
		MOV EBP,ESP   
		jmp jump_Font
	}
}
DWORD __stdcall MyD3DXCreateFont(DWORD A, DWORD B, DWORD C, DWORD D, DWORD E, DWORD F, DWORD G, DWORD H, DWORD I, DWORD J, DWORD K, DWORD L)
{
	DWORD thisa = *(DWORD*)A;


	/*=====Present Hook=====*/
	DWORD old_Present;
	DWORD PSAddress						=  thisa + 68;//17*4 Present 
	DWORD MID_Present					= *(DWORD*)PSAddress;
	jump_Present						= MID_Present+5; 

	VirtualProtect((LPVOID)MID_Present, 5, PAGE_EXECUTE_READWRITE, &old_Present);
	*(PBYTE)MID_Present					= 0xE9;
	*(PULONG)(MID_Present+1)			= (DWORD)my_Present - (MID_Present + 5);
	/*=====Present Hook=====*/


	/*=====DrawIndexedPrimitive Hook=====*/
	DWORD OLD_DrawIndexedPrimitive;
	DWORD DIPAddress					= thisa + 328;//82*4 DrawIndexedPrimitive  
	DWORD MID_DrawIndexedPrimitive		= *(DWORD*)DIPAddress;
	jump_DrawIndexedPrimitive			= MID_DrawIndexedPrimitive +5; 

	VirtualProtect((LPVOID)MID_DrawIndexedPrimitive, 5, PAGE_EXECUTE_READWRITE, &OLD_DrawIndexedPrimitive);
	*(PBYTE)MID_DrawIndexedPrimitive = 0xE9;
	*(PULONG)(MID_DrawIndexedPrimitive+1) = (DWORD)my_DrawIndexedPrimitive - (MID_DrawIndexedPrimitive + 5);
	/*=====DrawIndexedPrimitive Hook=====*/




	*(PULONG)(jump_Font-5) = 0x0000008b;
	*(PULONG)(jump_Font-4) = 0xEC8B55FF;

	return D3DXCreateFont(A,B,C,D,E,F,G,H,I,J,K,L); 
}
/*========================================*/







void MID_D3DX9_29()
{
	DWORD OLD_Font;
	HMODULE H_D3DX9_29					= LoadLibraryA("d3dx9_29.dll");
	
	PVOID Address_Font					= (PVOID)GetProcAddress(H_D3DX9_29, eCreateFont);
	VirtualProtect(Address_Font, 5, PAGE_EXECUTE_READWRITE, &OLD_Font);
	jump_Font							= (DWORD)Address_Font + 0x5; 
	*(PULONG)Address_Font				= 0xE9;
	*(PULONG)((DWORD)Address_Font +0x1)	= (DWORD)MyD3DXCreateFont - ((DWORD)Address_Font + 0x5);
}
Quote Originally Posted by zmodteam View Post
CPP:
Code:
extern "C" __declspec(dllexport) BOOL WINAPI DllMain(HMODULE hDLL, DWORD dwReason, LPVOID lpvRe)
{
	DisableThreadLibraryCalls(hDLL);

	if(dwReason == DLL_PROCESS_ATTACH)
	{
		MID_D3DX9_29();
	}
	return true;
}
H:
Code:
DWORD jump_Font,jump_Present,jump_DrawIndexedPrimitive;


/*========================================*/
__declspec(naked) DWORD __stdcall pPresent( LPDIRECT3DDEVICE9 pDevice, CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion)
{
	__asm 
	{
		MOV EDI,EDI
		PUSH EBP
		MOV EBP,ESP   
		jmp jump_Present
	}
}
HRESULT _stdcall  my_Present(LPDIRECT3DDEVICE9 pDevice, CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) 
{

	return pPresent(pDevice, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
}
/*========================================*/








__declspec(naked) DWORD __stdcall pDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinIndex,UINT NumVertices, UINT StartIndex, UINT PrimitiveCount)
{
	__asm 
	{
		MOV EDI,EDI
		PUSH EBP
		MOV EBP,ESP   
		jmp jump_DrawIndexedPrimitive
	}
}

HRESULT _stdcall  my_DrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinIndex,UINT NumVertices, UINT StartIndex, UINT PrimitiveCount) 
{
	
	return pDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinIndex, NumVertices, StartIndex, PrimitiveCount);
} 
/*========================================*/









/*========================================*/
__declspec(naked) DWORD __stdcall D3DXCreateFont(DWORD A, DWORD B, DWORD C, DWORD D, DWORD E, DWORD F, DWORD G, DWORD H, DWORD I, DWORD J, DWORD K, DWORD L)
{
	__asm 
	{
		MOV EDI,EDI
		PUSH EBP
		MOV EBP,ESP   
		jmp jump_Font
	}
}
DWORD __stdcall MyD3DXCreateFont(DWORD A, DWORD B, DWORD C, DWORD D, DWORD E, DWORD F, DWORD G, DWORD H, DWORD I, DWORD J, DWORD K, DWORD L)
{
	DWORD thisa = *(DWORD*)A;


	/*=====Present Hook=====*/
	DWORD old_Present;
	DWORD PSAddress						=  thisa + 68;//17*4 Present 
	DWORD MID_Present					= *(DWORD*)PSAddress;
	jump_Present						= MID_Present+5; 

	VirtualProtect((LPVOID)MID_Present, 5, PAGE_EXECUTE_READWRITE, &old_Present);
	*(PBYTE)MID_Present					= 0xE9;
	*(PULONG)(MID_Present+1)			= (DWORD)my_Present - (MID_Present + 5);
	/*=====Present Hook=====*/


	/*=====DrawIndexedPrimitive Hook=====*/
	DWORD OLD_DrawIndexedPrimitive;
	DWORD DIPAddress					= thisa + 328;//82*4 DrawIndexedPrimitive  
	DWORD MID_DrawIndexedPrimitive		= *(DWORD*)DIPAddress;
	jump_DrawIndexedPrimitive			= MID_DrawIndexedPrimitive +5; 

	VirtualProtect((LPVOID)MID_DrawIndexedPrimitive, 5, PAGE_EXECUTE_READWRITE, &OLD_DrawIndexedPrimitive);
	*(PBYTE)MID_DrawIndexedPrimitive = 0xE9;
	*(PULONG)(MID_DrawIndexedPrimitive+1) = (DWORD)my_DrawIndexedPrimitive - (MID_DrawIndexedPrimitive + 5);
	/*=====DrawIndexedPrimitive Hook=====*/




	*(PULONG)(jump_Font-5) = 0x0000008b;
	*(PULONG)(jump_Font-4) = 0xEC8B55FF;

	return D3DXCreateFont(A,B,C,D,E,F,G,H,I,J,K,L); 
}
/*========================================*/







void MID_D3DX9_29()
{
	DWORD OLD_Font;
	HMODULE H_D3DX9_29					= LoadLibraryA("d3dx9_29.dll");
	
	PVOID Address_Font					= (PVOID)GetProcAddress(H_D3DX9_29, eCreateFont);
	VirtualProtect(Address_Font, 5, PAGE_EXECUTE_READWRITE, &OLD_Font);
	jump_Font							= (DWORD)Address_Font + 0x5; 
	*(PULONG)Address_Font				= 0xE9;
	*(PULONG)((DWORD)Address_Font +0x1)	= (DWORD)MyD3DXCreateFont - ((DWORD)Address_Font + 0x5);
}
If detected? What do i need to update? Dip and Present?
Im so sr! I dont help u.
update?
Quote Originally Posted by malfac009 View Post
If detected? What do i need to update? Dip and Present?
yeah, please, answer this question, I too need help about it.
Credits? this hook has been posted tons of times before..
Tạo giúp mình 1 bản hack cf4vn đc ko thím. nếu đc mình sẽ hậu tạ. tks thím
Quote Originally Posted by BacLee View Post
Tạo giúp mình 1 bản hack cf4vn đc ko thím. nếu đc mình sẽ hậu tạ. tks thím
Hack thường thì làm được.. D3D menu cho CF4VN mình ko làm dc nhaz )
Bác có source D3D Menu Cho CFVTC không cho minh xin code đi
Quote Originally Posted by nhanguyen0228 View Post
Bác có source D3D Menu Cho CFVTC không cho minh xin code đi
U can use this code hook (Only CFVTC)
Code:
/*==============================================*/
#define ReCa(Type,Var) reinterpret_cast<Type>(Var)
unsigned long WINAPI HOOKD3D9() 
{ 
	LoadLibrary("d3d9.dll"); //make sure the d3d9.dll is loaded 
	D3DPRESENT_PARAMETERS D3D_Present_Param={0,0,D3DFMT_UNKNOWN,0,D3DMULTISAMPLE_NONE,0,D3DSWAPEFFECT_DISCARD,0,1,0,D3DFMT_UNKNOWN,0,0,0}; //simple parameters
	IDirect3DDevice9* pDummy; //declare dummy device 
	Direct3DCreate9(D3D_SDK_VERSION)->CreateDevice(0,D3DDEVTYPE_HAL,GetForegroundWindow(),D3DCREATE_SOFTWARE_VERTEXPROCESSING,&D3D_Present_Param,&pDummy); //create device and save into dummy
	pVTable=ReCa(void**,ReCa(DWORD*,pDummy)[0]); //get vtable from the new device
	
	if (!pVTable17 && !pVTable82)
	{
		if(*pVTable)
		{
			pPresent=(oPresent)DetourFunction((PBYTE)pVTable[17],(PBYTE)myPresent);
			pDrawIndexedPrimitive=(oDrawIndexedPrimitive)DetourFunction((PBYTE)pVTable[82],(PBYTE)myDrawIndexedPrimitive);
			pVTable17 = (unsigned long)pVTable[17];
			pVTable82 = (unsigned long)pVTable[82];
		}
	}
	return false;
}
/*==============================================*/
or http://www.mpgh.net/forum/showthread.php?t=1175113
----------- vni: đột kích việt nam thì bạn dùng các hook thông thường có trên mạng, cái nào cũng xài được hết..., chắc cái này là do sự thiếu sót của VTC )
Quote Originally Posted by zmodteam View Post
Hack thường thì làm được.. D3D menu cho CF4VN mình ko làm dc nhaz )
e chỉ cần hack wall + thêm đc chức năng j thì càng tốt. tks a ạ

Link fb: facebook.com/duylee9x
Quote Originally Posted by BacLee View Post
e chỉ cần hack wall + thêm đc chức năng j thì càng tốt. tks a ạ

Link fb: facebook.com/duylee9x
hỏi vina cà phê ý he he
Can you please explain exactly what i need to update if this become's detected?
Posts 1–14 of 14 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us