BruNews
Messages postés21040Date d'inscriptionjeudi 23 janvier 2003StatutModérateurDernière intervention21 août 2019
-
17 mars 2005 à 12:16
cs_islanmao
Messages postés7Date d'inscriptionmercredi 30 avril 2003StatutMembreDernière intervention 7 avril 2005
-
17 mars 2005 à 13:46
Question n'est pas de moi, je remets cause l'originale a sauté.
Bonjour tout le monde,
j'ai le code d'une procédure en delphi que j'ai trouvé sur le net, et je voudrais le changer en C++ , pourriez vous m'aider?
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;