Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: CPU Window

6 views
Skip to first unread message

Dennis Passmore

unread,
Jul 28, 2008, 1:45:24 PM7/28/08
to
On Mon, 28 Jul 2008 11:17:14 -0300, Neo <neom...@hotmail.com> wrote:

>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.

0 new messages