AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren

Speicher überwachen

Ein Thema von Neutral General · begonnen am 26. Nov 2009 · letzter Beitrag vom 26. Nov 2009
Antwort Antwort
brechi

Registriert seit: 30. Jan 2004
823 Beiträge
 
#1

Re: Speicher überwachen

  Alt 26. Nov 2009, 18:42
Delphi-Quellcode:
var
  RtlDispatchExceptionNext: function(excRec: PExceptionRecord; excCtxt:
    PContext): integer; stdcall = nil;

function RtlDispatchExceptionCallback(excRec: PExceptionRecord; excCtxt:
  PContext): integer; stdcall;
begin
  result := RtlDispatchExceptionNext(excRec, excCtxt);
  // Exception Handling
end;

procedure InstallExcDispatchHook;
var
  c1, c2: dword;
begin
  c1 := dword(GetProcAddress(GetModuleHandle('ntdll.dll'),
    'KiUserExceptionDispatcher'));
  if Byte(pointer(c1)^) = $FC then
    inc(c1);
  if (dword(pointer(c1)^) = $04244C8B) and // mov ecx, [esp+4] ; PContext
  (dword(pointer(c1 + 4)^) and $00FFFFFF = $241C8B) and
    // mov ebx, [esp+0] ; PExceptionRecord
  (byte(pointer(c1 + 7)^) = $51) and // push ecx
  (byte(pointer(c1 + 8)^) = $53) and // push ebx
  (byte(pointer(c1 + 9)^) = $E8) and // call RtlDispatchException
  VirtualProtect(pointer(c1 + 10), 4, PAGE_EXECUTE_READWRITE, c2) then
  begin
    RtlDispatchExceptionNext := pointer(c1 + 14 + dword(pointer(c1 + 10)^));
    dword(pointer(c1 + 10)^) := dword(@RtlDispatchExceptionCallback) - c1 - 14;
    VirtualProtect(pointer(c1 + 10), 4, c2, c2);
  end;
end;
Sollte ab Windows2k funktionieren.

ReadProcessMemory verursacht übrigens keine Exception. Und mit VirtualProtectEx wirst du nichts mitbekommen...
  Mit Zitat antworten Zitat
Antwort Antwort

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:52 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz