首页
社区
课程
招聘
[求助]Hook DirectX D3D9游戏画面写字画图
发表于: 2013-8-31 19:54 21426

[求助]Hook DirectX D3D9游戏画面写字画图

2013-8-31 19:54
21426
Hook DirectX  D3D9游戏画面写字画图
有会这方面付费找人做个源码联系Q:四三5二二二四

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (17)
雪    币: 182
活跃值: (12)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
你可以试一试TextOut,呵呵效果没有Hook的好,不过可以勉强用用
2013-8-31 22:04
0
雪    币: 238
活跃值: (375)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
只是HOOK D3D 画2个字..画几个图...几分钟的事吧..

自行搜索一下.网上不少源码的.
2013-9-1 07:11
0
雪    币: 65
活跃值: (60)
能力值: ( LV3,RANK:30 )
在线值:
发帖
回帖
粉丝
4
这个对楼主可能有帮助,HOOK 虚函数表就可以了,COM 什么的…………






上传的附件:
2013-9-1 07:49
0
雪    币: 114
活跃值: (180)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
楼上这是什么插件?这么萌...
2013-9-1 08:21
0
雪    币: 208
活跃值: (40)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
6
4楼的兄弟,直接给一个text的table吧,图片怎么搞啊。
另外,再请教一下,这些数据怎么得到的?
2013-9-1 09:21
0
雪    币: 65
活跃值: (60)
能力值: ( LV3,RANK:30 )
在线值:
发帖
回帖
粉丝
7
当然是 DXSDK 里面的啦,对于 DX 这种单接口的东西,就是一个 C++ 类,然后里面的方法都是虚的,你调试过 C++ 写的程序就应该能明白!!

