![]() |
Debugger-Meldung "ntdll.DbgBreakPoint" verhindern
Es kann vorkommen, dass sich ein Programm einwandfrei kompillieren lässt, jedoch beim Start aus Delphi nach einiger Zeit das CPU-Fenster geöffnet wird.
Dort steht dann häufig Zitat:
Microsoft hat ein paar Dlls versehentlich mit Debug-Informationen ausgeliefert, die noch Breakpoints enthalten, was der Debugger natürlich meldet. Man muss in so einem Falle zur Laufzeit den Code patchen. ;) Das macht man folgendermaßen:
Delphi-Quellcode:
Diesen Code hat
procedure PatchINT3;
var NOP : Byte; NTDLL: THandle; BytesWritten: DWORD; Address: Pointer; begin 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 not panic if you see an EAccessViolation here, it is perfectly harmless! on EAccessViolation do ; else raise; end; end; initialization // nur wenn ein Debugger vorhanden, den Patch ausführen if DebugHook<>0 then PatchINT3; end. ![]() ![]() |
Alle Zeitangaben in WEZ +1. Es ist jetzt 19:33 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