首页
社区
课程
招聘
[求助]dxdhook求指路
发表于: 2016-12-9 07:07 4964

[求助]dxdhook求指路

2016-12-9 07:07
4964
游戏用的是d3d11 64位,现成的hook教程都是d3d9版本的.
如果想hook成功得从头学d3d11还是怎么样?
注:我是小白,之前没接触过d3d编程也没hook过

[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!

收藏
免费 0
支持
分享
最新回复 (3)
雪    币: 12848
活跃值: (9142)
能力值: ( LV9,RANK:280 )
在线值:
发帖
回帖
粉丝
2
和DX9大同小异啊,无非是虚函数表不一样了而已

HRESULT WINAPI NewD3D11CreateDeviceAndSwapChain(
	_In_opt_        IDXGIAdapter         *pAdapter,
	D3D_DRIVER_TYPE      DriverType,
	HMODULE              Software,
	UINT                 Flags,
	_In_opt_  const D3D_FEATURE_LEVEL    *pFeatureLevels,
	UINT                 FeatureLevels,
	UINT                 SDKVersion,
	_In_opt_  const DXGI_SWAP_CHAIN_DESC *pSwapChainDesc,
	_Out_opt_       IDXGISwapChain       **ppSwapChain,
	_Out_opt_       ID3D11Device         **ppDevice,
	_Out_opt_       D3D_FEATURE_LEVEL    *pFeatureLevel,
	_Out_opt_       ID3D11DeviceContext  **ppImmediateContext
	)
{
	HRESULT res = m_pfnD3D11CreateDeviceAndSwapChain(pAdapter, DriverType, Software, Flags, pFeatureLevels, FeatureLevels, SDKVersion, pSwapChainDesc, ppSwapChain, ppDevice, pFeatureLevel, ppImmediateContext);

	if (res == S_OK)
	{
		if (*ppImmediateContext)
		{
			m_pDeviceContext = *ppImmediateContext;
		}
//在这儿搞事
	}

	return res;
}

int WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
{
	if (fdwReason == DLL_PROCESS_ATTACH)
	{
		HMODULE hD3D11 = LoadLibrary(L"c:\\Windows\\System32\\d3d11.dll");
		if (hD3D11)
		{
			m_pfnD3D11CreateDeviceAndSwapChain = (fnD3D11CreateDeviceAndSwapChain)GetProcAddress(hD3D11, "D3D11CreateDeviceAndSwapChain");
			if (m_pfnD3D11CreateDeviceAndSwapChain)
			{
				DetourTransactionBegin();
				DetourAttach(&(void *&)m_pfnD3D11CreateDeviceAndSwapChain, NewD3D11CreateDeviceAndSwapChain);
				DetourTransactionCommit();
			}
		}
	}
	return TRUE;
}
2016-12-9 15:12
0
雪    币: 6
活跃值: (26)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
懂了,意思就是现在学dx9 hook就行,然后dx11 hook 也自然会了
2016-12-9 20:27
0
雪    币: 96
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
网上找源码,3天搞定,赶紧的
2016-12-13 02:42
0
游客
登录 | 注册 方可回帖
返回
//