Thema: Delphi DirectX 8 Hook

Einzelnen Beitrag anzeigen

Benutzerbild von Zacherl
Zacherl

Registriert seit: 3. Sep 2004
4.629 Beiträge
 
Delphi 10.2 Tokyo Starter
 
#8

Re: DirectX 8 Hook

  Alt 23. Aug 2009, 15:45
Code:
oldDirect3DCreate8 := GetProcAddress(GetModuleHandle('d3d8.dll'), 'Direct3DCreate8');
      if not(HookCode( @oldDirect3DCreate8, @callbackDirect3DCreate8, @newDirect3DCreate8)) then
        MessageBox(0, 'Direct3DCreate8 hooking failed', 'Information', MB_ICONINFORMATION);
mache mal zu

Code:
oldDirect3DCreate8 := GetProcAddress(LoadLibrary('d3d8.dll'), 'Direct3DCreate8');
      if not(HookCode( @oldDirect3DCreate8, @callbackDirect3DCreate8, @newDirect3DCreate8)) then
        MessageBox(0, 'Direct3DCreate8 hooking failed', 'Information', MB_ICONINFORMATION);
und

Code:
function callbackDirect3DCreate8( D3D_SDK_VERSION: cardinal ): IDirect3D8; stdcall;
begin
  Result := oldDirect3DCreate8(D3D_SDK_VERSION);
  MessageBox(0, 'callbackDirect3DCreate8', 'Information', MB_ICONINFORMATION);
end;
wird zu

Code:
function callbackDirect3DCreate8( D3D_SDK_VERSION: cardinal ): IDirect3D8; stdcall;
begin
  Result := newDirect3DCreate8(D3D_SDK_VERSION);
  MessageBox(0, 'callbackDirect3DCreate8', 'Information', MB_ICONINFORMATION);
end;
  Mit Zitat antworten Zitat