delphi µ÷ÊÔʱ×ܳöÏÖcpu´°¿Ú£¬ntdll.dllµãµÄ½â¾ö·½·¨
ÔÚÖ÷½çÃæµÄimplementation {$R *.dfm} Ï·ÅÈëÒÔÏ´úÂ룺
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;
È»ºóÔÚ´°ÌåµÄCreateÖе÷Óà PatchInt3 £»»òÕßÔÚ´°Ìå´úÂëµÄ×îºóÒ»¸öend.ǰ¼ÓÈëһϴúÂë¼´¿ÉÒÔ½â¾ö
//-------------------------------------------------------------- i
nitialization
begin
PatchInt3; //·ÀÖ¹¹Ø±Õ´°¿Úʱ³öÏÖCPU: ntdll.DbgBreakPoint
end;
Ïà¹ØÎĵµ£º
Ò»¡¢Ò»¸ö½ÐÉù½Ó¿ÚºÍ¼¸Ö»Ñ¼×Ó
1¡¢´ÓÒ»¸ö½ÐÉù½Ó¿Ú¿ªÊ¼
{¡¶HeadFirstÉè¼ÆÄ£Ê½¡·Delphi´úÂë֮ģʽС½á }
{ Ò»¸ö½ÐÉù½Ó¿Ú }
{ ±àÒ빤¾ß£ºDelphi2010 for win32 }
{ E-Mail £ºxshlife@163.com }
unit uQuackable;
interface
type
IQuackable = in ......
ÔÚÒ»¸öµ¥ÔªÖÐÉùÃ÷µÄ¶à¸öÀ໥ΪÓÑÔªÀà
type
TMyClass = class
GUID: string;
Name: string;
bSex: Boolean;
Tel : string;
end;
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
Button2: TButton;
procedure Button2Click(Sender: TObject);
procedu ......
ÈÝÆ÷µÄÖ÷ÒªÖ°ÔðÓÐÁ½¸ö£º´æ·ÅÔªËØºÍä¯ÀÀÔªËØ¡£¸ù¾Ýµ¥Ò»Ö°ÔðÔÔò£¨SRP£©Òª½«¶þÕß·Ö¿ª£¬ÓÚÊǽ«ä¯ÀÀ¹¦ÄÜ´ò°ü·â×°¾ÍÓÐÁ˵ü´úÆ÷¡£
Óõü´úÆ÷·â×°¶Ô¶¯Ì¬Êý×éµÄ±éÀú£º
1.ÈÝÆ÷ÖеÄÔªËØÀà
{¡¶HeadFirstÉè¼ÆÄ£Ê½¡·Ö®µü´úÆ÷ģʽ }
{ ÈÝÆ÷ÖеÄÔªËØÀà ......
ÊÊÅäÆ÷ģʽµÄÖ÷ÒªÒâͼÊǶÔÏÖÓÐÀàµÄ½Ó¿Ú½øÐÐת»»£¬ÒÔÂú×ãÄ¿±êÀàµÄÐèÇ󡣯ä´Î£¬¿ÉÒÔ¸øÄ¿±êÀàµÄ½Ó¿ÚÌí¼ÓеÄÐÐΪ£¨Ö÷ÒªÖ¸·½·¨£©¡£ÕâÒ»µãÈÝÒ×Óë×°ÊÎģʽ»ìÏý¡£´ÓÒâͼ·½ÃæÀ´¿´£¬×°ÊÎģʽ²»¸Ä±ä£¨Í¨³£Ö¸Ôö¼Ó£©½Ó¿ÚÖеÄÐÐΪ£¨Ö÷ÒªÖ¸·½·¨£©£¬¶øÊÇÔÚÔÓÐÐÐΪ£¨Ö÷ÒªÖ¸·½·¨£©µÄ»ù´¡ÉÏÌí¼ÓÐµĹ¦ÄÜ£»´ÓÀà½á¹¹· ......