struct IDirect3DDevice9_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnTestCooperativeLevel;                   // Index:0x0003(0003.) Offset:0x000C
    void *  lpfnGetAvailableTextureMem;                 // Index:0x0004(0004.) Offset:0x0010
    void *  lpfnEvictManagedResources;                  // Index:0x0005(0005.) Offset:0x0014
    void *  lpfnGetDirect3D;                            // Index:0x0006(0006.) Offset:0x0018
    void *  lpfnGetDeviceCaps;                          // Index:0x0007(0007.) Offset:0x001C
    void *  lpfnGetDisplayMode;                         // Index:0x0008(0008.) Offset:0x0020
    void *  lpfnGetCreationParameters;                  // Index:0x0009(0009.) Offset:0x0024
    void *  lpfnSetCursorProperties;                    // Index:0x000A(0010.) Offset:0x0028
    void *  lpfnSetCursorPosition;                      // Index:0x000B(0011.) Offset:0x002C
    void *  lpfnShowCursor;                             // Index:0x000C(0012.) Offset:0x0030
    void *  lpfnCreateAdditionalSwapChain;              // Index:0x000D(0013.) Offset:0x0034
    void *  lpfnGetSwapChain;                           // Index:0x000E(0014.) Offset:0x0038
    void *  lpfnGetNumberOfSwapChains;                  // Index:0x000F(0015.) Offset:0x003C
    void *  lpfnReset;                                  // Index:0x0010(0016.) Offset:0x0040
    void *  lpfnPresent;                                // Index:0x0011(0017.) Offset:0x0044
    void *  lpfnGetBackBuffer;                          // Index:0x0012(0018.) Offset:0x0048
    void *  lpfnGetRasterStatus;                        // Index:0x0013(0019.) Offset:0x004C
    void *  lpfnSetDialogBoxMode;                       // Index:0x0014(0020.) Offset:0x0050
    void *  lpfnSetGammaRamp;                           // Index:0x0015(0021.) Offset:0x0054
    void *  lpfnGetGammaRamp;                           // Index:0x0016(0022.) Offset:0x0058
    void *  lpfnCreateTexture;                          // Index:0x0017(0023.) Offset:0x005C
    void *  lpfnCreateVolumeTexture;                    // Index:0x0018(0024.) Offset:0x0060
    void *  lpfnCreateCubeTexture;                      // Index:0x0019(0025.) Offset:0x0064
    void *  lpfnCreateVertexBuffer;                     // Index:0x001A(0026.) Offset:0x0068
    void *  lpfnCreateIndexBuffer;                      // Index:0x001B(0027.) Offset:0x006C
    void *  lpfnCreateRenderTarget;                     // Index:0x001C(0028.) Offset:0x0070
    void *  lpfnCreateDepthStencilSurface;              // Index:0x001D(0029.) Offset:0x0074
    void *  lpfnUpdateSurface;                          // Index:0x001E(0030.) Offset:0x0078
    void *  lpfnUpdateTexture;                          // Index:0x001F(0031.) Offset:0x007C
    void *  lpfnGetRenderTargetData;                    // Index:0x0020(0032.) Offset:0x0080
    void *  lpfnGetFrontBufferData;                     // Index:0x0021(0033.) Offset:0x0084
    void *  lpfnStretchRect;                            // Index:0x0022(0034.) Offset:0x0088
    void *  lpfnColorFill;                              // Index:0x0023(0035.) Offset:0x008C
    void *  lpfnCreateOffscreenPlainSurface;            // Index:0x0024(0036.) Offset:0x0090
    void *  lpfnSetRenderTarget;                        // Index:0x0025(0037.) Offset:0x0094
    void *  lpfnGetRenderTarget;                        // Index:0x0026(0038.) Offset:0x0098
    void *  lpfnSetDepthStencilSurface;                 // Index:0x0027(0039.) Offset:0x009C
    void *  lpfnGetDepthStencilSurface;                 // Index:0x0028(0040.) Offset:0x00A0
    void *  lpfnBeginScene;                             // Index:0x0029(0041.) Offset:0x00A4
    void *  lpfnEndScene;                               // Index:0x002A(0042.) Offset:0x00A8
    void *  lpfnClear;                                  // Index:0x002B(0043.) Offset:0x00AC
    void *  lpfnSetTransform;                           // Index:0x002C(0044.) Offset:0x00B0
    void *  lpfnGetTransform;                           // Index:0x002D(0045.) Offset:0x00B4
    void *  lpfnMultiplyTransform;                      // Index:0x002E(0046.) Offset:0x00B8
    void *  lpfnSetViewport;                            // Index:0x002F(0047.) Offset:0x00BC
    void *  lpfnGetViewport;                            // Index:0x0030(0048.) Offset:0x00C0
    void *  lpfnSetMaterial;                            // Index:0x0031(0049.) Offset:0x00C4
    void *  lpfnGetMaterial;                            // Index:0x0032(0050.) Offset:0x00C8
    void *  lpfnSetLight;                               // Index:0x0033(0051.) Offset:0x00CC
    void *  lpfnGetLight;                               // Index:0x0034(0052.) Offset:0x00D0
    void *  lpfnLightEnable;                            // Index:0x0035(0053.) Offset:0x00D4
    void *  lpfnGetLightEnable;                         // Index:0x0036(0054.) Offset:0x00D8
    void *  lpfnSetClipPlane;                           // Index:0x0037(0055.) Offset:0x00DC
    void *  lpfnGetClipPlane;                           // Index:0x0038(0056.) Offset:0x00E0
    void *  lpfnSetRenderState;                         // Index:0x0039(0057.) Offset:0x00E4
    void *  lpfnGetRenderState;                         // Index:0x003A(0058.) Offset:0x00E8
    void *  lpfnCreateStateBlock;                       // Index:0x003B(0059.) Offset:0x00EC
    void *  lpfnBeginStateBlock;                        // Index:0x003C(0060.) Offset:0x00F0
    void *  lpfnEndStateBlock;                          // Index:0x003D(0061.) Offset:0x00F4
    void *  lpfnSetClipStatus;                          // Index:0x003E(0062.) Offset:0x00F8
    void *  lpfnGetClipStatus;                          // Index:0x003F(0063.) Offset:0x00FC
    void *  lpfnGetTexture;                             // Index:0x0040(0064.) Offset:0x0100
    void *  lpfnSetTexture;                             // Index:0x0041(0065.) Offset:0x0104
    void *  lpfnGetTextureStageState;                   // Index:0x0042(0066.) Offset:0x0108
    void *  lpfnSetTextureStageState;                   // Index:0x0043(0067.) Offset:0x010C
    void *  lpfnGetSamplerState;                        // Index:0x0044(0068.) Offset:0x0110
    void *  lpfnSetSamplerState;                        // Index:0x0045(0069.) Offset:0x0114
    void *  lpfnValidateDevice;                         // Index:0x0046(0070.) Offset:0x0118
    void *  lpfnSetPaletteEntries;                      // Index:0x0047(0071.) Offset:0x011C
    void *  lpfnGetPaletteEntries;                      // Index:0x0048(0072.) Offset:0x0120
    void *  lpfnSetCurrentTexturePalette;               // Index:0x0049(0073.) Offset:0x0124
    void *  lpfnGetCurrentTexturePalette;               // Index:0x004A(0074.) Offset:0x0128
    void *  lpfnSetScissorRect;                         // Index:0x004B(0075.) Offset:0x012C
    void *  lpfnGetScissorRect;                         // Index:0x004C(0076.) Offset:0x0130
    void *  lpfnSetSoftwareVertexProcessing;            // Index:0x004D(0077.) Offset:0x0134
    void *  lpfnGetSoftwareVertexProcessing;            // Index:0x004E(0078.) Offset:0x0138
    void *  lpfnSetNPatchMode;                          // Index:0x004F(0079.) Offset:0x013C
    void *  lpfnGetNPatchMode;                          // Index:0x0050(0080.) Offset:0x0140
    void *  lpfnDrawPrimitive;                          // Index:0x0051(0081.) Offset:0x0144
    void *  lpfnDrawIndexedPrimitive;                   // Index:0x0052(0082.) Offset:0x0148
    void *  lpfnDrawPrimitiveUP;                        // Index:0x0053(0083.) Offset:0x014C
    void *  lpfnDrawIndexedPrimitiveUP;                 // Index:0x0054(0084.) Offset:0x0150
    void *  lpfnProcessVertices;                        // Index:0x0055(0085.) Offset:0x0154
    void *  lpfnCreateVertexDeclaration;                // Index:0x0056(0086.) Offset:0x0158
    void *  lpfnSetVertexDeclaration;                   // Index:0x0057(0087.) Offset:0x015C
    void *  lpfnGetVertexDeclaration;                   // Index:0x0058(0088.) Offset:0x0160
    void *  lpfnSetFVF;                                 // Index:0x0059(0089.) Offset:0x0164
    void *  lpfnGetFVF;                                 // Index:0x005A(0090.) Offset:0x0168
    void *  lpfnCreateVertexShader;                     // Index:0x005B(0091.) Offset:0x016C
    void *  lpfnSetVertexShader;                        // Index:0x005C(0092.) Offset:0x0170
    void *  lpfnGetVertexShader;                        // Index:0x005D(0093.) Offset:0x0174
    void *  lpfnSetVertexShaderConstantF;               // Index:0x005E(0094.) Offset:0x0178
    void *  lpfnGetVertexShaderConstantF;               // Index:0x005F(0095.) Offset:0x017C
    void *  lpfnSetVertexShaderConstantI;               // Index:0x0060(0096.) Offset:0x0180
    void *  lpfnGetVertexShaderConstantI;               // Index:0x0061(0097.) Offset:0x0184
    void *  lpfnSetVertexShaderConstantB;               // Index:0x0062(0098.) Offset:0x0188
    void *  lpfnGetVertexShaderConstantB;               // Index:0x0063(0099.) Offset:0x018C
    void *  lpfnSetStreamSource;                        // Index:0x0064(0100.) Offset:0x0190
    void *  lpfnGetStreamSource;                        // Index:0x0065(0101.) Offset:0x0194
    void *  lpfnSetStreamSourceFreq;                    // Index:0x0066(0102.) Offset:0x0198
    void *  lpfnGetStreamSourceFreq;                    // Index:0x0067(0103.) Offset:0x019C
    void *  lpfnSetIndices;                             // Index:0x0068(0104.) Offset:0x01A0
    void *  lpfnGetIndices;                             // Index:0x0069(0105.) Offset:0x01A4
    void *  lpfnCreatePixelShader;                      // Index:0x006A(0106.) Offset:0x01A8
    void *  lpfnSetPixelShader;                         // Index:0x006B(0107.) Offset:0x01AC
    void *  lpfnGetPixelShader;                         // Index:0x006C(0108.) Offset:0x01B0
    void *  lpfnSetPixelShaderConstantF;                // Index:0x006D(0109.) Offset:0x01B4
    void *  lpfnGetPixelShaderConstantF;                // Index:0x006E(0110.) Offset:0x01B8
    void *  lpfnSetPixelShaderConstantI;                // Index:0x006F(0111.) Offset:0x01BC
    void *  lpfnGetPixelShaderConstantI;                // Index:0x0070(0112.) Offset:0x01C0
    void *  lpfnSetPixelShaderConstantB;                // Index:0x0071(0113.) Offset:0x01C4
    void *  lpfnGetPixelShaderConstantB;                // Index:0x0072(0114.) Offset:0x01C8
    void *  lpfnDrawRectPatch;                          // Index:0x0073(0115.) Offset:0x01CC
    void *  lpfnDrawTriPatch;                           // Index:0x0074(0116.) Offset:0x01D0
    void *  lpfnDeletePatch;                            // Index:0x0075(0117.) Offset:0x01D4
    void *  lpfnCreateQuery;                            // Index:0x0076(0118.) Offset:0x01D8
};

