HelpSetStreamSource hook error

Posts 14 of 4 · Page 1 of 1
SetStreamSource hook error
dunno what im doing wrong,, got dip function to work,, can anyone help? im trying to follow a tutorial on chams w/o d3dstarterkit


int TheHook(void)
{
DWORD hD3D, adr, *vtbl;
hD3D=0;
do {
hD3D = (DWORD)GetModuleHandle("d3d9.dll");
Sleep(10);
} while(!hD3D);
adr = FindPattern(hD3D, 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x 00\x00\x89\x86", "xx????xx????xx");
if (adr)
{
memcpy(&vtbl,(void *)(adr+2),4);
pReset = (oReset) DetourFunction((PBYTE)vtbl[16] , (PBYTE)Reset ,5);
pEndScene = (oEndScene) DetourFunction((PBYTE)vtbl[42], (PBYTE)EndScene,5);
pDIP = (oDIP) DetourFunction((PBYTE)vtbl[82], (PBYTE)myDIP,5);
//pSetStreamSource = (oSetStreamSource) DetourFunction((PBYTE)vtbl[100], (PBYTE)SetStreamSource,5);
}
return 0;
}

// the function

/*
HRESULT WINAPI SetStreamSource(UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride)
{

if( StreamNumber == 0 ){m_Stride = Stride;}
return m_pD3Ddev->SetStreamSource(StreamNumber, pStreamData,OffsetInBytes, Stride);
}
*/

//globals
//oSetStreamSource pSetStreamSource;

// base.h
/pedef HRESULT (WINAPI* oSetStreamSource)(LPDIRECT3DDEVICE9 pDevice,UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride);
Lol this mehod is so old and unneeded ^^
Why not use pDevice if you have it in DIP?
What about:
Code:
if(pDevice->GetStreamSource(0,&StreamBuffer,&OffsetInBytes,&m_Stride) == D3D_OK)
	StreamBuffer->Release();
ill try that and thx 4 the quick reply, gotta go for a few hours ill let u know later how it works 4 me
Sry for dp, last was yesterday,,, im getting another problem now, i followed a tutorial fo chams, the tut was on a different game then i was working on,... so now,, my game screen is alll black, my menu is over it but text isnt drawn on menu anymore... lol i been trying to make these chams for to long, i got all models i wanted with d3dlogger
Posts 14 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?