Source Code Get Direct3d9 and Direct3d11 Devices - Dummy Device Method

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Broihon

edgy 12 y/o
Escobar Tier VIP
Fleep Tier Donator
Dec 22, 2013
1,746
40,528
316
How long you been coding/hacking?
N/A
Background info:

When hacking games with DirectX you need to hook certain member functions of the D3DDevice and know it's address. Many people will use pattern scans to get the address of the functions or the device. This is not a universal method.

The preferred, recommended and best method is to create your own dummy devices, and copy the vtable entries, so you can hook the functions.

Here's how you find pDevice manually: How to find pDevice in DirectX 9 games - Guided Hacking

Here is a general Direct3d guide: How to get started with DirectX 9 - Make your menu hacks! - Guided Hacking

Here is a D3D9 EndScene Hook Template using this code:
https://guidedhacking.com/threads/d3d9-endscene-hook-template-using-dummy-device.14008/

Dummy Device Method
This method is 100x better and universal. You create your own device object, which gets you the vTable address which you can then copy. This is the vTable that is shared by all the device objects. You can now do regular hooks or vTable hooks and they will affect the game's device. You can also get the device's address by hooking these functions and grabbing the "this pointer" out of the eax register.

Here are my functions to copy the vtables of the interfaces for d3d9 and d3d11. Works on x86 and x64 of course.

Direct3d9
C++:
static HWND window;

BOOL CALLBACK EnumWindowsCallback(HWND handle, LPARAM lParam)
{
    DWORD wndProcId;
    GetWindowThreadProcessId(handle, &wndProcId);

    if (GetCurrentProcessId() != wndProcId)
        return TRUE; // skip to next window

    window = handle;
    return FALSE; // window found abort search
}

HWND GetProcessWindow()
{
    window = NULL;
    EnumWindows(EnumWindowsCallback, NULL);
    return window;
}

bool GetD3D9Device(void ** pTable, size_t Size)
{
    if (!pTable)
        return false;

    IDirect3D9 * pD3D = Direct3DCreate9(D3D_SDK_VERSION);

    if (!pD3D)
        return false;

    IDirect3DDevice9 * pDummyDevice = NULL;

    // options to create dummy device
    D3DPRESENT_PARAMETERS d3dpp = {};
    d3dpp.Windowed = false;
    d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
    d3dpp.hDeviceWindow = GetProcessWindow();

    HRESULT dummyDeviceCreated = pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, d3dpp.hDeviceWindow, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &pDummyDevice);

    if (dummyDeviceCreated != S_OK)
    {
        // may fail in windowed fullscreen mode, trying again with windowed mode
        d3dpp.Windowed = !d3dpp.Windowed;

        dummyDeviceCreated = pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, d3dpp.hDeviceWindow, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &pDummyDevice);

        if (dummyDeviceCreated != S_OK)
        {
            pD3D->Release();
            return false;
        }
    }

    memcpy(pTable, *reinterpret_cast<void***>(pDummyDevice), Size);

    pDummyDevice->Release();
    pD3D->Release();
    return true;
}

void * d3d9Device[119];
if (GetD3D9Device(d3d9Device, sizeof(d3d9Device)))
{
    //hook stuff using the dumped addresses
}
Direct3d11
C++:
template <class T>
void SAFE_RELEASE(T * t)
{
    if (t)
    {
        t->Release();
    }
}

