打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Delphi修改窗口类名(HookAPI)

Delphi修改窗口类名(HookAPI)

program Project1;uses  Forms,  Windows,  Messages,  SysUtils,  Variants,  Classes,  Graphics,  Controls,  Dialogs,  Unit1 in 'Unit1.pas' {Form1};

function GetClassInfoA1(x: Integer;y:Integer;j:Integer): Integer;stdcall; external 'user32.dll' name 'GetClassInfoA';function RtlMoveMemory1(x: Integer;y:Pointer;j:Integer): Integer;stdcall; external 'kernel32.dll' name 'RtlMoveMemory';var j_apidizhi,j_old:Pointer; jmt: array[1..8] of Byte; ent: array[1..8] of Byte; j_ls:LongWord;{$R *.res}function MyGetClassInfoA(hWnd:Integer;lpText: Integer;uType:Integer): Integer; stdcall;var myclassname:array[0..254] of char; jack:Integer;begin CopyMemory(j_apidizhi, @ent, 8); CopyMemory(@myclassname,Pointer(lptext),6); if myclassname='TForm1' then begin myclassname:='hgorj3'; RtlMoveMemory1(lpText,@myclassname,6); end; jack:=GetClassInfoA1(hWnd,lpText,uType); asm pushad mov eax,j_apidizhi mov byte [eax],$B8 add eax,1 mov ebx,j_ls mov [eax],ebx add eax,4 mov byte [eax],$FF add eax,1 mov byte [eax],$E0 popad end; Result:=jack;end;begin j_apidizhi:=GetProcAddress(GetModuleHandle('user32.dll'),'GetClassInfoA'); VirtualProtect(j_apidizhi,8,64,j_old); CopyMemory(@ent, j_apidizhi, 8); //保存原指令 j_ls:=LongWord(@MyGetClassInfoA); //jmt[1]:=$e9; //jmt[2]= //Pinteger(@jmt[2])^:=MyGetClassInfoA; //CopyMemory(@jmt[2], @MyGetClassInfoA, 4); asm pushad mov eax,j_apidizhi mov byte [eax],$B8 add eax,1 mov ebx,j_ls mov [eax],ebx add eax,4 mov byte [eax],$FF add eax,1 mov byte [eax],$E0 popad end; Application.Initialize; Application.CreateForm(TForm1, Form1); Application.Run;end.

关于D的指针和内存操作还不熟练 特别是D好象没有字节集操作的概念  象易的到字节集 写到内存 指针到字节集这三个函数没有 操作不便 以待更加深入学习

关于apihook 最简单的mov eax,子程序 / jmp eax 方式 也暂时没有考虑多线程的问题

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Delphi的几种类型转换
如何在DELPHI中使用汇编
通达信修改技术:暴力初步(直接免费登录高级行情)
外挂专用
qq反汇编日志
[C/C++] 对C/C++可变参数表的深层探索
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服