Patch the Vtable
What are the steps I would need to take to hook Present/EndScene, so I can draw?
"The best way to predict your future is to create it."
Contributions I made:
DirectX E-Books
Hacking Tools
Hacking into a PC
Need Help?
Send me a PM, or send me a email at : aanthonyz10@gmail.com
Click My Dragon:
OMG. A new computer vocabulary word...what is a VTable?
"The best way to predict your future is to create it."
Contributions I made:
DirectX E-Books
Hacking Tools
Hacking into a PC
Need Help?
Send me a PM, or send me a email at : aanthonyz10@gmail.com
Click My Dragon:
Virtual Table. Its a table of function that a class inherits.
When one class say called Dog is derived from the base class Animal, it can call all the inheritable methods and access all the inheritable data Animal can. This list of virtual functions is stored in memory as a pointer at the beginning of the class structure. Whenever Dog calls a function it inherited from Animal, or one it has overridden the vtable is used.
More Details: Virtual method table - Wikipedia, the free encyclopedia
Last edited by why06; 03-10-2011 at 06:02 AM.
"Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."- Dwight D. Eisenhower
Very good explanation @why06
Nice explanation. Question though, do I need to find the Device Pointer or is this method completely different?
"The best way to predict your future is to create it."
Contributions I made:
DirectX E-Books
Hacking Tools
Hacking into a PC
Need Help?
Send me a PM, or send me a email at : aanthonyz10@gmail.com
Click My Dragon:
or you can simply create a normal device... .. hmm i think i should got the code here, but you can create the temporary device and get the pointer from it.
[highlight=VB.NET]
DWORD VTABLE(int INDEX)
{ DWORD hD3D;
// wait for the d3dx dll
hD3D=0;
do {
hD3D = (DWORD)GetModuleHandleA("d3d9.dll");
Sleep(10);
} while(!hD3D);
LPDIRECT3D9 pD3d9 = NULL;
LPDIRECT3DDEVICE9 pD3DDevice = NULL;
pD3d9 = Direct3DCreate9(D3D_SDK_VERSION);
if(pD3d9 == NULL){
return -1;
}
D3DPRESENT_PARAMETERS pPresentParms;
ZeroMemory(&pPresentParms,sizeof(pPresentParms));
pPresentParms.Windowed = TRUE;
pPresentParms.BackBufferFormat = D3DFMT_UNKNOWN;
pPresentParms.SwapEffect = D3DSWAPEFFECT_DISCARD;
if(FAILED(pD3d9->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,Ge tDesktopWindow(),D3DCREATE_SOFTWARE_VERTEXPROCESSI NG,&pPresentParms,&pD3DDevice))){
return -1;
}
DWORD * dwTable = ( DWORD* )pD3DDevice;
dwTable = ( DWORD* ) dwTable[0];
/*
dwTable[16];//reset
dwTable[17];//present
dwTable[82];//DrawIndexedPrimitive
dwTable[100];//SetStreamSource
dwTable[41];//BeginScene
dwTable[42];//EndScene
*/
return dwTable[INDEX];
}
[/highlight]
Last edited by topblast; 03-31-2011 at 08:20 PM.
I just like programming, that is all.
Current Stuff:
- GPU Programmer (Cuda)
- Client/Server (Cloud Server)
- Mobile App Development