>This Window appear when my code make a dll call to comunicate with a USB
> device (something like hardlock USB). This DLL is provided by the USB
> device manufacturer.
>Ssounds like this manufacturer has forgotten a breakpoint in the DLL.
you could just add this unit to your application and see if it helps
unit zDebugCPUbeGone;
interface
uses
Windows, Messages, SysUtils, Variants, Classes;
procedure PatchINT3;
implementation
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
begin
PatchINT3;
end;
end.