struct IDirect3D9_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnRegisterSoftwareDevice;                 // Index:0x0003(0003.) Offset:0x000C
    void *  lpfnGetAdapterCount;                        // Index:0x0004(0004.) Offset:0x0010
    void *  lpfnGetAdapterIdentifier;                   // Index:0x0005(0005.) Offset:0x0014
    void *  lpfnGetAdapterModeCount;                    // Index:0x0006(0006.) Offset:0x0018
    void *  lpfnEnumAdapterModes;                       // Index:0x0007(0007.) Offset:0x001C
    void *  lpfnGetAdapterDisplayMode;                  // Index:0x0008(0008.) Offset:0x0020
    void *  lpfnCheckDeviceType;                        // Index:0x0009(0009.) Offset:0x0024
    void *  lpfnCheckDeviceFormat;                      // Index:0x000A(0010.) Offset:0x0028
    void *  lpfnCheckDeviceMultiSampleType;             // Index:0x000B(0011.) Offset:0x002C
    void *  lpfnCheckDepthStencilMatch;                 // Index:0x000C(0012.) Offset:0x0030
    void *  lpfnCheckDeviceFormatConversion;            // Index:0x000D(0013.) Offset:0x0034
    void *  lpfnGetDeviceCaps;                          // Index:0x000E(0014.) Offset:0x0038
    void *  lpfnGetAdapterMonitor;                      // Index:0x000F(0015.) Offset:0x003C
    void *  lpfnCreateDevice;                           // Index:0x0010(0016.) Offset:0x0040
};

struct IDirect3DStateBlock9_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnGetDevice;                              // Index:0x0003(0003.) Offset:0x000C
    void *  lpfnCapture;                                // Index:0x0004(0004.) Offset:0x0010
    void *  lpfnApply;                                  // Index:0x0005(0005.) Offset:0x0014
};

struct IDirect3DSwapChain9_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnPresent;                                // Index:0x0003(0003.) Offset:0x000C
    void *  lpfnGetFrontBufferData;                     // Index:0x0004(0004.) Offset:0x0010
    void *  lpfnGetBackBuffer;                          // Index:0x0005(0005.) Offset:0x0014
    void *  lpfnGetRasterStatus;                        // Index:0x0006(0006.) Offset:0x0018
    void *  lpfnGetDisplayMode;                         // Index:0x0007(0007.) Offset:0x001C
    void *  lpfnGetDevice;                              // Index:0x0008(0008.) Offset:0x0020
    void *  lpfnGetPresentParameters;                   // Index:0x0009(0009.) Offset:0x0024
};

struct IDirect3DResource9_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnGetDevice;                              // Index:0x0003(0003.) Offset:0x000C
    void *  lpfnSetPrivateData;                         // Index:0x0004(0004.) Offset:0x0010
    void *  lpfnGetPrivateData;                         // Index:0x0005(0005.) Offset:0x0014
    void *  lpfnFreePrivateData;                        // Index:0x0006(0006.) Offset:0x0018
    void *  lpfnSetPriority;                            // Index:0x0007(0007.) Offset:0x001C
    void *  lpfnGetPriority;                            // Index:0x0008(0008.) Offset:0x0020
    void *  lpfnPreLoad;                                // Index:0x0009(0009.) Offset:0x0024
    void *  lpfnGetType;                                // Index:0x000A(0010.) Offset:0x0028
};

struct IDirect3DVertexDeclaration9_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnGetDevice;                              // Index:0x0003(0003.) Offset:0x000C
    void *  lpfnGetDeclaration;                         // Index:0x0004(0004.) Offset:0x0010
};

struct IDirect3DVertexShader9_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnGetDevice;                              // Index:0x0003(0003.) Offset:0x000C
    void *  lpfnGetFunction;                            // Index:0x0004(0004.) Offset:0x0010
};

struct IDirect3DPixelShader9_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnGetDevice;                              // Index:0x0003(0003.) Offset:0x000C
    void *  lpfnGetFunction;                            // Index:0x0004(0004.) Offset:0x0010
};

struct IDirect3DBaseTexture9_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnGetDevice;                              // Index:0x0003(0003.) Offset:0x000C
    void *  lpfnSetPrivateData;                         // Index:0x0004(0004.) Offset:0x0010
    void *  lpfnGetPrivateData;                         // Index:0x0005(0005.) Offset:0x0014
    void *  lpfnFreePrivateData;                        // Index:0x0006(0006.) Offset:0x0018
    void *  lpfnSetPriority;                            // Index:0x0007(0007.) Offset:0x001C
    void *  lpfnGetPriority;                            // Index:0x0008(0008.) Offset:0x0020
    void *  lpfnPreLoad;                                // Index:0x0009(0009.) Offset:0x0024
    void *  lpfnGetType;                                // Index:0x000A(0010.) Offset:0x0028
    void *  lpfnSetLOD;                                 // Index:0x000B(0011.) Offset:0x002C
    void *  lpfnGetLOD;                                 // Index:0x000C(0012.) Offset:0x0030
    void *  lpfnGetLevelCount;                          // Index:0x000D(0013.) Offset:0x0034
    void *  lpfnSetAutoGenFilterType;                   // Index:0x000E(0014.) Offset:0x0038
    void *  lpfnGetAutoGenFilterType;                   // Index:0x000F(0015.) Offset:0x003C
    void *  lpfnGenerateMipSubLevels;                   // Index:0x0010(0016.) Offset:0x0040
};

struct IDirect3DTexture9_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnGetDevice;                              // Index:0x0003(0003.) Offset:0x000C
    void *  lpfnSetPrivateData;                         // Index:0x0004(0004.) Offset:0x0010
    void *  lpfnGetPrivateData;                         // Index:0x0005(0005.) Offset:0x0014
    void *  lpfnFreePrivateData;                        // Index:0x0006(0006.) Offset:0x0018
    void *  lpfnSetPriority;                            // Index:0x0007(0007.) Offset:0x001C
    void *  lpfnGetPriority;                            // Index:0x0008(0008.) Offset:0x0020
    void *  lpfnPreLoad;                                // Index:0x0009(0009.) Offset:0x0024
    void *  lpfnGetType;                                // Index:0x000A(0010.) Offset:0x0028
    void *  lpfnSetLOD;                                 // Index:0x000B(0011.) Offset:0x002C
    void *  lpfnGetLOD;                                 // Index:0x000C(0012.) Offset:0x0030
    void *  lpfnGetLevelCount;                          // Index:0x000D(0013.) Offset:0x0034
    void *  lpfnSetAutoGenFilterType;                   // Index:0x000E(0014.) Offset:0x0038
    void *  lpfnGetAutoGenFilterType;                   // Index:0x000F(0015.) Offset:0x003C
    void *  lpfnGenerateMipSubLevels;                   // Index:0x0010(0016.) Offset:0x0040
    void *  lpfnGetLevelDesc;                           // Index:0x0011(0017.) Offset:0x0044
    void *  lpfnGetSurfaceLevel;                        // Index:0x0012(0018.) Offset:0x0048
    void *  lpfnLockRect;                               // Index:0x0013(0019.) Offset:0x004C
    void *  lpfnUnlockRect;                             // Index:0x0014(0020.) Offset:0x0050
    void *  lpfnAddDirtyRect;                           // Index:0x0015(0021.) Offset:0x0054
};

struct IDirect3DVolumeTexture9_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnGetDevice;                              // Index:0x0003(0003.) Offset:0x000C
    void *  lpfnSetPrivateData;                         // Index:0x0004(0004.) Offset:0x0010
    void *  lpfnGetPrivateData;                         // Index:0x0005(0005.) Offset:0x0014
    void *  lpfnFreePrivateData;                        // Index:0x0006(0006.) Offset:0x0018
    void *  lpfnSetPriority;                            // Index:0x0007(0007.) Offset:0x001C
    void *  lpfnGetPriority;                            // Index:0x0008(0008.) Offset:0x0020
    void *  lpfnPreLoad;                                // Index:0x0009(0009.) Offset:0x0024
    void *  lpfnGetType;                                // Index:0x000A(0010.) Offset:0x0028
    void *  lpfnSetLOD;                                 // Index:0x000B(0011.) Offset:0x002C
    void *  lpfnGetLOD;                                 // Index:0x000C(0012.) Offset:0x0030
    void *  lpfnGetLevelCount;                          // Index:0x000D(0013.) Offset:0x0034
    void *  lpfnSetAutoGenFilterType;                   // Index:0x000E(0014.) Offset:0x0038
    void *  lpfnGetAutoGenFilterType;                   // Index:0x000F(0015.) Offset:0x003C
    void *  lpfnGenerateMipSubLevels;                   // Index:0x0010(0016.) Offset:0x0040
    void *  lpfnGetLevelDesc;                           // Index:0x0011(0017.) Offset:0x0044
    void *  lpfnGetVolumeLevel;                         // Index:0x0012(0018.) Offset:0x0048
    void *  lpfnLockBox;                                // Index:0x0013(0019.) Offset:0x004C
    void *  lpfnUnlockBox;                              // Index:0x0014(0020.) Offset:0x0050
    void *  lpfnAddDirtyBox;                            // Index:0x0015(0021.) Offset:0x0054
};

struct IDirect3DCubeTexture9_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnGetDevice;                              // Index:0x0003(0003.) Offset:0x000C
    void *  lpfnSetPrivateData;                         // Index:0x0004(0004.) Offset:0x0010
    void *  lpfnGetPrivateData;                         // Index:0x0005(0005.) Offset:0x0014
    void *  lpfnFreePrivateData;                        // Index:0x0006(0006.) Offset:0x0018
    void *  lpfnSetPriority;                            // Index:0x0007(0007.) Offset:0x001C
    void *  lpfnGetPriority;                            // Index:0x0008(0008.) Offset:0x0020
    void *  lpfnPreLoad;                                // Index:0x0009(0009.) Offset:0x0024
    void *  lpfnGetType;                                // Index:0x000A(0010.) Offset:0x0028
    void *  lpfnSetLOD;                                 // Index:0x000B(0011.) Offset:0x002C
    void *  lpfnGetLOD;                                 // Index:0x000C(0012.) Offset:0x0030
    void *  lpfnGetLevelCount;                          // Index:0x000D(0013.) Offset:0x0034
    void *  lpfnSetAutoGenFilterType;                   // Index:0x000E(0014.) Offset:0x0038
    void *  lpfnGetAutoGenFilterType;                   // Index:0x000F(0015.) Offset:0x003C
    void *  lpfnGenerateMipSubLevels;                   // Index:0x0010(0016.) Offset:0x0040
    void *  lpfnGetLevelDesc;                           // Index:0x0011(0017.) Offset:0x0044
    void *  lpfnGetCubeMapSurface;                      // Index:0x0012(0018.) Offset:0x0048
    void *  lpfnLockRect;                               // Index:0x0013(0019.) Offset:0x004C
    void *  lpfnUnlockRect;                             // Index:0x0014(0020.) Offset:0x0050
    void *  lpfnAddDirtyRect;                           // Index:0x0015(0021.) Offset:0x0054
};

struct IDirect3DVertexBuffer9_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnGetDevice;                              // Index:0x0003(0003.) Offset:0x000C
    void *  lpfnSetPrivateData;                         // Index:0x0004(0004.) Offset:0x0010
    void *  lpfnGetPrivateData;                         // Index:0x0005(0005.) Offset:0x0014
    void *  lpfnFreePrivateData;                        // Index:0x0006(0006.) Offset:0x0018
    void *  lpfnSetPriority;                            // Index:0x0007(0007.) Offset:0x001C
    void *  lpfnGetPriority;                            // Index:0x0008(0008.) Offset:0x0020
    void *  lpfnPreLoad;                                // Index:0x0009(0009.) Offset:0x0024
    void *  lpfnGetType;                                // Index:0x000A(0010.) Offset:0x0028
    void *  lpfnLock;                                   // Index:0x000B(0011.) Offset:0x002C
    void *  lpfnUnlock;                                 // Index:0x000C(0012.) Offset:0x0030
    void *  lpfnGetDesc;                                // Index:0x000D(0013.) Offset:0x0034
};

struct IDirect3DIndexBuffer9_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnGetDevice;                              // Index:0x0003(0003.) Offset:0x000C
    void *  lpfnSetPrivateData;                         // Index:0x0004(0004.) Offset:0x0010
    void *  lpfnGetPrivateData;                         // Index:0x0005(0005.) Offset:0x0014
    void *  lpfnFreePrivateData;                        // Index:0x0006(0006.) Offset:0x0018
    void *  lpfnSetPriority;                            // Index:0x0007(0007.) Offset:0x001C
    void *  lpfnGetPriority;                            // Index:0x0008(0008.) Offset:0x0020
    void *  lpfnPreLoad;                                // Index:0x0009(0009.) Offset:0x0024
    void *  lpfnGetType;                                // Index:0x000A(0010.) Offset:0x0028
    void *  lpfnLock;                                   // Index:0x000B(0011.) Offset:0x002C
    void *  lpfnUnlock;                                 // Index:0x000C(0012.) Offset:0x0030
    void *  lpfnGetDesc;                                // Index:0x000D(0013.) Offset:0x0034
};

struct IDirect3DSurface9_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnGetDevice;                              // Index:0x0003(0003.) Offset:0x000C
    void *  lpfnSetPrivateData;                         // Index:0x0004(0004.) Offset:0x0010
    void *  lpfnGetPrivateData;                         // Index:0x0005(0005.) Offset:0x0014
    void *  lpfnFreePrivateData;                        // Index:0x0006(0006.) Offset:0x0018
    void *  lpfnSetPriority;                            // Index:0x0007(0007.) Offset:0x001C
    void *  lpfnGetPriority;                            // Index:0x0008(0008.) Offset:0x0020
    void *  lpfnPreLoad;                                // Index:0x0009(0009.) Offset:0x0024
    void *  lpfnGetType;                                // Index:0x000A(0010.) Offset:0x0028
    void *  lpfnGetContainer;                           // Index:0x000B(0011.) Offset:0x002C
    void *  lpfnGetDesc;                                // Index:0x000C(0012.) Offset:0x0030
    void *  lpfnLockRect;                               // Index:0x000D(0013.) Offset:0x0034
    void *  lpfnUnlockRect;                             // Index:0x000E(0014.) Offset:0x0038
    void *  lpfnGetDC;                                  // Index:0x000F(0015.) Offset:0x003C
    void *  lpfnReleaseDC;                              // Index:0x0010(0016.) Offset:0x0040
};

