能力值:
( 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;
}
|
能力值:
( LV2,RANK:10 )
|
-
-
3 楼
懂了,意思就是现在学dx9 hook就行,然后dx11 hook 也自然会了
|
能力值:
( LV2,RANK:10 )
|
-
-
4 楼
网上找源码,3天搞定,赶紧的
|
|
|