Re: Hooking D3Device8 by replacing the VTable fails. Info needed.



Hello Paul

Thanks for your reply. I think I have to take some time to sit down and
read that carefully.

Regards,
Rudy Wieser


-- Origional message
Paul Roussin <proussin@xxxxxxxxxxxxx> schreef in berichtnieuws
e0e$biJjJHA.1168@xxxxxxxxxxxxxxxxxxxxxxx
The end of the table is obvious if you have symbols :). Many of the tables
have addresses where the first two or three hex digits are the same. Often
there table is followed by zeros or a value wildly different than the what
you would expect for an address. I also check that the value is within the
range the of the loaded module the table is found within. There a few
occasions where one table is followed by another but I can't remember with
respect to what.

If the values in the table point to the beginning of a function then they
are not stored variables. don't move the tables, I copy them to a array
of
pointers (pointers so the symbols will be displayed). I copy the entire
table and have had no ill effects except in DirectX 7 where a couple of
calls were hard wired; a bug in my opinion. Putting the table into an
array
of pointers will spit out all of the function names but you need to use
symbols.

Private in my jargon only means the public interface supplied in the
h-files
does not expose the entire table. I would only guess that internally they
can overide the calls the public interface does not expose. (I do :))

One of the calls in the hidden area is used to detect when the resource
count goes to zero. Then it destroys the DirectX device, deletes the
memory
for it, and decrements the resource count so the return from
device->Release() returns zero. If you create any resources of your own
the
device destruction call will never take place and most games will raise an
exception.

I like assembler too, but getting the table below is easy in C.

Here is the DirectX 9.0C Vtable. It is offset one count. I hope that helps
your curiosity :).

QueryInterface is really at index zero.
I believe from the include file that This is the last public function:
STDMETHOD(CreateQuery)(THIS_ D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery)
PURE;
All functions after that are no visible unless we cheat :).

I actually vector the hidden scalar deleting destructor to me.