bool GetD3D11SwapchainDeviceContext(void ** pSwapchainTable, size_t Size_Swapchain, void ** pDeviceTable, size_t Size_Device, void ** pContextTable, size_t Size_Context)
{
    WNDCLASSEX wc{ 0 };
    wc.cbSize = sizeof(wc);
    wc.lpfnWndProc        = DefWindowProc;
    wc.lpszClassName    = TEXT("dummy class");

    if (!RegisterClassEx(&wc))
    {
        return false;
    }

    HWND hWnd = CreateWindow(wc.lpszClassName, TEXT(""), WS_DISABLED, 0, 0, 0, 0, NULL, NULL, NULL, nullptr);

    DXGI_SWAP_CHAIN_DESC swapChainDesc{ 0 };
    swapChainDesc.BufferCount                    = 1;
    swapChainDesc.BufferDesc.Format                = DXGI_FORMAT_R8G8B8A8_UNORM;
    swapChainDesc.BufferUsage                    = DXGI_USAGE_RENDER_TARGET_OUTPUT;
    swapChainDesc.OutputWindow                    = hWnd;
    swapChainDesc.SampleDesc.Count                = 1;
    swapChainDesc.BufferDesc.ScanlineOrdering    = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED;
    swapChainDesc.BufferDesc.Scaling            = DXGI_MODE_SCALING_UNSPECIFIED;
    swapChainDesc.SwapEffect                    = DXGI_SWAP_EFFECT_DISCARD;
    swapChainDesc.Windowed                        = TRUE;

    D3D_FEATURE_LEVEL featureLevel[] =
    {
        D3D_FEATURE_LEVEL_9_1,
        D3D_FEATURE_LEVEL_9_2,
        D3D_FEATURE_LEVEL_9_3,
        D3D_FEATURE_LEVEL_10_0,
        D3D_FEATURE_LEVEL_10_1,
        D3D_FEATURE_LEVEL_11_0,
        D3D_FEATURE_LEVEL_11_1,
        D3D_FEATURE_LEVEL_12_0,
        D3D_FEATURE_LEVEL_12_1
    };
   
    IDXGISwapChain        * pDummySwapChain    = nullptr;
    ID3D11Device        * pDummyDevice        = nullptr;
    ID3D11DeviceContext * pDummyContext        = nullptr;

    if (FAILED(D3D11CreateDeviceAndSwapChain(nullptr, D3D_DRIVER_TYPE_HARDWARE, NULL, NULL, featureLevel, 1, D3D11_SDK_VERSION, &swapChainDesc, &pDummySwapChain, &pDummyDevice, nullptr, &pDummyContext)))
    {
        DestroyWindow(swapChainDesc.OutputWindow);
        UnregisterClass(wc.lpszClassName, GetModuleHandle(nullptr));

        return false;
    }

    if (pSwapchainTable && pDummySwapChain)
    {
        memcpy(pSwapchainTable, *reinterpret_cast<void***>(pDummySwapChain), Size_Swapchain);
    }

    if (pDeviceTable && pDummyDevice)
    {
        memcpy(pDeviceTable, *reinterpret_cast<void***>(pDummyDevice), Size_Device);
    }

    if (pContextTable && pDummyContext)
    {
        memcpy(pContextTable, *reinterpret_cast<void***>(pDummyContext), Size_Context);
    }

    SAFE_RELEASE(pDummySwapChain);
    SAFE_RELEASE(pDummyDevice);
    SAFE_RELEASE(pDummyContext);

    DestroyWindow(swapChainDesc.OutputWindow);
    UnregisterClass(wc.lpszClassName, GetModuleHandle(nullptr));

    return true;
}

void * SwapChain[18];
void * Device[40];
void * Context[108];

if (GetD3D11SwapchainDeviceContext(SwapChain, sizeof(SwapChain), Device, sizeof(Device), Context, sizeof(Context)))
{
    //hook stuff using the dumped addresses
}
This post was written by Rake but the code is mine
 
Last edited:

Broihon

edgy 12 y/o
Escobar Tier VIP
Fleep Tier Donator
Dec 22, 2013
1,746
40,528
316
Lul, evil rake posted this
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,151
78,998
2,396
evil broihon doesn't make threads with all his dank code, he just sprinkles it throughout the forum where no one can ever find it. good guy rake took his most important code and made a thread for all the nice GH people
 

eduardoroeder

Newbie
Dank Tier Donator
May 2, 2015
30
583
1
Awesome!

Do you guys plan on doing a similar on GDI? It's quite different, but yet useful in some 2d games.
 

Icesythe7

Newbie
Nov 13, 2017
96
928
5
Rebzzel/kiero

^ universal hook for dxd9 - dxd12, opengl, and vulkan

example from his readme

C++:
#include "kiero.h"
#include <d3d9.h>
#include <MinHook.h>
#include <Windows.h>

typedef long(__stdcall* EndScene)(LPDIRECT3DDEVICE);
EndScene oEndScene = NULL;

long __stdcall hkEndScene(LPDIRECT3DDEVICE pDevice)
{
  static bool init = false;
  if (!init)
  {
    MessageBox(0, "Boom! It's works!", "Kiero", MB_OK);
    init = true;
  }

  return oEndScene(pDevice);
}

int kieroExampleThread()
{
  if (kiero::init(kiero::RenderType::D3D9) == kiero::Status::Success)
  {
    kiero::bind(42, oEndScene, hkEndScene);
  }

  return 0;
}

BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID)
{
  DisableThreadLibraryCalls(hInstance);

  switch (fdwReason)
  {
    case DLL_PROCESS_ATTACH:
      CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)kieroExampleThread, NULL, 0, NULL);
      break;
  }

  return TRUE;
}
for anyone that needs stuff other than dx
 
Last edited:

0xDEC0DE

retired
Dank Tier VIP
Fleep Tier Donator
Dank Tier Donator
Oct 28, 2018
449
18,798
90

The OP has been updated to include these changes, this bug is now fixed



C++:
d3dpp.Windowed        = ((GetWindowLong(d3dpp.hDeviceWindow, GWL_STYLE) & WS_POPUP) != 0) ? FALSE : TRUE;;
The Windowed mode detection returns false for Games running in "Windowed Full Screen" which is wrong.

CreateDevice will fail in this case.

The same goes for comparing WindowRect GetForegroundWindow vs GetDesktopWindow.


I could not find a reliable way to determine whether the game is windowed or full screen.

Solution: If CreateDevice fails toggle Windowed and try again.

C++:
HRESULT dummyDeviceCreated = pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, d3dpp.hDeviceWindow, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &pDummyDevice);

if (dummyDeviceCreated != S_OK) {
    // may fail in windowed fullscreen mode
    // trying again with windowed mode
    d3dpp.Windowed = !d3dpp.Windowed;
   
    // call pD3D->CreateDevice...

    // handle result if failed return
}
 
Last edited by a moderator:

Broihon

edgy 12 y/o
Escobar Tier VIP
Fleep Tier Donator
Dec 22, 2013
1,746
40,528
316
C++:
d3dpp.Windowed        = ((GetWindowLong(d3dpp.hDeviceWindow, GWL_STYLE) & WS_POPUP) != 0) ? FALSE : TRUE;;
The Windowed mode detection returns false for Games running in "Windowed Full Screen" which is wrong.

CreateDevice will fail in this case.

The same goes for comparing WindowRect GetForegroundWindow vs GetDesktopWindow.


I could not find a reliable way to determine whether the game is windowed or full screen.

Solution: If CreateDevice fails toggle Windowed and try again.

C++:
HRESULT dummyDeviceCreated = pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, d3dpp.hDeviceWindow, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &pDummyDevice);

if (dummyDeviceCreated != S_OK) {
    // may fail in windowed fullscreen mode
    // trying again with windowed mode
    d3dpp.Windowed = !d3dpp.Windowed;
   
    // call pD3D->CreateDevice...

    // handle result if failed return
}
Probably the best way. Will edit the main post. Thanks!
 

0xDEC0DE

retired
Dank Tier VIP
Fleep Tier Donator
Dank Tier Donator
Oct 28, 2018
449
18,798
90
Anyone who wonders how to get the function address using this method for regular hooks.

C++:
void * d3d9Device[119];
if (GetD3D9Device(d3d9Device, sizeof(d3d9Device)))
{
    // how to work with it ?!
}

Dump the array content of d3d9Device (breakpoints are your friend)

Load up x64dbg go to the symbols tab, click on d3d9.dll -> right click download symbols.

Refresh the tab to view all symbols, look for the function you want to hook.

5715


x64dbg tells us the EndScene function is at 0x6B243C60, compare with the d3d9Device Table dump.

The address is at index 42 e.g. d3d9Device[42]. The index will be the same for all d3d9.dll


C++:
void * d3d9Device[119];
if (GetD3D9Device(d3d9Device, sizeof(d3d9Device)))
{
    DWORD endSceneAddress = d3d9Device[42];
   
    // hook stuff
}
 
  • Like
Reactions: obdr

Broihon

edgy 12 y/o
Escobar Tier VIP
Fleep Tier Donator
Dec 22, 2013
1,746
40,528
316
Anyone who wonders how to get the function address using this method for regular hooks.

C++:
void * d3d9Device[119];
if (GetD3D9Device(d3d9Device, sizeof(d3d9Device)))
{
    // how to work with it ?!
}

Dump the array content of d3d9Device (breakpoints are your friend)

Load up x64dbg go to the symbols tab, click on d3d9.dll -> right click download symbols.

Refresh the tab to view all symbols, look for the function you want to hook.

View attachment 5715