struct IDirect3DVolume9_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnGetDevice;                              // Index:0x0003(0003.) Offset:0x000C
    void *  lpfnSetPrivateData;                         // Index:0x0004(0004.) Offset:0x0010
    void *  lpfnGetPrivateData;                         // Index:0x0005(0005.) Offset:0x0014
    void *  lpfnFreePrivateData;                        // Index:0x0006(0006.) Offset:0x0018
    void *  lpfnGetContainer;                           // Index:0x0007(0007.) Offset:0x001C
    void *  lpfnGetDesc;                                // Index:0x0008(0008.) Offset:0x0020
    void *  lpfnLockBox;                                // Index:0x0009(0009.) Offset:0x0024
    void *  lpfnUnlockBox;                              // Index:0x000A(0010.) Offset:0x0028
};

struct IDirect3DQuery9_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnGetDevice;                              // Index:0x0003(0003.) Offset:0x000C
    void *  lpfnGetType;                                // Index:0x0004(0004.) Offset:0x0010
    void *  lpfnGetDataSize;                            // Index:0x0005(0005.) Offset:0x0014
    void *  lpfnIssue;                                  // Index:0x0006(0006.) Offset:0x0018
    void *  lpfnGetData;                                // Index:0x0007(0007.) Offset:0x001C
};

struct IDirect3D9Ex_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnGetAdapterCount;                        // Index:0x0003(0003.) Offset:0x000C
    void *  lpfnGetAdapterIdentifier;                   // Index:0x0004(0004.) Offset:0x0010
    void *  lpfnGetAdapterModeCount;                    // Index:0x0005(0005.) Offset:0x0014
    void *  lpfnEnumAdapterModes;                       // Index:0x0006(0006.) Offset:0x0018
    void *  lpfnGetAdapterDisplayMode;                  // Index:0x0007(0007.) Offset:0x001C
    void *  lpfnCheckDeviceType;                        // Index:0x0008(0008.) Offset:0x0020
    void *  lpfnCheckDeviceFormat;                      // Index:0x0009(0009.) Offset:0x0024
    void *  lpfnCheckDeviceMultiSampleType;             // Index:0x000A(0010.) Offset:0x0028
    void *  lpfnCheckDepthStencilMatch;                 // Index:0x000B(0011.) Offset:0x002C
    void *  lpfnCheckDeviceFormatConversion;            // Index:0x000C(0012.) Offset:0x0030
    void *  lpfnGetDeviceCaps;                          // Index:0x000D(0013.) Offset:0x0034
    void *  lpfnGetAdapterMonitor;                      // Index:0x000E(0014.) Offset:0x0038
    void *  lpfnCreateDevice;                           // Index:0x000F(0015.) Offset:0x003C
    void *  lpfnGetAdapterModeCountEx;                  // Index:0x0010(0016.) Offset:0x0040
    void *  lpfnEnumAdapterModesEx;                     // Index:0x0011(0017.) Offset:0x0044
    void *  lpfnGetAdapterDisplayModeEx;                // Index:0x0012(0018.) Offset:0x0048
    void *  lpfnCreateDeviceEx;                         // Index:0x0013(0019.) Offset:0x004C
    void *  lpfnGetAdapterLUID;                         // Index:0x0014(0020.) Offset:0x0050
};