CreateQuery is at 0x77 here and 0x76 in the actual table.
+ [0x1] 0x4fe10430 CBaseDevice::QueryInterface(struct _GUID const &,void
*
*) unsigned long *
+ [0x2] 0x4fe0fa00 CBaseDevice::AddRef(void) unsigned long *
+ [0x3] 0x4fe103f0 CBaseDevice::Release(void) unsigned long *
+ [0x4] 0x4fe10fb0 CBaseDevice::TestCooperativeLevel(void) unsigned long
*
+ [0x5] 0x4fe113d0 CBaseDevice::GetAvailableTextureMem(void) unsigned
long
*
+ [0x6] 0x4fe56dc0 CD3DBase::EvictManagedResources(void) unsigned long *
+ [0x7] 0x4fe11210 CBaseDevice::GetDirect3D(struct IDirect3D9 * *)
unsigned
long *
+ [0x8] 0x4fe12800 CBaseDevice::GetDeviceCaps(struct _D3DCAPS9 *)
unsigned
long *
+ [0x9] 0x4fe11330 CBaseDevice::GetDisplayMode(unsigned int,struct
_D3DDISPLAYMODE *) unsigned long *
+ [0xa] 0x4fe112b0 CBaseDevice::GetCreationParameters(struct
_D3DDEVICE_CREATION_PARAMETERS *) unsigned long *
+ [0xb] 0x4fe10850 CBaseDevice::SetCursorProperties(unsigned int,unsigned
int,struct IDirect3DSurface9 *) unsigned long *
+ [0xc] 0x4fe10a00 CBaseDevice::SetCursorPosition(int,int,unsigned long)
unsigned long *
+ [0xd] 0x4fe10ab0 CBaseDevice::ShowCursor(int) unsigned long *
+ [0xe] 0x4fe10570 CBaseDevice::CreateAdditionalSwapChain(struct
_D3DPRESENT_PARAMETERS_ *,struct IDirect3DSwapChain9 * *) unsigned long *
+ [0xf] 0x4fe10790 CBaseDevice::GetSwapChain(unsigned int,struct
IDirect3DSwapChain9 * *) unsigned long *
+ [0x10] 0x4fe10710 CBaseDevice::GetNumberOfSwapChains(void) unsigned
long
*
+ [0x11] 0x4fe136b0 CBaseDevice::Reset(struct _D3DPRESENT_PARAMETERS_ *)
unsigned long *
+ [0x12] 0x4fe10ea0 CBaseDevice::Present(struct tagRECT const *,struct
tagRECT const *,struct HWND__ *,struct _RGNDATA const *) unsigned long *
+ [0x13] 0x4fe10dc0 CBaseDevice::GetBackBuffer(unsigned int,unsigned
int,enum _D3DBACKBUFFER_TYPE,struct IDirect3DSurface9 * *) unsigned long *
+ [0x14] 0x4fe11180 CBaseDevice::GetRasterStatus(unsigned int,struct
_D3DRASTER_STATUS *) unsigned long *
+ [0x15] 0x4fe10b80 CBaseDevice::SetDialogBoxMode(int) unsigned long *
+ [0x16] 0x4fe10c70 CBaseDevice::SetGammaRamp(unsigned int,unsigned
long,struct _D3DGAMMARAMP const *) unsigned long *
+ [0x17] 0x4fe10d20 CBaseDevice::GetGammaRamp(unsigned int,struct
_D3DGAMMARAMP *) unsigned long *
+ [0x18] 0x4fe11bc0 CBaseDevice::CreateTexture(unsigned int,unsigned
int,unsigned int,unsigned long,enum _D3DFORMAT,enum _D3DPOOL,struct
IDirect3DTexture9 * *,void * *) unsigned long *
+ [0x19] 0x4fe11c90 CBaseDevice::CreateVolumeTexture(unsigned
int,unsigned
int,unsigned int,unsigned int,unsigned long,enum _D3DFORMAT,enum
_D3DPOOL,struct IDirect3DVolumeTexture9 * *,void * *) unsigned long *
+ [0x1a] 0x4fe11d70 CBaseDevice::CreateCubeTexture(unsigned int,unsigned
int,unsigned long,enum _D3DFORMAT,enum _D3DPOOL,struct
IDirect3DCubeTexture9
* *,void * *) unsigned long *
+ [0x1b] 0x4fe12000 CBaseDevice::CreateVertexBuffer(unsigned int,unsigned
long,unsigned long,enum _D3DPOOL,struct IDirect3DVertexBuffer9 * *,void *
*)
unsigned long *
+ [0x1c] 0x4fe120d0 CBaseDevice::CreateIndexBuffer(unsigned int,unsigned
long,enum _D3DFORMAT,enum _D3DPOOL,struct IDirect3DIndexBuffer9 * *,void *
*) unsigned long *
+ [0x1d] 0x4fe11e40 CBaseDevice::CreateRenderTarget(unsigned int,unsigned
int,enum _D3DFORMAT,enum _D3DMULTISAMPLE_TYPE,unsigned long,int,struct
IDirect3DSurface9 * *,void * *) unsigned long *
+ [0x1e] 0x4fe11f20 CBaseDevice::CreateDepthStencilSurface(unsigned
int,unsigned int,enum _D3DFORMAT,enum _D3DMULTISAMPLE_TYPE,unsigned
long,int,struct IDirect3DSurface9 * *,void * *) unsigned long *
+ [0x1f] 0x4fe13f00 CBaseDevice::UpdateSurface(struct IDirect3DSurface9
*,struct tagRECT const *,struct IDirect3DSurface9 *,struct tagPOINT const
*)
unsigned long *
+ [0x20] 0x4fe11ab0 CBaseDevice::UpdateTexture(struct
IDirect3DBaseTexture9
*,struct IDirect3DBaseTexture9 *) unsigned long *
+ [0x21] 0x4fe13d50 CBaseDevice::GetRenderTargetData(struct
IDirect3DSurface9 *,struct IDirect3DSurface9 *) unsigned long *
+ [0x22] 0x4fe12a10 CBaseDevice::GetFrontBufferData(unsigned int,struct
IDirect3DSurface9 *) unsigned long *
+ [0x23] 0x4fe143a0 CBaseDevice::StretchRect(struct IDirect3DSurface9
*,struct tagRECT const *,struct IDirect3DSurface9 *,struct tagRECT const
*,enum _D3DTEXTUREFILTERTYPE) unsigned long *
+ [0x24] 0x4fe13150 CBaseDevice::ColorFill(struct IDirect3DSurface9
*,struct tagRECT const *,unsigned long) unsigned long *
+ [0x25] 0x4fe13540 CBaseDevice::CreateOffscreenPlainSurface(unsigned
int,unsigned int,enum _D3DFORMAT,enum _D3DPOOL,struct IDirect3DSurface9 *
*,void * *) unsigned long *
+ [0x26] 0x4fe572c0 CD3DBase::SetRenderTarget(unsigned long,struct
IDirect3DSurface9 *) unsigned long *
+ [0x27] 0x4fe52c70 CD3DBase::GetRenderTarget(unsigned long,struct
IDirect3DSurface9 * *) unsigned long *
+ [0x28] 0x4fe52d60 CD3DBase::SetDepthStencilSurface(struct
IDirect3DSurface9 *) unsigned long *
+ [0x29] 0x4fe52ea0 CD3DBase::GetDepthStencilSurface(struct
IDirect3DSurface9 * *) unsigned long *
+ [0x2a] 0x4fe57020 CD3DBase::BeginScene(void) unsigned long *
+ [0x2b] 0x4fe571b0 CD3DBase::EndScene(void) unsigned long *
+ [0x2c] 0x4fe55730 CD3DBase::Clear(unsigned long,struct _D3DRECT const
*,unsigned long,unsigned long,float,unsigned long) unsigned long *
+ [0x2d] 0x4fe52af0 CD3DBase::SetTransform(enum
_D3DTRANSFORMSTATETYPE,struct _D3DMATRIX const *) unsigned long *
+ [0x2e] 0x4fe65d70 CD3DHal::GetTransform(enum
_D3DTRANSFORMSTATETYPE,struct _D3DMATRIX *) unsigned long *
+ [0x2f] 0x4fe529c0 CD3DBase::MultiplyTransform(enum
_D3DTRANSFORMSTATETYPE,struct _D3DMATRIX const *) unsigned long *
+ [0x30] 0x4fe52f80 CD3DBase::SetViewport(struct _D3DVIEWPORT9 const *)
unsigned long *
+ [0x31] 0x4fe55f40 CD3DBase::GetViewport(struct _D3DVIEWPORT9 *)
unsigned
long *
+ [0x32] 0x4fe67dd0 CD3DHal::SetMaterial_FP(struct _D3DMATERIAL9 const *)
unsigned long *
+ [0x33] 0x4fe67e80 CD3DHal::GetMaterial(struct _D3DMATERIAL9 *) unsigned
long *
+ [0x34] 0x4fe575b0 CD3DBase::SetLight(unsigned long,struct _D3DLIGHT9
const *) unsigned long *
+ [0x35] 0x4fe67f30 CD3DHal::GetLight(unsigned long,struct _D3DLIGHT9 *)
unsigned long *
+ [0x36] 0x4fe57e40 CD3DBase::LightEnable(unsigned long,int) unsigned
long
*
+ [0x37] 0x4fe68120 CD3DHal::GetLightEnable(unsigned long,int *) unsigned
long *
+ [0x38] 0x4fe53910 CD3DBase::SetClipPlane(unsigned long,float const *)
unsigned long *
+ [0x39] 0x4fe65110 CD3DHal::GetClipPlane(unsigned long,float *) unsigned
long *
+ [0x3a] 0x4fe677f0 CD3DHal::SetRenderState_FP(enum
_D3DRENDERSTATETYPE,unsigned long) unsigned long *
+ [0x3b] 0x4fe65680 CD3DHal::GetRenderState(enum
_D3DRENDERSTATETYPE,unsigned long *) unsigned long *
+ [0x3c] 0x4fe67c80 CD3DBase::CreateStateBlock(enum
_D3DSTATEBLOCKTYPE,struct IDirect3DStateBlock9 * *) unsigned long *
+ [0x3d] 0x4fe67070 CD3DBase::BeginStateBlock(void) unsigned long *
+ [0x3e] 0x4fe67af0 CD3DBase::EndStateBlock(struct IDirect3DStateBlock9 *
*) unsigned long *
+ [0x3f] 0x4fe65eb0 CD3DHal::SetClipStatus(struct _D3DCLIPSTATUS9 const
*)
unsigned long *
+ [0x40] 0x4fe65f60 CD3DHal::GetClipStatus(struct _D3DCLIPSTATUS9 *)
unsigned long *
+ [0x41] 0x4fe579e0 CD3DBase::GetTexture(unsigned long,struct
IDirect3DBaseTexture9 * *) unsigned long *
+ [0x42] 0x4fe65a30 CD3DHal::SetTexture_FP(unsigned long,struct
IDirect3DBaseTexture9 *) unsigned long *
+ [0x43] 0x4fe65800 CD3DHal::GetTextureStageState(unsigned long,enum
_D3DTEXTURESTAGESTATETYPE,unsigned long *) unsigned long *
+ [0x44] 0x4fe67990 CD3DHal::SetTextureStageState_FP(unsigned long,enum
_D3DTEXTURESTAGESTATETYPE,unsigned long) unsigned long *
+ [0x45] 0x4fe65b10 CD3DHal::GetSamplerState(unsigned long,enum
_D3DSAMPLERSTATETYPE,unsigned long *) unsigned long *
+ [0x46] 0x4fe65960 CD3DHal::SetSamplerState_FP(unsigned long,enum
_D3DSAMPLERSTATETYPE,unsigned long) unsigned long *
+ [0x47] 0x4fe6ae50 CD3DHal::ValidateDevice(unsigned long *) unsigned
long
*
+ [0x48] 0x4fe58010 CD3DBase::SetPaletteEntries(unsigned int,struct
tagPALETTEENTRY const *) unsigned long *
+ [0x49] 0x4fe53820 CD3DBase::GetPaletteEntries(unsigned int,struct
tagPALETTEENTRY *) unsigned long *
+ [0x4a] 0x4fe53660 CD3DBase::SetCurrentTexturePalette(unsigned int)
unsigned long *
+ [0x4b] 0x4fe53780 CD3DBase::GetCurrentTexturePalette(unsigned int *)
unsigned long *
+ [0x4c] 0x4fe574c0 CD3DBase::SetScissorRect(struct tagRECT const *)
unsigned long *
+ [0x4d] 0x4fe530d0 CD3DBase::GetScissorRect(struct tagRECT *) unsigned
long *
+ [0x4e] 0x4fe67630 CD3DHal::SetSoftwareVertexProcessing(int) unsigned
long
*
+ [0x4f] 0x4fe65410 CD3DHal::GetSoftwareVertexProcessing(void) unsigned
long *
+ [0x50] 0x4fe65310 CD3DBase::SetNPatchMode(float) unsigned long *
+ [0x51] 0x4fe50fb0 CD3DBase::GetNPatchMode(void) unsigned long *
+ [0x52] 0x4fe586f0 CD3DBase::DrawPrimitive(enum
_D3DPRIMITIVETYPE,unsigned
int,unsigned int) unsigned long *
+ [0x53] 0x4fe58840 CD3DBase::DrawIndexedPrimitive(enum
_D3DPRIMITIVETYPE,int,unsigned int,unsigned int,unsigned int,unsigned int)
unsigned long *
+ [0x54] 0x4fe58980 CD3DBase::DrawPrimitiveUP(enum
_D3DPRIMITIVETYPE,unsigned int,void const *,unsigned int) unsigned long *
+ [0x55] 0x4fe58bd0 CD3DBase::DrawIndexedPrimitiveUP(enum
_D3DPRIMITIVETYPE,unsigned int,unsigned int,unsigned int,void const *,enum
_D3DFORMAT,void const *,unsigned int) unsigned long *
+ [0x56] 0x4fe69e50 CD3DHal::ProcessVertices(unsigned int,unsigned
int,unsigned int,struct IDirect3DVertexBuffer9 *,struct
IDirect3DVertexDeclaration9 *,unsigned long) unsigned long *
+ [0x57] 0x4fe61f70 CD3DBase::CreateVertexDeclaration(struct
_D3DVERTEXELEMENT9 const *,struct IDirect3DVertexDeclaration9 * *)
unsigned
long *
+ [0x58] 0x4fe54550 CD3DBase::SetVertexDeclaration(struct
IDirect3DVertexDeclaration9 *) unsigned long *
+ [0x59] 0x4fe54680 CD3DBase::GetVertexDeclaration(struct
IDirect3DVertexDeclaration9 * *) unsigned long *
+ [0x5a] 0x4fe64c80 CD3DHal::SetFVF_FP(unsigned long) unsigned long *
+ [0x5b] 0x4fe581d0 CD3DBase::GetFVF(unsigned long *) unsigned long *
+ [0x5c] 0x4fe620f0 CD3DBase::CreateVertexShader(unsigned long const
*,struct IDirect3DVertexShader9 * *) unsigned long *
+ [0x5d] 0x4fe62a30 CD3DHal::SetVertexShader_FP(struct
IDirect3DVertexShader9 *) unsigned long *
+ [0x5e] 0x4fe62cd0 CD3DHal::GetVertexShader(struct
IDirect3DVertexShader9
* *) unsigned long *
+ [0x5f] 0x4fe5a480 CD3DBase::SetVertexShaderConstantF_FP(unsigned
int,float const *,unsigned int) unsigned long *
+ [0x60] 0x4fe561b0 CD3DBase::GetVertexShaderConstantF(unsigned int,float
*,unsigned int) unsigned long *
+ [0x61] 0x4fe5a620 CD3DBase::SetVertexShaderConstantI_FP(unsigned
int,int
const *,unsigned int) unsigned long *
+ [0x62] 0x4fe56300 CD3DBase::GetVertexShaderConstantI(unsigned int,int
*,unsigned int) unsigned long *
+ [0x63] 0x4fe5a7a0 CD3DBase::SetVertexShaderConstantB_FP(unsigned
int,int
const *,unsigned int) unsigned long *
+ [0x64] 0x4fe56450 CD3DBase::GetVertexShaderConstantB(unsigned int,int
*,unsigned int) unsigned long *
+ [0x65] 0x4fe53b20 CD3DBase::SetStreamSource_FP(unsigned int,struct
IDirect3DVertexBuffer9 *,unsigned int,unsigned int) unsigned long *
+ [0x66] 0x4fe53c60 CD3DBase::GetStreamSource(unsigned int,struct
IDirect3DVertexBuffer9 * *,unsigned int *,unsigned int *) unsigned long *
+ [0x67] 0x4fe53e70 CD3DBase::SetStreamSourceFreq_FP(unsigned
int,unsigned
int) unsigned long *
+ [0x68] 0x4fe53f80 CD3DBase::GetStreamSourceFreq(unsigned int,unsigned
int
*) unsigned long *
+ [0x69] 0x4fe54140 CD3DBase::SetIndices_FP(struct IDirect3DIndexBuffer9
*)
unsigned long *
+ [0x6a] 0x4fe542a0 CD3DBase::GetIndices(struct IDirect3DIndexBuffer9 *
*)
unsigned long *
+ [0x6b] 0x4fe5a8f0 CD3DBase::CreatePixelShader(unsigned long const
*,struct IDirect3DPixelShader9 * *) unsigned long *
+ [0x6c] 0x4fe69b50 CD3DHal::SetPixelShader_FP(struct
IDirect3DPixelShader9
*) unsigned long *
+ [0x6d] 0x4fe68f40 CD3DHal::GetPixelShader(struct IDirect3DPixelShader9
*
*) unsigned long *
+ [0x6e] 0x4fe5ab20 CD3DBase::SetPixelShaderConstantF_FP(unsigned
int,float
const *,unsigned int) unsigned long *
+ [0x6f] 0x4fe69000 CD3DHal::GetPixelShaderConstantF(unsigned int,float
*,unsigned int) unsigned long *
+ [0x70] 0x4fe5acc0 CD3DBase::SetPixelShaderConstantI_FP(unsigned int,int
const *,unsigned int) unsigned long *
+ [0x71] 0x4fe690d0 CD3DHal::GetPixelShaderConstantI(unsigned int,int
*,unsigned int) unsigned long *
+ [0x72] 0x4fe5ae40 CD3DBase::SetPixelShaderConstantB_FP(unsigned int,int
const *,unsigned int) unsigned long *
+ [0x73] 0x4fe691a0 CD3DHal::GetPixelShaderConstantB(unsigned int,int
*,unsigned int) unsigned long *
+ [0x74] 0x4fe553b0 CD3DBase::DrawRectPatch(unsigned int,float const
*,struct _D3DRECTPATCH_INFO const *) unsigned long *
+ [0x75] 0x4fe554b0 CD3DBase::DrawTriPatch(unsigned int,float const
*,struct _D3DTRIPATCH_INFO const *) unsigned long *
+ [0x76] 0x4fe555b0 CD3DBase::DeletePatch(unsigned int) unsigned long *
+ [0x77] 0x4fe5a3a0 CD3DBase::CreateQuery(enum _D3DQUERYTYPE,struct
IDirect3DQuery9 * *) unsigned long *
+ [0x78] 0x4fe677f0 CD3DHal::SetRenderState_FP(enum
_D3DRENDERSTATETYPE,unsigned long) unsigned long *
+ [0x79] 0x4fe67990 CD3DHal::SetTextureStageState_FP(unsigned long,enum
_D3DTEXTURESTAGESTATETYPE,unsigned long) unsigned long *
+ [0x7a] 0x4fe65960 CD3DHal::SetSamplerState_FP(unsigned long,enum
_D3DSAMPLERSTATETYPE,unsigned long) unsigned long *
+ [0x7b] 0x4fe67dd0 CD3DHal::SetMaterial_FP(struct _D3DMATERIAL9 const *)
unsigned long *
+ [0x7c] 0x4fe62a30 CD3DHal::SetVertexShader_FP(struct
IDirect3DVertexShader9 *) unsigned long *
+ [0x7d] 0x4fe5a480 CD3DBase::SetVertexShaderConstantF_FP(unsigned
int,float const *,unsigned int) unsigned long *
+ [0x7e] 0x4fe5a620 CD3DBase::SetVertexShaderConstantI_FP(unsigned
int,int
const *,unsigned int) unsigned long *
+ [0x7f] 0x4fe5a7a0 CD3DBase::SetVertexShaderConstantB_FP(unsigned
int,int
const *,unsigned int) unsigned long *
+ [0x80] 0x4fe69b50 CD3DHal::SetPixelShader_FP(struct
IDirect3DPixelShader9
*) unsigned long *
+ [0x81] 0x4fe5ab20 CD3DBase::SetPixelShaderConstantF_FP(unsigned
int,float
const *,unsigned int) unsigned long *
+ [0x82] 0x4fe5acc0 CD3DBase::SetPixelShaderConstantI_FP(unsigned int,int
const *,unsigned int) unsigned long *
+ [0x83] 0x4fe5ae40 CD3DBase::SetPixelShaderConstantB_FP(unsigned int,int
const *,unsigned int) unsigned long *
+ [0x84] 0x4fe64c80 CD3DHal::SetFVF_FP(unsigned long) unsigned long *
+ [0x85] 0x4fe65a30 CD3DHal::SetTexture_FP(unsigned long,struct
IDirect3DBaseTexture9 *) unsigned long *
+ [0x86] 0x4fe54140 CD3DBase::SetIndices_FP(struct IDirect3DIndexBuffer9
*)
unsigned long *
+ [0x87] 0x4fe53b20 CD3DBase::SetStreamSource_FP(unsigned int,struct
IDirect3DVertexBuffer9 *,unsigned int,unsigned int) unsigned long *
+ [0x88] 0x4fe53e70 CD3DBase::SetStreamSourceFreq_FP(unsigned
int,unsigned
int) unsigned long *
+ [0x89] 0x4fe50fd0 CD3DHal::UpdateRenderState(unsigned long,unsigned
long)
unsigned long *
+ [0x8a] 0x4fe65be0 CD3DHal::SetTransformI(enum
_D3DTRANSFORMSTATETYPE,struct _D3DMATRIX const *) unsigned long *
+ [0x8b] 0x4fe66e70 CD3DHal::MultiplyTransformI(enum
_D3DTRANSFORMSTATETYPE,struct _D3DMATRIX const *) unsigned long *
+ [0x8c] 0x4fe650a0 CD3DHal::SetClipPlaneI(unsigned long,float const *)
unsigned long *
+ [0x8d] 0x4fe64c90 CD3DHal::UpdateDriverStates(void) unsigned long *
+ [0x8e] 0x4fe68940 CD3DHal::SetViewportI(struct _D3DVIEWPORT9 const *)
unsigned long *
+ [0x8f] 0x4fe63110 CD3DHal::SetStreamSourceI(struct CVStream *) unsigned
long *
+ [0x90] 0x4fe62a40 CD3DHal::SetVertexShaderConstantIntF(unsigned
int,float
const *,unsigned int) unsigned long *
+ [0x91] 0x4fe62af0 CD3DHal::SetVertexShaderConstantIntI(unsigned int,int
const *,unsigned int) unsigned long *
+ [0x92] 0x4fe63170 CD3DHal::SetVertexShaderConstantIntB(unsigned int,int
const *,unsigned int) unsigned long *
+ [0x93] 0x4fe63550 CD3DHal::DrawPointsI(enum _D3DPRIMITIVETYPE,unsigned
int,unsigned int) unsigned long *
+ [0x94] 0x4fe68460 CD3DHal::SetLightI(unsigned long,struct _D3DLIGHT9
const *) unsigned long *
+ [0x95] 0x4fe68030 CD3DHal::LightEnableI(unsigned long,int) unsigned
long
*
+ [0x96] 0x4fe67940 CD3DHal::SetRenderStateInternal(enum
_D3DRENDERSTATETYPE,unsigned long) unsigned long *
+ [0x97] 0x4fe636d0 CD3DHal::DrawPrimitiveUPI(enum
_D3DPRIMITIVETYPE,unsigned int) unsigned long *
+ [0x98] 0x4fe63860 CD3DHal::DrawIndexedPrimitiveUPI(enum
_D3DPRIMITIVETYPE,unsigned int,unsigned int,unsigned int) unsigned long *
+ [0x99] 0x4fe51c00 CD3DHal::ClearI(unsigned long,struct _D3DRECT const
*,unsigned long,unsigned long,float,unsigned long) unsigned long *
+ [0x9a] 0x4fe64570 CD3DHal::PickDrawPrimFn(void) unsigned long *
+ [0x9b] 0x4fe64780 CD3DHal::UpdateVShader(void) unsigned long *
+ [0x9c] 0x4fe63220 CD3DHal::ValidateDraw(enum _D3DPRIMITIVETYPE,unsigned
int,unsigned int,unsigned int,int,unsigned int,int) unsigned long *
+ [0x9d] 0x4fe51d80 CD3DHal::InitDevice(void) unsigned long *
+ [0x9e] 0x4fe50ff0 CD3DHal::StateInitialize(int) unsigned long *
+ [0x9f] 0x4fe52440 CD3DHal::Destroy(void) unsigned long *
+ [0xa0] 0x4fe52650 CD3DHal::`scalar deleting destructor'(unsigned int)
unsigned long *
End of table
Trailing data
+ [0xa1] 0x00000000 unsigned long *
+ [0xa2] 0x00000000 unsigned long *
+ [0xa3] 0x00000000 unsigned long *
+ [0xa4] 0x00000000 unsigned long *
+ [0xa5] 0x00000000 unsigned long *
+ [0xa6] 0x3f800000 unsigned long *








"R.Wieser" <address@xxxxxxxxxxxxx> wrote in message
news:OaoznhRhJHA.996@xxxxxxxxxxxxxxxxxxxxxxx
Hello Paul,

If you load the symbols for DX8 you should be able to look at the
addresses and see what those functions are.

Alas, I'm not using C... for my experiments, but assembly (and have no
(easy) way of loading or looking at those symbols).

The end of the table is kind of obvious.

Well, that is (partly) why I posted my question : looking at the values
in
that VTable I could not find such an obvious end, nor did I google any
information in that regard.

Allso, I was 'afraid' that some of those values could be stored
variables
(and moving them around would wreak havock on the DirectX, and by
association my own system).

If you are going to hook the D3D device table that way then you
will have to hook calls like BeginStateBlock and EndStateBlock

Thanks for this, it gives me something to google for.

If you store the table in an array of pointers then the symbols will
work there to and you can set a watch on your table and see what
all of the private calls are. It is kind of neat to look at it.

:-) That is partly why I posted the question to. Plain curiosity to
whats
going on.

A question though : why are those private calls part of the VTable, and
not
simply direct calls to their own code ?

Regards,
Rudy Wieser


-- Origional message
Paul Roussin <proussin@xxxxxxxxxxxxx> schreef in berichtnieuws
OEkFW3ChJHA.4932@xxxxxxxxxxxxxxxxxxxxxxx
In a class some functions are public and some are private.

If you load the symbols for DX8 you should be able to look at the
addresses
and see what those functions are.

If you are going to hook the D3D device table that way then you will
have
to
hook calls like BeginStateBlock and EndStateBlock . BeginStateblock
will
reset the device table so you have to make the code return control back
to
you so you can reset your modified addresses. In other words you have
to
make the call.

If you change the vtable pointer to your local table then you need to
copy
all of the private pointers as well, there is no half way measure. The
end
of the table is kind of obvious.

If you store the table in an array of pointers then the symbols will
work
there to and you can set a watch on your table and see what all of the
private calls are. It is kind of neat to look at it.

Paul







.



Relevant Pages


Loading