x64dbg tells us the EndScene function is at 0x6B243C60, compare with the d3d9Device Table dump.

The address is at index 42 e.g. d3d9Device[42]. The index will be the same for all d3d9.dll


C++:
void * d3d9Device[119];
if (GetD3D9Device(d3d9Device, sizeof(d3d9Device)))
{
    DWORD endSceneAddress = d3d9Device[42];
  
    // hook stuff
}
That, or just google. Actually, quickly counting the functions in the d3dX header probably is the fastest way tbh.
 

0xDEC0DE

retired
Dank Tier VIP
Fleep Tier Donator
Dank Tier Donator
Oct 28, 2018
449
18,798
90
That, or just google. Actually, quickly counting the functions in the d3dX header probably is the fastest way tbh.
5716


For d3d9 d3d9Device[42] EndScene or d3d9Device[17] Present in d3d9.dll
For d3d11 SwapChain[8] Present in dxgi.dll

Code:
D3D9:
[0]   QueryInterface
[1]   AddRef
[2]   Release
[3]   TestCooperativeLevel
[4]   GetAvailableTextureMem
[5]   EvictManagedResources
[6]   GetDirect3D
[7]   GetDeviceCaps
[8]   GetDisplayMode
[9]   GetCreationParameters
[10]  SetCursorProperties
[11]  SetCursorPosition
[12]  ShowCursor
[13]  CreateAdditionalSwapChain
[14]  GetSwapChain
[15]  GetNumberOfSwapChains
[16]  Reset
[17]  Present
[18]  GetBackBuffer
[19]  GetRasterStatus
[20]  SetDialogBoxMode
[21]  SetGammaRamp
[22]  GetGammaRamp
[23]  CreateTexture
[24]  CreateVolumeTexture
[25]  CreateCubeTexture
[26]  CreateVertexBuffer
[27]  CreateIndexBuffer
[28]  CreateRenderTarget
[29]  CreateDepthStencilSurface
[30]  UpdateSurface
[31]  UpdateTexture
[32]  GetRenderTargetData
[33]  GetFrontBufferData
[34]  StretchRect
[35]  ColorFill
[36]  CreateOffscreenPlainSurface
[37]  SetRenderTarget
[38]  GetRenderTarget
[39]  SetDepthStencilSurface
[40]  GetDepthStencilSurface
[41]  BeginScene
[42]  EndScene
[43]  Clear
[44]  SetTransform
[45]  GetTransform
[46]  MultiplyTransform
[47]  SetViewport
[48]  GetViewport
[49]  SetMaterial
[50]  GetMaterial
[51]  SetLight
[52]  GetLight
[53]  LightEnable
[54]  GetLightEnable
[55]  SetClipPlane
[56]  GetClipPlane
[57]  SetRenderState
[58]  GetRenderState
[59]  CreateStateBlock
[60]  BeginStateBlock
[61]  EndStateBlock
[62]  SetClipStatus
[63]  GetClipStatus
[64]  GetTexture
[65]  SetTexture
[66]  GetTextureStageState
[67]  SetTextureStageState
[68]  GetSamplerState
[69]  SetSamplerState
[70]  ValidateDevice
[71]  SetPaletteEntries
[72]  GetPaletteEntries
[73]  SetCurrentTexturePalette
[74]  GetCurrentTexturePalette
[75]  SetScissorRect
[76]  GetScissorRect
[77]  SetSoftwareVertexProcessing
[78]  GetSoftwareVertexProcessing
[79]  SetNPatchMode
[80]  GetNPatchMode
[81]  DrawPrimitive
[82]  DrawIndexedPrimitive
[83]  DrawPrimitiveUP
[84]  DrawIndexedPrimitiveUP
[85]  ProcessVertices
[86]  CreateVertexDeclaration
[87]  SetVertexDeclaration
[88]  GetVertexDeclaration
[89]  SetFVF
[90]  GetFVF
[91]  CreateVertexShader
[92]  SetVertexShader
[93]  GetVertexShader
[94]  SetVertexShaderConstantF
[95]  GetVertexShaderConstantF
[96]  SetVertexShaderConstantI
[97]  GetVertexShaderConstantI
[98]  SetVertexShaderConstantB
[99]  GetVertexShaderConstantB
[100] SetStreamSource
[101] GetStreamSource
[102] SetStreamSourceFreq
[103] GetStreamSourceFreq
[104] SetIndices
[105] GetIndices
[106] CreatePixelShader
[107] SetPixelShader
[108] GetPixelShader
[109] SetPixelShaderConstantF
[110] GetPixelShaderConstantF
[111] SetPixelShaderConstantI
[112] GetPixelShaderConstantI
[113] SetPixelShaderConstantB
[114] GetPixelShaderConstantB
[115] DrawRectPatch
[116] DrawTriPatch
[117] DeletePatch
[118] CreateQuery

D3D11:
[0]   QueryInterface
[1]   AddRef
[2]   Release
[3]   SetPrivateData
[4]   SetPrivateDataInterface
[5]   GetPrivateData
[6]   GetParent
[7]   GetDevice
[8]   Present
[9]   GetBuffer
[10]  SetFullscreenState
[11]  GetFullscreenState
[12]  GetDesc
[13]  ResizeBuffers
[14]  ResizeTarget
[15]  GetContainingOutput
[16]  GetFrameStatistics
[17]  GetLastPresentCount
[18]  QueryInterface
[19]  AddRef
[20]  Release
[21]  CreateBuffer
[22]  CreateTexture1D
[23]  CreateTexture2D
[24]  CreateTexture3D
[25]  CreateShaderResourceView
[26]  CreateUnorderedAccessView
[27]  CreateRenderTargetView
[28]  CreateDepthStencilView
[29]  CreateInputLayout
[30]  CreateVertexShader
[31]  CreateGeometryShader
[32]  CreateGeometryShaderWithStreamOutput
[33]  CreatePixelShader
[34]  CreateHullShader
[35]  CreateDomainShader
[36]  CreateComputeShader
[37]  CreateClassLinkage
[38]  CreateBlendState
[39]  CreateDepthStencilState
[40]  CreateRasterizerState
[41]  CreateSamplerState
[42]  CreateQuery
[43]  CreatePredicate
[44]  CreateCounter
[45]  CreateDeferredContext
[46]  OpenSharedResource
[47]  CheckFormatSupport
[48]  CheckMultisampleQualityLevels
[49]  CheckCounterInfo
[50]  CheckCounter
[51]  CheckFeatureSupport
[52]  GetPrivateData
[53]  SetPrivateData
[54]  SetPrivateDataInterface
[55]  GetFeatureLevel
[56]  GetCreationFlags
[57]  GetDeviceRemovedReason
[58]  GetImmediateContext
[59]  SetExceptionMode
[60]  GetExceptionMode
[61]  QueryInterface
[62]  AddRef
[63]  Release
[64]  GetDevice
[65]  GetPrivateData
[66]  SetPrivateData
[67]  SetPrivateDataInterface
[68]  SetConstantBuffers
[69]  SetShaderResources
[70]  SetShader
[71]  SetSamplers
[72]  SetShader
[73]  DrawIndexed
[74]  Draw
[75]  Map
[76]  Unmap
[77]  SetConstantBuffers
[78]  IASetInputLayout
[79]  IASetVertexBuffers
[80]  IASetIndexBuffer
[81]  DrawIndexedInstanced
[82]  DrawInstanced
[83]  SetConstantBuffers
[84]  SetShader
[85]  IASetPrimitiveTopology
[86]  SetShaderResources
[87]  SetSamplers
[88]  Begin
[89]  End
[90]  GetData
[91]  SetPredication
[92]  SetShaderResources
[93]  SetSamplers
[94]  OMSetRenderTargets
[95]  OMSetRenderTargetsAndUnorderedAccessViews
[96]  OMSetBlendState
[97]  OMSetDepthStencilState
[98]  SOSetTargets
[99]  DrawAuto
[100] DrawIndexedInstancedIndirect
[101] DrawInstancedIndirect
[102] Dispatch
[103] DispatchIndirect
[104] RSSetState
[105] RSSetViewports
[106] RSSetScissorRects
[107] CopySubresourceRegion
[108] CopyResource
[109] UpdateSubresource
[110] CopyStructureCount
[111] ClearRenderTargetView
[112] ClearUnorderedAccessViewUint
[113] ClearUnorderedAccessViewFloat
[114] ClearDepthStencilView
[115] GenerateMips
[116] SetResourceMinLOD
[117] GetResourceMinLOD
[118] ResolveSubresource
[119] ExecuteCommandList
[120] SetShaderResources
[121] SetShader
[122] SetSamplers
[123] SetConstantBuffers
[124] SetShaderResources
[125] SetShader
[126] SetSamplers
[127] SetConstantBuffers
[128] SetShaderResources
[129] CSSetUnorderedAccessViews
[130] SetShader
[131] SetSamplers
[132] SetConstantBuffers
[133] VSGetConstantBuffers
[134] PSGetShaderResources
[135] PSGetShader
[136] PSGetSamplers
[137] VSGetShader
[138] PSGetConstantBuffers
[139] IAGetInputLayout
[140] IAGetVertexBuffers
[141] IAGetIndexBuffer
[142] GSGetConstantBuffers
[143] GSGetShader
[144] IAGetPrimitiveTopology
[145] VSGetShaderResources
[146] VSGetSamplers
[147] GetPredication
[148] GSGetShaderResources
[149] GSGetSamplers
[150] OMGetRenderTargets
[151] OMGetRenderTargetsAndUnorderedAccessViews
[152] OMGetBlendState
[153] OMGetDepthStencilState
[154] SOGetTargets
[155] RSGetState
[156] RSGetViewports
[157] RSGetScissorRects
[158] HSGetShaderResources
[159] HSGetShader
[160] HSGetSamplers
[161] HSGetConstantBuffers
[162] DSGetShaderResources
[163] DSGetShader
[164] DSGetSamplers
[165] DSGetConstantBuffers
[166] CSGetShaderResources
[167] CSGetUnorderedAccessViews
[168] CSGetShader
[169] CSGetSamplers
[170] CSGetConstantBuffers
[171] ClearState
[172] Flush
[173] GetType
[174] GetContextFlags
[175] FinishCommandList
[176] CopySubresourceRegion1
[177] UpdateSubresource1
[178] DiscardResource
[179] DiscardView
[180] SetConstantBuffers1
[181] SetConstantBuffers1
[182] SetConstantBuffers1
[183] SetConstantBuffers1
[184] SetConstantBuffers1
[185] SetConstantBuffers1
[186] VSGetConstantBuffers1
[187] HSGetConstantBuffers1
[188] DSGetConstantBuffers1
[189] GSGetConstantBuffers1
[190] PSGetConstantBuffers1
[191] CSGetConstantBuffers1
[192] SwapDeviceContextState
[193] ClearView
[194] DiscardView1
[195] UpdateTileMappings
[196] CopyTileMappings
[197] CopyTiles
[198] UpdateTiles
[199] ResizeTilePool
[200] TiledResourceBarrier
[201] IsAnnotationEnabled
[202] SetMarkerInt
[203] BeginEventInt
[204] EndEvent