struct IDirect3DDevice9Ex_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnTestCooperativeLevel;                   // Index:0x0003(0003.) Offset:0x000C
    void *  lpfnGetAvailableTextureMem;                 // Index:0x0004(0004.) Offset:0x0010
    void *  lpfnEvictManagedResources;                  // Index:0x0005(0005.) Offset:0x0014
    void *  lpfnGetDirect3D;                            // Index:0x0006(0006.) Offset:0x0018
    void *  lpfnGetDeviceCaps;                          // Index:0x0007(0007.) Offset:0x001C
    void *  lpfnGetDisplayMode;                         // Index:0x0008(0008.) Offset:0x0020
    void *  lpfnGetCreationParameters;                  // Index:0x0009(0009.) Offset:0x0024
    void *  lpfnSetCursorProperties;                    // Index:0x000A(0010.) Offset:0x0028
    void *  lpfnSetCursorPosition;                      // Index:0x000B(0011.) Offset:0x002C
    void *  lpfnShowCursor;                             // Index:0x000C(0012.) Offset:0x0030
    void *  lpfnCreateAdditionalSwapChain;              // Index:0x000D(0013.) Offset:0x0034
    void *  lpfnGetSwapChain;                           // Index:0x000E(0014.) Offset:0x0038
    void *  lpfnGetNumberOfSwapChains;                  // Index:0x000F(0015.) Offset:0x003C
    void *  lpfnReset;                                  // Index:0x0010(0016.) Offset:0x0040
    void *  lpfnPresent;                                // Index:0x0011(0017.) Offset:0x0044
    void *  lpfnGetBackBuffer;                          // Index:0x0012(0018.) Offset:0x0048
    void *  lpfnGetRasterStatus;                        // Index:0x0013(0019.) Offset:0x004C
    void *  lpfnSetDialogBoxMode;                       // Index:0x0014(0020.) Offset:0x0050
    void *  lpfnSetGammaRamp;                           // Index:0x0015(0021.) Offset:0x0054
    void *  lpfnGetGammaRamp;                           // Index:0x0016(0022.) Offset:0x0058
    void *  lpfnCreateTexture;                          // Index:0x0017(0023.) Offset:0x005C
    void *  lpfnCreateVolumeTexture;                    // Index:0x0018(0024.) Offset:0x0060
    void *  lpfnCreateCubeTexture;                      // Index:0x0019(0025.) Offset:0x0064
    void *  lpfnCreateVertexBuffer;                     // Index:0x001A(0026.) Offset:0x0068
    void *  lpfnCreateIndexBuffer;                      // Index:0x001B(0027.) Offset:0x006C
    void *  lpfnCreateRenderTarget;                     // Index:0x001C(0028.) Offset:0x0070
    void *  lpfnCreateDepthStencilSurface;              // Index:0x001D(0029.) Offset:0x0074
    void *  lpfnUpdateSurface;                          // Index:0x001E(0030.) Offset:0x0078
    void *  lpfnUpdateTexture;                          // Index:0x001F(0031.) Offset:0x007C
    void *  lpfnGetRenderTargetData;                    // Index:0x0020(0032.) Offset:0x0080
    void *  lpfnGetFrontBufferData;                     // Index:0x0021(0033.) Offset:0x0084
    void *  lpfnStretchRect;                            // Index:0x0022(0034.) Offset:0x0088
    void *  lpfnColorFill;                              // Index:0x0023(0035.) Offset:0x008C
    void *  lpfnCreateOffscreenPlainSurface;            // Index:0x0024(0036.) Offset:0x0090
    void *  lpfnSetRenderTarget;                        // Index:0x0025(0037.) Offset:0x0094
    void *  lpfnGetRenderTarget;                        // Index:0x0026(0038.) Offset:0x0098
    void *  lpfnSetDepthStencilSurface;                 // Index:0x0027(0039.) Offset:0x009C
    void *  lpfnGetDepthStencilSurface;                 // Index:0x0028(0040.) Offset:0x00A0
    void *  lpfnBeginScene;                             // Index:0x0029(0041.) Offset:0x00A4
    void *  lpfnEndScene;                               // Index:0x002A(0042.) Offset:0x00A8
    void *  lpfnClear;                                  // Index:0x002B(0043.) Offset:0x00AC
    void *  lpfnSetTransform;                           // Index:0x002C(0044.) Offset:0x00B0
    void *  lpfnGetTransform;                           // Index:0x002D(0045.) Offset:0x00B4
    void *  lpfnMultiplyTransform;                      // Index:0x002E(0046.) Offset:0x00B8
    void *  lpfnSetViewport;                            // Index:0x002F(0047.) Offset:0x00BC
    void *  lpfnGetViewport;                            // Index:0x0030(0048.) Offset:0x00C0
    void *  lpfnSetMaterial;                            // Index:0x0031(0049.) Offset:0x00C4
    void *  lpfnGetMaterial;                            // Index:0x0032(0050.) Offset:0x00C8
    void *  lpfnSetLight;                               // Index:0x0033(0051.) Offset:0x00CC
    void *  lpfnGetLight;                               // Index:0x0034(0052.) Offset:0x00D0
    void *  lpfnLightEnable;                            // Index:0x0035(0053.) Offset:0x00D4
    void *  lpfnGetLightEnable;                         // Index:0x0036(0054.) Offset:0x00D8
    void *  lpfnSetClipPlane;                           // Index:0x0037(0055.) Offset:0x00DC
    void *  lpfnGetClipPlane;                           // Index:0x0038(0056.) Offset:0x00E0
    void *  lpfnSetRenderState;                         // Index:0x0039(0057.) Offset:0x00E4
    void *  lpfnGetRenderState;                         // Index:0x003A(0058.) Offset:0x00E8
    void *  lpfnCreateStateBlock;                       // Index:0x003B(0059.) Offset:0x00EC
    void *  lpfnBeginStateBlock;                        // Index:0x003C(0060.) Offset:0x00F0
    void *  lpfnEndStateBlock;                          // Index:0x003D(0061.) Offset:0x00F4
    void *  lpfnSetClipStatus;                          // Index:0x003E(0062.) Offset:0x00F8
    void *  lpfnGetClipStatus;                          // Index:0x003F(0063.) Offset:0x00FC
    void *  lpfnGetTexture;                             // Index:0x0040(0064.) Offset:0x0100
    void *  lpfnSetTexture;                             // Index:0x0041(0065.) Offset:0x0104
    void *  lpfnGetTextureStageState;                   // Index:0x0042(0066.) Offset:0x0108
    void *  lpfnSetTextureStageState;                   // Index:0x0043(0067.) Offset:0x010C
    void *  lpfnGetSamplerState;                        // Index:0x0044(0068.) Offset:0x0110
    void *  lpfnSetSamplerState;                        // Index:0x0045(0069.) Offset:0x0114
    void *  lpfnValidateDevice;                         // Index:0x0046(0070.) Offset:0x0118
    void *  lpfnSetPaletteEntries;                      // Index:0x0047(0071.) Offset:0x011C
    void *  lpfnGetPaletteEntries;                      // Index:0x0048(0072.) Offset:0x0120
    void *  lpfnSetCurrentTexturePalette;               // Index:0x0049(0073.) Offset:0x0124
    void *  lpfnGetCurrentTexturePalette;               // Index:0x004A(0074.) Offset:0x0128
    void *  lpfnSetScissorRect;                         // Index:0x004B(0075.) Offset:0x012C
    void *  lpfnGetScissorRect;                         // Index:0x004C(0076.) Offset:0x0130
    void *  lpfnSetSoftwareVertexProcessing;            // Index:0x004D(0077.) Offset:0x0134
    void *  lpfnGetSoftwareVertexProcessing;            // Index:0x004E(0078.) Offset:0x0138
    void *  lpfnSetNPatchMode;                          // Index:0x004F(0079.) Offset:0x013C
    void *  lpfnGetNPatchMode;                          // Index:0x0050(0080.) Offset:0x0140
    void *  lpfnDrawPrimitive;                          // Index:0x0051(0081.) Offset:0x0144
    void *  lpfnDrawIndexedPrimitive;                   // Index:0x0052(0082.) Offset:0x0148
    void *  lpfnDrawPrimitiveUP;                        // Index:0x0053(0083.) Offset:0x014C
    void *  lpfnDrawIndexedPrimitiveUP;                 // Index:0x0054(0084.) Offset:0x0150
    void *  lpfnProcessVertices;                        // Index:0x0055(0085.) Offset:0x0154
    void *  lpfnCreateVertexDeclaration;                // Index:0x0056(0086.) Offset:0x0158
    void *  lpfnSetVertexDeclaration;                   // Index:0x0057(0087.) Offset:0x015C
    void *  lpfnGetVertexDeclaration;                   // Index:0x0058(0088.) Offset:0x0160
    void *  lpfnSetFVF;                                 // Index:0x0059(0089.) Offset:0x0164
    void *  lpfnGetFVF;                                 // Index:0x005A(0090.) Offset:0x0168
    void *  lpfnCreateVertexShader;                     // Index:0x005B(0091.) Offset:0x016C
    void *  lpfnSetVertexShader;                        // Index:0x005C(0092.) Offset:0x0170
    void *  lpfnGetVertexShader;                        // Index:0x005D(0093.) Offset:0x0174
    void *  lpfnSetVertexShaderConstantF;               // Index:0x005E(0094.) Offset:0x0178
    void *  lpfnGetVertexShaderConstantF;               // Index:0x005F(0095.) Offset:0x017C
    void *  lpfnSetVertexShaderConstantI;               // Index:0x0060(0096.) Offset:0x0180
    void *  lpfnGetVertexShaderConstantI;               // Index:0x0061(0097.) Offset:0x0184
    void *  lpfnSetVertexShaderConstantB;               // Index:0x0062(0098.) Offset:0x0188
    void *  lpfnGetVertexShaderConstantB;               // Index:0x0063(0099.) Offset:0x018C
    void *  lpfnSetStreamSource;                        // Index:0x0064(0100.) Offset:0x0190
    void *  lpfnGetStreamSource;                        // Index:0x0065(0101.) Offset:0x0194
    void *  lpfnSetStreamSourceFreq;                    // Index:0x0066(0102.) Offset:0x0198
    void *  lpfnGetStreamSourceFreq;                    // Index:0x0067(0103.) Offset:0x019C
    void *  lpfnSetIndices;                             // Index:0x0068(0104.) Offset:0x01A0
    void *  lpfnGetIndices;                             // Index:0x0069(0105.) Offset:0x01A4
    void *  lpfnCreatePixelShader;                      // Index:0x006A(0106.) Offset:0x01A8
    void *  lpfnSetPixelShader;                         // Index:0x006B(0107.) Offset:0x01AC
    void *  lpfnGetPixelShader;                         // Index:0x006C(0108.) Offset:0x01B0
    void *  lpfnSetPixelShaderConstantF;                // Index:0x006D(0109.) Offset:0x01B4
    void *  lpfnGetPixelShaderConstantF;                // Index:0x006E(0110.) Offset:0x01B8
    void *  lpfnSetPixelShaderConstantI;                // Index:0x006F(0111.) Offset:0x01BC
    void *  lpfnGetPixelShaderConstantI;                // Index:0x0070(0112.) Offset:0x01C0
    void *  lpfnSetPixelShaderConstantB;                // Index:0x0071(0113.) Offset:0x01C4
    void *  lpfnGetPixelShaderConstantB;                // Index:0x0072(0114.) Offset:0x01C8
    void *  lpfnDrawRectPatch;                          // Index:0x0073(0115.) Offset:0x01CC
    void *  lpfnDrawTriPatch;                           // Index:0x0074(0116.) Offset:0x01D0
    void *  lpfnDeletePatch;                            // Index:0x0075(0117.) Offset:0x01D4
    void *  lpfnCreateQuery;                            // Index:0x0076(0118.) Offset:0x01D8
    void *  lpfnSetConvolutionMonoKernel;               // Index:0x0077(0119.) Offset:0x01DC
    void *  lpfnComposeRects;                           // Index:0x0078(0120.) Offset:0x01E0
    void *  lpfnPresentEx;                              // Index:0x0079(0121.) Offset:0x01E4
    void *  lpfnGetGPUThreadPriority;                   // Index:0x007A(0122.) Offset:0x01E8
    void *  lpfnSetGPUThreadPriority;                   // Index:0x007B(0123.) Offset:0x01EC
    void *  lpfnWaitForVBlank;                          // Index:0x007C(0124.) Offset:0x01F0
    void *  lpfnCheckResourceResidency;                 // Index:0x007D(0125.) Offset:0x01F4
    void *  lpfnSetMaximumFrameLatency;                 // Index:0x007E(0126.) Offset:0x01F8
    void *  lpfnGetMaximumFrameLatency;                 // Index:0x007F(0127.) Offset:0x01FC
    void *  lpfnCheckDeviceState;                       // Index:0x0080(0128.) Offset:0x0200
    void *  lpfnCreateRenderTargetEx;                   // Index:0x0081(0129.) Offset:0x0204
    void *  lpfnCreateOffscreenPlainSurfaceEx;          // Index:0x0082(0130.) Offset:0x0208
    void *  lpfnCreateDepthStencilSurfaceEx;            // Index:0x0083(0131.) Offset:0x020C
    void *  lpfnResetEx;                                // Index:0x0084(0132.) Offset:0x0210
    void *  lpfnGetDisplayModeEx;                       // Index:0x0085(0133.) Offset:0x0214
};

