Results 1 to 14 of 14
  1. #1
    zmodteam's Avatar
    Join Date
    Jun 2016
    Gender
    male
    Location
    Ho Chi Minh city
    Posts
    28
    Reputation
    10
    Thanks
    21

    Lightbulb 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);
    }
    Last edited by zmodteam; 10-03-2016 at 11:18 PM.

  2. The Following User Says Thank You to zmodteam For This Useful Post:

    BacLee (10-08-2016)

  3. #2
    malfac009's Avatar
    Join Date
    May 2016
    Gender
    male
    Posts
    68
    Reputation
    10
    Thanks
    15
    My Mood
    Cheeky
    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?

  4. #3
    zmodteam's Avatar
    Join Date
    Jun 2016
    Gender
    male
    Location
    Ho Chi Minh city
    Posts
    28
    Reputation
    10
    Thanks
    21
    Im so sr! I dont help u.

  5. #4
    sobasoba13's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Location
    So Far Away
    Posts
    1,145
    Reputation
    23
    Thanks
    1,607
    My Mood
    Relaxed
    Credits? this hook has been posted tons of times before..
    Crossfire Projects
    Made 21 Feature (Memory Hack)
    Respect List
    @ComboDance
    @mamo007
    @GaaD
    @Olwayy
    @Biesi
    @iSmexy
    @derh.acker
    @Brimir
    @steveroseik
    @Hero
    @Temperrr
    @Rullez
    PressIF I Helped

  6. #5
    Ruins2016's Avatar
    Join Date
    Oct 2016
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0
    C# poba ginawa yan?

  7. #6
    josielcardoso7's Avatar
    Join Date
    Mar 2016
    Gender
    male
    Posts
    31
    Reputation
    10
    Thanks
    3

    Question 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.

  8. #7
    ComboDance's Avatar
    Join Date
    Aug 2013
    Gender
    male
    Location
    C:\Windows\System32
    Posts
    222
    Reputation
    10
    Thanks
    84
    My Mood
    Tired
    Credits present hook to Mae from ramleague and it's detected in some region
    Credits DIP hook from https://www.mpgh.net/forum/showthread.php?t=805223
    Stop right here...!!!

  9. The Following 3 Users Say Thank You to ComboDance For This Useful Post:

    BacLee (10-09-2016),j3team (10-13-2016),zmodteam (10-06-2016)

  10. #8
    BacLee's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    1
    My Mood
    Sleepy
    Tạo giúp ḿnh 1 bản hack cf4vn đc ko thím. nếu đc ḿnh sẽ hậu tạ. tks thím

  11. #9
    zmodteam's Avatar
    Join Date
    Jun 2016
    Gender
    male
    Location
    Ho Chi Minh city
    Posts
    28
    Reputation
    10
    Thanks
    21
    Quote Originally Posted by BacLee View Post
    Tạo giúp ḿnh 1 bản hack cf4vn đc ko thím. nếu đc ḿnh sẽ hậu tạ. tks thím
    Hack thường th́ làm được.. D3D menu cho CF4VN ḿnh ko làm dc nhaz )

  12. #10
    nhanguyen0228's Avatar
    Join Date
    Jul 2016
    Gender
    male
    Posts
    12
    Reputation
    10
    Thanks
    9
    Bác có source D3D Menu Cho CFVTC không cho minh xin code đi

  13. #11
    zmodteam's Avatar
    Join Date
    Jun 2016
    Gender
    male
    Location
    Ho Chi Minh city
    Posts
    28
    Reputation
    10
    Thanks
    21
    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 https://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 )

  14. #12
    BacLee's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    1
    My Mood
    Sleepy
    Quote Originally Posted by zmodteam View Post
    Hack thường th́ làm được.. D3D menu cho CF4VN ḿ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

  15. #13
    mrsimson's Avatar
    Join Date
    Dec 2014
    Gender
    male
    Posts
    18
    Reputation
    10
    Thanks
    2
    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

  16. #14
    Ryuk's Avatar
    Join Date
    Aug 2015
    Gender
    male
    Location
    GB
    Posts
    2,965
    Reputation
    545
    Thanks
    620
    My Mood
    Lurking
    Can you please explain exactly what i need to update if this become's detected?

Similar Threads

  1. [Release] Taste The Rainbow | D3D HOOK | UNDETECTED | INJECTABLE | NEW THREAD (Lazy Mofo)
    By kila58 in forum Garry's Mod Hacks & Cheats
    Replies: 29
    Last Post: 07-28-2013, 01:45 AM
  2. [Release] Undetected Killing Floor D3D Hook 05/12/11
    By ELExTrO in forum Killing Floor Hacks
    Replies: 31
    Last Post: 12-21-2011, 02:12 PM
  3. [Release] Urban WR D3D Hook, Undetected 09 - 04 - 2010
    By turkiyetr in forum WarRock - International Hacks
    Replies: 6
    Last Post: 04-09-2010, 05:08 PM