Menu Search

Borland Delphi

Warcraft III Hackz: Direct 3D Drawing...
http://ghostplusplus.googlecode.com/files/ghostplusplus_17.1.zip

uses
SysUtils,
windows,
Classes,
BlueHookLib,
Functions,
Direct3D8;

var
pD3D : IDirect3DDevice8;
CreateDeviceNext : function(const Self: Pointer; Adapter: LongWord; DeviceType: TD3DDevType; hFocusWindow: HWND; BehaviorFlags: DWord; pPresentationParameters: PD3DPresentParameters; out ppReturnedDeviceInterface: IDirect3DDevice8): HResult; stdcall = nil;
Direct3DCreate8Next : function(SDKVersion: Cardinal): Pointer; stdcall = nil;
EndSceneNext : function(const Self: Pointer): HResult; stdcall = nil;

function EndSceneCallBack(const Self: Pointer): HResult; stdcall;
begin
result := EndSceneNext(Self);
end;

function CreateDeviceCallback(const Self: Pointer; Adapter: LongWord; DeviceType: TD3DDevType; hFocusWindow: HWND; BehaviorFlags: DWord; pPresentationParameters: PD3DPresentParameters; out ppReturnedDeviceInterface: IDirect3DDevice8): HResult; stdcall;
begin
Result := CreateDeviceNext(Self, Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, ppReturnedDeviceInterface);
pD3D := ppReturnedDeviceInterface;
if (Result = 0) and (@EndSceneNext = nil) then
gHook.HookJMP(GetInterfaceMethod(ppReturnedDeviceInterface, 42), @EndSceneCallBack, @EndSceneNext);
end;

function Direct3DCreate8Callback(SDKVersion: Cardinal): Pointer; stdcall;
begin
Result := Direct3DCreate8Next(SDKVersion);
if not (Result = nil) and (@CreateDeviceNext = nil) then
gHook.HookJMP(GetPtrMethod(Result, 16), @CreateDeviceCallback, @CreateDeviceNext);
end;

var
hlib:THandle;

function Direct3DCreate8(SDKVersion: Cardinal): Pointer; stdcall;
var
WinDir : PChar;
begin
if @Direct3DCreate8Next = nil then
begin
gHook := CDeepHook.Create();

WinDir := StrAlloc(MAX_PATH);
GetSystemDirectory(WinDir, MAX_PATH);
hlib := LoadLibrary(PChar(Windir + ?D3D8.dll'));
gHook.HookJMP(GetProcAddress(hlib, ?Direct3DCreate8') , @Direct3DCreate8Callback, @Direct3DCreate8Next);
end;
Result := Direct3DCreate8Callback(SDKVersion);
end;

http://www.gamedeception.net/threads/20203-REQ-Delphi-Warcraft-3-onscreen-drawing

Liste

Index | List
  • Vorherige
  • Seite #n
  • #n
  • #c
  • Seite #n
  • Nächste
Index | List
  • Vorherige
  • Seite #n
  • #n
  • #c
  • Seite #n
  • Nächste

Index

Index | List
  • Vorherige
  • Seite #n
  • #n
  • #c
  • Seite #n
  • Nächste
Index | List
  • Vorherige
  • Seite #n
  • #n
  • #c
  • Seite #n
  • Nächste

LetzteChance.Org - Links -

PDF/ZIP/Word