/*-------------------------------------------------------------------------------------------
* File: Defines the entry point for the console application.
* Autor: ZeRoKiLLeR
* Date: 11/05/2010
* Based On: OSH Tut 11 by KN4CK3R
* ------------------------------------------------------------------------------------------- */
// Direct 3D Lib Include (VS 2010 Beta Suxx)
#pragma once
#pragma comment (lib, "C:\Programme\Microsoft DirectX SDK (June 2007)\Lib\x86\d3d9.lib")
#pragma comment (lib, "C:\Programme\Microsoft DirectX SDK (June 2007)\Lib\x86\d3dx9.lib")
// Direct 3D Include (VS 2010 Beta Suxx)
#include "C:\Programme\Microsoft DirectX SDK (June 2007)\Include\d3d9.h"
#include "C:\Programme\Microsoft DirectX SDK (June 2007)\Include\d3dx9.h"
// Standard Windows Functions
#include "WINDOWS.H"
// Standard Input/Output
#include "STDIO.H"
// Others --> o.0
#include "TCHAR.H"
/* ------------------------------------------------------------------------------------------- */
// Found by OllyDbg
/*
0040143F |> 90 |NOP
00401440 |. 90 |NOP
00401441 |. 90 |NOP
00401442 |. A1 708C4200 |MOV EAX,DWORD PTR DS:[428C70]
00401447 |. 8B08 |MOV ECX,DWORD PTR DS:[EAX]
00401449 |. 50 |PUSH EAX
0040144A |. FF91 88000000 |CALL DWORD PTR DS:[ECX+88] --> ECX = 0014E238, + 88 = 14E2C0
00401450 |. 85C0 |TEST EAX,EAX
00401452 |. 7C 31 |JL SHORT DXWindow.00401485
00401454 |. 90 |NOP
00401455 |. 90 |NOP
00401456 |. 90 |NOP
*/
DWORD dwBeginScene = 0x0040144A; // <-- o.0?
// -----------------------------
typedef void (*oBeginScene) ();
oBeginScene pBeginScene;
// -----------------------------
IDirect3DDevice9* device;
bool bBeginScene = false;
// -----------------------------------------
// Entry Point of the Application
int _tmain(int argc, _TCHAR* argv[])
{
while(true)
{
/* What to do here ?
*
* I'll draw something to the Device. But how ? o.0
*
*/
// Paused for 1 sec
Sleep(1000);
}
return 0;
}
// -----------------------------------------------
// Gets the Device ?
void __declspec(naked) NewBeginScene() // Why '()' ? KN4CK3R not uses those -.-
{
__asm
{
cmp bBeginScene, 0x0 // If bBeginScene = False
jnz _end // Go to End
push eax // Save eax to stack
mov eax, [esp+0x2c+0x4] // mov eax, [esp+0x30]
mov device, eax // Get Device
mov bBeginScene, 0x1 // bBeginScene = True
pop eax // Get saved Device back
jmp [pBeginScene] // Go to normal BeginScene
_end: // End Procedure
jmp [pBeginScene] // Go to normal BeginScene
}
}