Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bigbrobro/0b9e476be9f9ca36797da5086a115286 to your computer and use it in GitHub Desktop.
Save bigbrobro/0b9e476be9f9ca36797da5086a115286 to your computer and use it in GitHub Desktop.
d3d10_1.dll DLL proxying
#pragma comment(linker,"/export:D3D10CompileEffectFromMemory=d3d10_1_orig.D3D10CompileEffectFromMemory,@1")
#pragma comment(linker,"/export:D3D10CompileShader=d3d10_1_orig.D3D10CompileShader,@2")
#pragma comment(linker,"/export:D3D10CreateBlob=d3d10_1_orig.D3D10CreateBlob,@3")
#pragma comment(linker,"/export:D3D10CreateDevice1=d3d10_1_orig.D3D10CreateDevice1,@4")
#pragma comment(linker,"/export:D3D10CreateDeviceAndSwapChain1=d3d10_1_orig.D3D10CreateDeviceAndSwapChain1,@5")
#pragma comment(linker,"/export:D3D10CreateEffectFromMemory=d3d10_1_orig.D3D10CreateEffectFromMemory,@6")
#pragma comment(linker,"/export:D3D10CreateEffectPoolFromMemory=d3d10_1_orig.D3D10CreateEffectPoolFromMemory,@7")
#pragma comment(linker,"/export:D3D10CreateStateBlock=d3d10_1_orig.D3D10CreateStateBlock,@8")
#pragma comment(linker,"/export:D3D10DisassembleEffect=d3d10_1_orig.D3D10DisassembleEffect,@9")
#pragma comment(linker,"/export:D3D10DisassembleShader=d3d10_1_orig.D3D10DisassembleShader,@10")
#pragma comment(linker,"/export:D3D10GetGeometryShaderProfile=d3d10_1_orig.D3D10GetGeometryShaderProfile,@11")
#pragma comment(linker,"/export:D3D10GetInputAndOutputSignatureBlob=d3d10_1_orig.D3D10GetInputAndOutputSignatureBlob,@12")
#pragma comment(linker,"/export:D3D10GetInputSignatureBlob=d3d10_1_orig.D3D10GetInputSignatureBlob,@13")
#pragma comment(linker,"/export:D3D10GetOutputSignatureBlob=d3d10_1_orig.D3D10GetOutputSignatureBlob,@14")
#pragma comment(linker,"/export:D3D10GetPixelShaderProfile=d3d10_1_orig.D3D10GetPixelShaderProfile,@15")
#pragma comment(linker,"/export:D3D10GetShaderDebugInfo=d3d10_1_orig.D3D10GetShaderDebugInfo,@16")
#pragma comment(linker,"/export:D3D10GetVersion=d3d10_1_orig.D3D10GetVersion,@17")
#pragma comment(linker,"/export:D3D10GetVertexShaderProfile=d3d10_1_orig.D3D10GetVertexShaderProfile,@18")
#pragma comment(linker,"/export:D3D10PreprocessShader=d3d10_1_orig.D3D10PreprocessShader,@19")
#pragma comment(linker,"/export:D3D10ReflectShader=d3d10_1_orig.D3D10ReflectShader,@20")
#pragma comment(linker,"/export:D3D10RegisterLayers=d3d10_1_orig.D3D10RegisterLayers,@21")
#pragma comment(linker,"/export:D3D10StateBlockMaskDifference=d3d10_1_orig.D3D10StateBlockMaskDifference,@22")
#pragma comment(linker,"/export:D3D10StateBlockMaskDisableAll=d3d10_1_orig.D3D10StateBlockMaskDisableAll,@23")
#pragma comment(linker,"/export:D3D10StateBlockMaskDisableCapture=d3d10_1_orig.D3D10StateBlockMaskDisableCapture,@24")
#pragma comment(linker,"/export:D3D10StateBlockMaskEnableAll=d3d10_1_orig.D3D10StateBlockMaskEnableAll,@25")
#pragma comment(linker,"/export:D3D10StateBlockMaskEnableCapture=d3d10_1_orig.D3D10StateBlockMaskEnableCapture,@26")
#pragma comment(linker,"/export:D3D10StateBlockMaskGetSetting=d3d10_1_orig.D3D10StateBlockMaskGetSetting,@27")
#pragma comment(linker,"/export:D3D10StateBlockMaskIntersect=d3d10_1_orig.D3D10StateBlockMaskIntersect,@28")
#pragma comment(linker,"/export:D3D10StateBlockMaskUnion=d3d10_1_orig.D3D10StateBlockMaskUnion,@29")
#include <stdio.h>
#include <stdlib.h>
#include <Windows.h>
#include <WinUser.h>
using namespace std;
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
{
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
MessageBoxA(NULL, "Proxy_Hijacking", NULL, NULL);
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment