¿Cómo eliminar a los molestos ntdll.dbgUserBreakPoints

PatchINT3 se basa en el código de Pete Morris

Añadir este procedimiento para su unidad, así como la inicialización
sección siguiente. En tiempo de ejecución, el infractor INT3 será sustituido
por una instrucción NOP.

PatchINT3 procedimiento;
var
NOP: Byte;
BytesWritten: DWORD;
NtDll: THandle;
P: Pointer;
empezar
si Win32Platform <> VER_PLATFORM_WIN32_NT entonces
Exit;

NtDll: = GetModuleHandle ( 'ntdll.dll');
si NtDll = 0 then
Exit;

P: = GetProcAddress (NtDll, 'DbgBreakPoint');
si P = nil entonces
Exit;

intentar
si Car (P ^) <> # $ entonces CC
Exit;

NOP: = $ 90;
si WriteProcessMemory (GetCurrentProcess, P, @ NOP, 1,
BytesWritten) y
(BytesWritten = 1) entonces
FlushInstructionCache (GetCurrentProcess, P, 1);
excepto
/ / Que no cunda el pánico si ve un EAccessViolation aquí,
/ / Es perfectamente inofensiva!
en EAccessViolation hacer;
plantear otra;
final;
final;

inicialización
PatchINT3;

Average rating: