Delphi ===> C++

cs_islanmao Messages postés 7 Date d'inscription mercredi 30 avril 2003 Statut Membre Dernière intervention 7 avril 2005 - 17 mars 2005 à 11:48
japee Messages postés 1727 Date d'inscription vendredi 27 décembre 2002 Statut Modérateur Dernière intervention 6 novembre 2021 - 19 mars 2005 à 12:34
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;

Merci :))

1 réponse

japee Messages postés 1727 Date d'inscription vendredi 27 décembre 2002 Statut Modérateur Dernière intervention 6 novembre 2021 8
19 mars 2005 à 12:34
Il a été répondu à ta question ici :



http://www.cppfrance.com/forum.v2.aspx?ID=414033



Merci de nous l'avoir signalé



Bonne prog'
0
Rejoignez-nous