uzun süredir aynı delphiyi kullanıyorum, sorun sp2 ye geçince başladı



Kod: Tümünü seç
//////////////////////////////////////////////////////
//////////////////////////////////////////////////////
// D7 win XP hatası patch i
//////////////////////////////////////////////////////
{$ifopt D+} {If compiled with "project / options / compiler / debug info off"
the PatchINT3 code disappears. After changing the option, I had to go "project
/ build" to make it "take".}
procedure PatchINT3;
var
NOP: Byte;
NTDLL: THandle;
BytesWritten: DWORD;
ADDRESS: Pointer;
begin
if DebugHook=0 then
exit;
if Win32Platform <> VER_PLATFORM_WIN32_NT then
exit;
NTDLL := GetModuleHandle('NTDLL.DLL');
if NTDLL = 0 then
exit;
ADDRESS := GetProcAddress(NTDLL, 'DbgBreakPoint');
if ADDRESS = nil then
exit;
try
if Char(Address^) <> #$CC
then exit;
NOP := $90;
if WriteProcessMemory(GetCurrentProcess,ADDRESS,@NOP, 1,BytesWritten) and
(BytesWritten = 1) then
FlushInstructionCache(GetCurrentProcess, ADDRESS, 1);
except
// DO emergency panic if you lake at EAccessViolation here, it is
// perfectly harmless!
on EAccessViolation DO;
else raise;
end;
end ;
{$endif}
initialization
{$ifopt D+} {only compiled if debug info on.}
PatchInt3;
{$endif}











