Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Coding Releases > Coding Snippets
You last visited: Today at 13:04

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[DXGI] D3D Hook - Direct Hijack window

Discussion on [DXGI] D3D Hook - Direct Hijack window within the Coding Snippets forum part of the Coding Releases category.

Reply
 
Old   #1


 
MRx86™'s Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 1,452
Received Thanks: 2,575
[DXGI] D3D Hook - Direct Hijack window

Hi Folkz.

Based to my prev hook for d3d 8/9 released 10 years ago.

Thread : https://www.elitepvpers.com/forum/co...-internal.html

this was just tested on Fortnite, but for sure will work for any process that load DXGI

sorry for low effort codenz, nowdays very lazy :coolmaninthetoilet:

You know what, my lazy ass, you need to do pattern for various os. for the offset. this was just tested into windows 10 22H2 , and no idea if offset changes in others winver


Jobs:
Intercept memset from DXGI and wait for exactly returnaddress, of the follow function exactly in this case D3D Present. + Swap Chain from stack memset stack :sadwavey:





Code:
ID3D11Device       * Device = nullptr;
ID3D11DeviceContext* pContext = NULL;
IDXGISwapChain     * pSwapChain;
static uintptr_t hReturnAddress = NULL;


#define IatHook(A,O,N) \
	  if ( *(DWORD64*)(A) && *(DWORD64*)(A) != (DWORD64)(&N) )  { \
			*(DWORD64*)(&O) = *(DWORD64*)(A); \
			*(DWORD64*)(A) = (DWORD64)(&N); \
       }


void* (__cdecl* omemset) (void* str, int c, size_t n);

void* __cdecl nmemset ( void* str, int c, size_t n )
{
	if ( _ReturnAddress() == (void*)hReturnAddress )
	{
		pSwapChain = (IDXGISwapChain*)*(DWORD64*)str;
		if (pSwapChain)
		{
			if (!Device)
			{
				pSwapChain->GetDevice(__uuidof(Device), (void**)&Device);
				Device->GetImmediateContext(&pContext);
				add_log("", "pDevice %p pContext %p", Device, pContext);
			}


		}
	}
	return omemset(str, c, n);
}

void InitializeHook()
{

	uintptr_t hModule = GetModuleHandleW(L"dxgi.dll");


	add_log("", "dxgi.dll %p", hModule);

	hReturnAddress = (hModule+0x1678);


	add_log("", "hReturnAddress.dll %p", hReturnAddress);
	
	DWORD dwMemsetFlag;
	VirtualProtect((void*)(hModule+0x9EEC0),8,PAGE_READWRITE,&dwMemsetFlag);  //VirtualProtect Needed due to page protection
	IatHook((hModule+0x9EEC0), omemset, nmemset);
	VirtualProtect((void*)(hModule+0x9EEC0),8,dwMemsetFlag,&dwMemsetFlag);
}

just a few precautions need to be taken when swap memset, make sure you point it into a legit module if you are internal

MRx86™ is offline  
Old 04/27/2024, 00:45   #2
 
elite*gold: 0
Join Date: Sep 2023
Posts: 117
Received Thanks: 15
this is better posted on the other forum that i cant name here or else mods will take this post down
yuhg232 is offline  
Old 04/27/2024, 00:55   #3


 
MRx86™'s Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 1,452
Received Thanks: 2,575
Quote:
Originally Posted by yuhg232 View Post
this is better posted on the other forum that i cant name here or else mods will take this post down
maybe its still me ? on others forum with different Alias ? where did you brain went
MRx86™ is offline  
Old 04/27/2024, 02:12   #4


 
Toxic.dll's Avatar
 
elite*gold: 100
Join Date: May 2020
Posts: 1,376
Received Thanks: 326
Nice post but wrong forum
At last do on coding zone
Toxic.dll is offline  
Old 04/27/2024, 08:17   #5


 
MRx86™'s Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 1,452
Received Thanks: 2,575
Quote:
Originally Posted by Toxic.dll View Post
Nice post but wrong forum
At last do on coding zone
Hi thanks.

Self report to move into code section
MRx86™ is offline  
Thanks
1 User
Old 04/29/2024, 20:45   #6
harder, better, faster




 
Gipha's Avatar
 
elite*gold: 18
The Black Market: 190/0/0
Join Date: Sep 2009
Posts: 4,886
Received Thanks: 787
Arrow Valorant -> Coding Snippets

#moved
Gipha is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[DXGI] D3D Hook - Direct Hijack window
04/26/2024 - Fortnite - 0 Replies
Hi Folkz. Based to my prev hook for d3d 8/9 released 10 years ago. Thread : https://www.elitepvpers.com/forum/coding-snippets/ 3771690-d3d-hook-internal.html this was just tested on Fortnite, but for sure will work for any process that load DXGI sorry for low effort codenz, nowdays very lazy :coolmaninthetoilet:
Black ops 2 Pc dxgi.dll missing hilfee
09/15/2013 - Call of Duty - 4 Replies
Hallo ich habe heute black ops 2 installiert wollte es starten dann kamm das eine dll fehlt hab ich sie gedownloadet und reingetan dann stand da das :real dxgi.dll missing hat jemand vielleicht ne antwort ? oder kann mir jemand damit helfen?
Black Ops 2 PC "dxgi.dll!CreateDXGIFactory1" error
02/17/2013 - Call of Duty - 15 Replies
Hallo, habe vor ein paar Stunden BO2 fertig geladen und wollte es Starten...doch nun bekomme ich diese fehlermedlung* "" Problemsignatur: Problemereignisname: APPCRASH Anwendungsname: t6mp.exe Anwendungsversion: 1.0.0.1 Anwendungszeitstempel: 509a7625 Fehlermodulname: dxgi.dll!CreateDXGIFactory1 Fehlermodulversion: 6.0.6002.18327 Fehlermodulzeitstempel: 4cb73436



All times are GMT +2. The time now is 13:04.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.