D3D12:
[0]   QueryInterface
[1]   AddRef
[2]   Release
[3]   GetPrivateData
[4]   SetPrivateData
[5]   SetPrivateDataInterface
[6]   SetName
[7]   GetNodeCount
[8]   CreateCommandQueue
[9]   CreateCommandAllocator
[10]  CreateGraphicsPipelineState
[11]  CreateComputePipelineState
[12]  CreateCommandList
[13]  CheckFeatureSupport
[14]  CreateDescriptorHeap
[15]  GetDescriptorHandleIncrementSize
[16]  CreateRootSignature
[17]  CreateConstantBufferView
[18]  CreateShaderResourceView
[19]  CreateUnorderedAccessView
[20]  CreateRenderTargetView
[21]  CreateDepthStencilView
[22]  CreateSampler
[23]  CopyDescriptors
[24]  CopyDescriptorsSimple
[25]  GetResourceAllocationInfo
[26]  GetCustomHeapProperties
[27]  CreateCommittedResource
[28]  CreateHeap
[29]  CreatePlacedResource
[30]  CreateReservedResource
[31]  CreateSharedHandle
[32]  OpenSharedHandle
[33]  OpenSharedHandleByName
[34]  MakeResident
[35]  Evict
[36]  CreateFence
[37]  GetDeviceRemovedReason
[38]  GetCopyableFootprints
[39]  CreateQueryHeap
[40]  SetStablePowerState
[41]  CreateCommandSignature
[42]  GetResourceTiling
[43]  GetAdapterLuid
[44]  QueryInterface
[45]  AddRef
[46]  Release
[47]  GetPrivateData
[48]  SetPrivateData
[49]  SetPrivateDataInterface
[50]  SetName
[51]  GetDevice
[52]  UpdateTileMappings
[53]  CopyTileMappings
[54]  ExecuteCommandLists
[55]  SetMarker
[56]  BeginEvent
[57]  EndEvent
[58]  Signal
[59]  Wait
[60]  GetTimestampFrequency
[61]  GetClockCalibration
[62]  GetDesc
[63]  QueryInterface
[64]  AddRef
[65]  Release
[66]  GetPrivateData
[67]  SetPrivateData
[68]  SetPrivateDataInterface
[69]  SetName
[70]  GetDevice
[71]  Reset
[72]  QueryInterface
[73]  AddRef
[74]  Release
[75]  GetPrivateData
[76]  SetPrivateData
[77]  SetPrivateDataInterface
[78]  SetName
[79]  GetDevice
[80]  GetType
[81]  Close
[82]  Reset
[83]  ClearState
[84]  DrawInstanced
[85]  DrawIndexedInstanced
[86]  Dispatch
[87]  CopyBufferRegion
[88]  CopyTextureRegion
[89]  CopyResource
[90]  CopyTiles
[91]  ResolveSubresource
[92]  IASetPrimitiveTopology
[93]  RSSetViewports
[94]  RSSetScissorRects
[95]  OMSetBlendFactor
[96]  OMSetStencilRef
[97]  SetPipelineState
[98]  ResourceBarrier
[99]  ExecuteBundle
[100] SetDescriptorHeaps
[101] SetComputeRootSignature
[102] SetGraphicsRootSignature
[103] SetComputeRootDescriptorTable
[104] SetGraphicsRootDescriptorTable
[105] SetComputeRoot32BitConstant
[106] SetGraphicsRoot32BitConstant
[107] SetComputeRoot32BitConstants
[108] SetGraphicsRoot32BitConstants
[109] SetComputeRootConstantBufferView
[110] SetGraphicsRootConstantBufferView
[111] SetComputeRootShaderResourceView
[112] SetGraphicsRootShaderResourceView
[113] SetComputeRootUnorderedAccessView
[114] SetGraphicsRootUnorderedAccessView
[115] IASetIndexBuffer
[116] IASetVertexBuffers
[117] SOSetTargets
[118] OMSetRenderTargets
[119] ClearDepthStencilView
[120] ClearRenderTargetView
[121] ClearUnorderedAccessViewUint
[122] ClearUnorderedAccessViewFloat
[123] DiscardResource
[124] BeginQuery
[125] EndQuery
[126] ResolveQueryData
[127] SetPredication
[128] SetMarker
[129] BeginEvent
[130] EndEvent
[131] ExecuteIndirect
[132] QueryInterface
[133] AddRef
[134] Release
[135] SetPrivateData
[136] SetPrivateDataInterface
[137] GetPrivateData
[138] GetParent
[139] GetDevice
[140] Present
[141] GetBuffer
[142] SetFullscreenState
[143] GetFullscreenState
[144] GetDesc
[145] ResizeBuffers
[146] ResizeTarget
[147] GetContainingOutput
[148] GetFrameStatistics
[149] GetLastPresentCount
 