struct IDirect3DSwapChain9Ex_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnPresent;                                // Index:0x0003(0003.) Offset:0x000C
    void *  lpfnGetFrontBufferData;                     // Index:0x0004(0004.) Offset:0x0010
    void *  lpfnGetBackBuffer;                          // Index:0x0005(0005.) Offset:0x0014
    void *  lpfnGetRasterStatus;                        // Index:0x0006(0006.) Offset:0x0018
    void *  lpfnGetDisplayMode;                         // Index:0x0007(0007.) Offset:0x001C
    void *  lpfnGetDevice;                              // Index:0x0008(0008.) Offset:0x0020
    void *  lpfnGetPresentParameters;                   // Index:0x0009(0009.) Offset:0x0024
    void *  lpfnGetLastPresentCount;                    // Index:0x000A(0010.) Offset:0x0028
    void *  lpfnGetPresentStats;                        // Index:0x000B(0011.) Offset:0x002C
    void *  lpfnGetDisplayModeEx;                       // Index:0x000C(0012.) Offset:0x0030
};

struct IDirect3D9ExOverlayExtension_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnCheckDeviceOverlayType;                 // Index:0x0003(0003.) Offset:0x000C
};

struct IDirect3DDevice9Video_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnGetContentProtectionCaps;               // Index:0x0003(0003.) Offset:0x000C
    void *  lpfnCreateAuthenticatedChannel;             // Index:0x0004(0004.) Offset:0x0010
    void *  lpfnCreateCryptoSession;                    // Index:0x0005(0005.) Offset:0x0014
};

struct IDirect3DAuthenticatedChannel9_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnGetCertificateSize;                     // Index:0x0003(0003.) Offset:0x000C
    void *  lpfnGetCertificate;                         // Index:0x0004(0004.) Offset:0x0010
    void *  lpfnNegotiateKeyExchange;                   // Index:0x0005(0005.) Offset:0x0014
    void *  lpfnQuery;                                  // Index:0x0006(0006.) Offset:0x0018
    void *  lpfnConfigure;                              // Index:0x0007(0007.) Offset:0x001C
};

struct IDirect3DCryptoSession9_vTable {
    void *  lpfnQueryInterface;                         // Index:0x0000(0000.) Offset:0x0000
    void *  lpfnAddRef;                                 // Index:0x0001(0001.) Offset:0x0004
    void *  lpfnRelease;                                // Index:0x0002(0002.) Offset:0x0008
    void *  lpfnGetCertificateSize;                     // Index:0x0003(0003.) Offset:0x000C
    void *  lpfnGetCertificate;                         // Index:0x0004(0004.) Offset:0x0010
    void *  lpfnNegotiateKeyExchange;                   // Index:0x0005(0005.) Offset:0x0014
    void *  lpfnEncryptionBlt;                          // Index:0x0006(0006.) Offset:0x0018
    void *  lpfnDecryptionBlt;                          // Index:0x0007(0007.) Offset:0x001C
    void *  lpfnGetSurfacePitch;                        // Index:0x0008(0008.) Offset:0x0020
    void *  lpfnStartSessionKeyRefresh;                 // Index:0x0009(0009.) Offset:0x0024
    void *  lpfnFinishSessionKeyRefresh;                // Index:0x000A(0010.) Offset:0x0028
    void *  lpfnGetEncryptionBltKey;                    // Index:0x000B(0011.) Offset:0x002C
};
2013-9-1 09:57
0
雪    币: 1283
活跃值: (46)
能力值: ( LV3,RANK:30 )
在线值:
发帖
回帖
粉丝
8
要Hook D3D的Present函数,可以联系俺!
2013-9-2 09:06
0
雪    币: 208
活跃值: (40)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
9
多谢!
但有个问题,虚拟函数表不会直接在头文件中直接定义的,你的这些数据应该是自己二次导出的吧?
不过用IDA导入头文件的时候IDA会自动生产虚拟函数表。
兄台能给讲一下如何导出的吗,因为我总感觉虚拟函数表的排列顺序直接和函数的定义位置和声明位置有关,可能还和编译器有关,总搞不清楚到底是这3个中的那个是起决定作用的。
2013-9-3 10:42
0
雪    币: 65
活跃值: (60)
能力值: ( LV3,RANK:30 )
在线值:
发帖
回帖
粉丝
10
二次导出:确实是这个样子的;IDA:我没有使用这个!

虚函数表中虚函数排列顺序当然是和虚函数在类中的声明位置有关系的啦!编译器确实对顺序有影响,但是一般状况下都是不会的,因为除非那个编译器是脑子进水的人写的!至少微软的不会!!对于 DX 的 COM,有一个 CINTERFACE 宏,定义了这个宏虚函数表就成为 C 的定义了(要在包含 d3d9.h 之前定义),设置 CINTERFACE 宏就是防止别的 C++ 编译器中虚函数表不按声明顺序设置!

