Einzelnen Beitrag anzeigen

NicoDE
(Gast)

n/a Beiträge
 
#4

Re: c++ zu delphi (kleines snippet)

  Alt 23. Aug 2006, 08:57
Zitat von smc:
will eigentl. nur wissen das da genau passiert,
Hier mal eine 1:1 Übersetzung:
Delphi-Quellcode:
procedure stilleto_Hook(pstilletoHook: PDWORD; dwstilletoOffset: DWORD);
var
  dwOldProtect: DWORD;
begin
  g_stilletoOffset := dwstilletoOffset;

  if (pstilletoHook <> nil) and (g_stilletoOffset <> 0) and
    VirtualProtect(pstilletoHook, 4, PAGE_EXECUTE_READWRITE, dwOldProtect) then
  begin
    g_pOrigstilletoFunc := pstilletoHook^ + (ULONG(pstilletoHook) + 4);
    pstilletoHook^ := ULONG(stilleto_Stub) - (ULONG(pstilletoHook) + 4);
    VirtualProtect(pstilletoHook, 4, dwOldProtect, dwOldProtect);
  end;
end;
  Mit Zitat antworten Zitat