Delphi 游戏测试CALL


本文整理自网络,侵删。

 
unit Unit1;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;
 
type
  TForm1 = class(TForm)
    GroupBox1: TGroupBox;
    Memo1: TMemo;
    Button1: TButton;
    Edit1: TEdit;
    Label1: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    {
 Private declarations 
}
  public
    {
 Public declarations 
}
  end;
 
var
  Form1: TForm1;
 
implementation
 
{
$R *.dfm
}
 
 
function inmit(Handle:Cardinal; InmitCallName:Pointer):Cardinal;
var
   ThreadID: Thandle;
   ThreadAdd: Pointer;
   Num:Cardinal;
begin
   ThreadAdd := VirtualAllocEx(Handle,nil,4096,MEM_COMMIT{
内存-委托
},PAGE_EXECUTE_READWRITE{
指该内存块具有可读写的权限
});       //在目标进程建立内存空间
   WriteProcessMemory(Handle,ThreadAdd,InmitCallName,4096,Num);                         //将要注入的CALL写到上面建立的内存空间中
   Result := CreateRemoteThread(Handle,nil,0,ThreadAdd,nil,CREATE_SUSPENDED,ThreadID);   //获得注入后线程的句柄
end;
 
procedure CallTest;  //测试的CALL
var
  Address:Pointer;
begin
Address := Pointer($005ACDB0) ;   //武林205打坐CALL
asm
  Pushad
  CALL Address
  Popad
end;
end;
 
 
procedure TForm1.Button1Click(Sender: TObject);
var
  GHwnd:Hwnd;
  HomeAdd:Thandle;
  ProcessID:Cardinal;
  OpProcID:Cardinal;
begin
GHwnd := FindWindow(nil,PChar(edit1.Text));
if GHwnd=0 then
  begin
  memo1.Lines.Text := '没有找到指定窗口!' + #10 + memo1.Lines.Text ;
  exit;
  end;
GetWindowThreadProcessID(GHwnd,OpProcID);
ProcessID := OpenProcess(PROCESS_ALL_ACCESS,FALSE,OpProcID);
HomeAdd := inmit(ProcessID,@CallTest);
ResumeThread(HomeAdd);
CloseHandle(ProcessID);
memo1.Lines.Text := '调用成功!' + #10 +memo1.Lines.Text ;
end;
 
procedure TForm1.FormCreate(Sender: TObject);
begin
memo1.Clear ;
end;
 
end.

相关阅读 >>

Delphi xe6 android 界面皮肤美化 用stylebook

Delphi的idhttp报iohandler value is not valid错误的原因

Delphi 删除字符串中首个字符

Delphi now 返回当前日期及时间

Delphi 单击最小化按钮隐藏单击托盘显示

Delphi 判断是否为二进制文件

Delphi线程简单创建、挂起、激活与终止

Delphi 让label 始终在form的正中显示

Delphi 声明指令 调用左右

Delphi Delphi写的一个上位机

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



打赏

取消

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

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

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

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

评论

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