Last edited:
  • Like
Reactions: Rake and Broihon
Apr 24, 2018
4
34
0
Yo the Direct3d9 Hook won't work for me? I am testing it on csgo and "dummyDeviceCreated" is always "D3DERR_INVALIDCALL"?
I tried in window / fullscreen.

tY
 

0xDEC0DE

retired
Dank Tier VIP
Fleep Tier Donator
Dank Tier Donator
Oct 28, 2018
449
18,798
90
Yo the Direct3d9 Hook won't work for me? I am testing it on csgo and "dummyDeviceCreated" is always "D3DERR_INVALIDCALL"?
I tried in window / fullscreen.

tY
Are you allocating a debug console ? AllocConsole()

If yes try without it or allocate the console after the hook.
 

0xDEC0DE

retired
Dank Tier VIP
Fleep Tier Donator
Dank Tier Donator
Oct 28, 2018
449
18,798
90
i only got invalid_call when the window handle was wrong.

please check if the window handle d3dpp.hDeviceWindow is not NULL/0

the problem can happen when:
- another window got created for example AllocConsole() and GetProcessWindow() returns the wrong handle
- the main window hasnt been created yet, window handle will be 0, hook happened to early just sleep some time

did you change the arguments for CreateDevice() ?
 
  • Like
Reactions: Rake
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods