delphi 检测 IAT HOOK API 的方法


本文整理自网络,侵删。

  type
PTIMPORT_CODE=^TIMPORT_CODE;
TIMPORT_CODE=packed record
JmpPtr:Word;
PtrAdd:^Pointer;
end;



function SHFormatDrive(hWnd: HWND;
Drive: Word;
fmtID: Word;
Options: Word): Longint
stdcall; external 'Shell32.dll' Name 'SHFormatDrive'; .............................声明一下



function GetAPIAddress(ApiPtr: Pointer): Pointer;
begin
Result := ApiPtr;
if ApiPtr= nil then
exit;
try
if (PTIMPORT_CODE(ApiPtr).JmpPtr = $25FF) then
Result := PTIMPORT_CODE(ApiPtr).PtrAdd^;
except
Result := nil;
end;
end;


procedure TForm1.Button1Click(Sender: TObject);
var
OrgSHFormatDrive: Pointer;
h: Cardinal;
begin
h:=LoadLibrary('Shell32.dll');
OrgSHFormatDrive:=GetProcAddress(h,'SHFormatDrive');
if GetAPIAddress(@SHFormatDrive) <> OrgSHFormatDrive then

begin
Showmessage('IAT HOOK');

end
else

begin
Showmessage('Not IAT HOOK');

end;
FreeLibrary(h);
end;

相关阅读 >>

Delphi基于高斯-拉普拉斯算子的图像边缘检测

Delphi tpath

Delphi xe6 switch元件简繁问题

Delphi tlistview(tlistbox+图标显示)

Delphi android实例-退出程序(xe8+小米2)

Delphi 按f11程序全屏

Delphi ini文件操作 tinifile、tmeminifile

Delphi urldownloadtofile 支持进度条

Delphi 常用api 函数

Delphi 打开资源管理器并定位到指定目录下的文件

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...