DECLARE_INTERFACE_(IDirect3D9, IUnknown)
{
    /*** IUnknown methods ***/
    STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE;
    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
    STDMETHOD_(ULONG,Release)(THIS) PURE;

    /*** IDirect3D9 methods ***/
    STDMETHOD(RegisterSoftwareDevice)(THIS_ void* pInitializeFunction) PURE;
    STDMETHOD_(UINT, GetAdapterCount)(THIS) PURE;
    STDMETHOD(GetAdapterIdentifier)(THIS_ UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER9* pIdentifier) PURE;
    STDMETHOD_(UINT, GetAdapterModeCount)(THIS_ UINT Adapter,D3DFORMAT Format) PURE;
    STDMETHOD(EnumAdapterModes)(THIS_ UINT Adapter,D3DFORMAT Format,UINT Mode,D3DDISPLAYMODE* pMode) PURE;
    STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT Adapter,D3DDISPLAYMODE* pMode) PURE;
    STDMETHOD(CheckDeviceType)(THIS_ UINT Adapter,D3DDEVTYPE DevType,D3DFORMAT AdapterFormat,D3DFORMAT BackBufferFormat,BOOL bWindowed) PURE;
    STDMETHOD(CheckDeviceFormat)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat) PURE;
    STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType,DWORD* pQualityLevels) PURE;
    STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat) PURE;
    STDMETHOD(CheckDeviceFormatConversion)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SourceFormat,D3DFORMAT TargetFormat) PURE;
    STDMETHOD(GetDeviceCaps)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS9* pCaps) PURE;
    STDMETHOD_(HMONITOR, GetAdapterMonitor)(THIS_ UINT Adapter) PURE;
    STDMETHOD(CreateDevice)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice9** ppReturnedDeviceInterface) PURE;
    
    #ifdef D3D_DEBUG_INFO
    LPCWSTR Version;
    #endif
};


DECLARE_INTERFACE_ 宏中其实是带有 class 关键字的,STDMETHOD 和 STDMETHOD_ 有 virtual 关键字,所以说 DX 的 COM 接口就是都是虚函数的类。

如上面代码所知,QueryInterface 是第一个声明的,所以说它在虚函数表中的偏移量是 0;在 32 位情况下编译,一个指针是 4 字节,所以说随后的虚函数在表中的位置分别是:AddRef 为 4,Release 为 8……

请注意上面的声明中没有声明析构函数,如果有析构函数,析构函数一定是虚的,为了保证效率,微软的编译器把析构函数放到虚函数表的第一位,也就是偏移量为 0 的地方,随后跟的才是用户定义的虚函数。如果上面在接口中声明了虚函数(假如说接口中能声明虚函数),则 QueryInterface 的偏移量就是 4 了。

至于导出,是自己写的工具,现在可能找不到了……,STDMETHOD 宏写的非常整齐,用正则表达式筛出来就可以了!!!!
2013-9-3 12:06
0
雪    币: 208
活跃值: (40)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
11
多谢赐教。

不过,还是有些问题感到没有理解。因为D3D是com接口的,而com接口是会提供公开的函数接口表的。这种情况下,其实是微软做了另外的工作将C++的虚拟函数表和com的接口函数表对应起来了,所以从com提供的接口定义中就可以知道C++的虚拟函数表的排列。但在类不是以com接口形式公开的情况下,类的虚拟函数表的生成顺序是由编译器决定的。不同的编译器也许有不同的规则,当然我没有读过C++标准,不知道标准中是否对虚拟函数表的排列顺序是否做出了严格的规定,这只是自己的猜测。

IDA可以导入头文件的数据结构定义,也能根据自动生成类的虚拟函数表,所以我认为肯定有一个规则用来指导所有C++的编译器来生成虚拟函数表的。因为IDA是根据没有显式的虚拟函数表的头文件来自动生成虚拟函数表的。

######################################################
以上的内容不代表个人的立场,如果与事实有出入,一切以事实为准。本人对本次发布的信息不承担任何准确性的责任。
######################################################
2013-9-3 21:54
0
雪    币: 257
活跃值: (67)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
12
来围观一下
2013-9-3 22:00
0
雪    币: 65
活跃值: (60)
能力值: ( LV3,RANK:30 )
在线值:
发帖
回帖
粉丝
13
对于微软的 C/C++ 编译器,一直是按照声明顺序决定函数指针在虚函数表中的位置的,对于 COM 接口中函数集合写成类,类中含有一大堆虚函数的方式并没有做什么特殊的工作;即使你声明的是普通类,虚函数的顺序也是按照你声明的顺序!

就好像微软的一个打包机和袋子(C/C++ 编译器中虚函数相关部分),本来是想装烤白薯用的(C++ 面向对象编程),结果另外有一个做煎饼果子(COM 组件)的项目,这时他发现用装烤白薯的打包机和袋子完全可以不用修改地在煎饼果子项目中使用,结果就用了装烤白薯的打包机和袋子装了煎饼果子,只是袋子上的说明不同(class 变 DECLARE_INTERFACE_;virtual 变 STDMETHOD_),其实是完全一模一样,一点不差的东西,没有经过任何的特殊处理!!!!
2013-9-3 22:34
0
雪    币: 208
活跃值: (40)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
14
多谢。

不过我觉得歧义的地方就是“他发现用装烤白薯的打包机和袋子完全可以不用修改地在煎饼果子项目中使用”这个事情。就是说M$的做com的人很熟悉VC的编译器,知道编译器会按照某种明确的方式来排列虚拟函数表,这样,他在com接口只是又重复了一下VC中会形成的东西。
但是否所有的编译器都是这个方式,那可能需要读C++标准了才能确定,不能以VC做为标准。但估计C++标准中不会对编译器的细节进行这么详细的规定,C++标准应该更倾向于源代码级别的标准和通用。
2013-9-3 23:20
0
雪    币: 128
活跃值: (2788)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
15
楼上几位你们会把楼主气死的
2013-9-3 23:27
0
雪    币: 65
活跃值: (60)
能力值: ( LV3,RANK:30 )
在线值:
发帖
回帖
粉丝
16
你说的没错,他是非常了解自家的编译器才这样做的。至于是否所有的编译器都这个样子,你还要看看 C++ 的标准中是否有这样的规定,我是没有看的啦,太长!!!
你自己有空可以看看 gcc 之类的编译器,我只用微软的东西,其它的无能为力!!
2013-9-4 07:39
0
雪    币: 208
活跃值: (40)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
17
也许有一天,我们真的能静下心来读读那些枯燥的标准,就是不知道是那一天。

想起来很多年前还读过一些英文版的RFC,这些年来自己都在干什么啊。
2013-9-4 12:39
0
雪    币: 189
活跃值: (42)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
18
DECLARE_INTERFACE_(IDirect3D9Ex, IDirect3D9)


IDirect3D9Ex继承自IDirect3D9,IDirect3D9Ex的虚表中应有IDirect3D9的所有虚成员.
如IDirect3D9包含RegisterSoftwareDevice则IDirect3D9Ex应也包含有RegisterSoftwareDevice,但是在所列虚表中未列出,所以有些表可能不完整
2013-12-23 12:04
0
游客
登录 | 注册 方可回帖
返回
//