⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit1.pas

📁 武林前三步显血,显蓝.级别等源码 .DELPHI做的.对新手学习DELPHI外挂会有帮助
💻 PAS
字号:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls,inifiles;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    xie: TLabel;
    Label2: TLabel;
    jing: TLabel;
    ji: TLabel;
    Label3: TLabel;
    Label5: TLabel;
    Label4: TLabel;
    Label6: TLabel;
    yan: TLabel;
    money: TStaticText;
    ming: TStaticText;
    Timer1: TTimer;
    
    procedure Timer1Timer(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Timer1Timer(Sender: TObject);
var
  pHandle:Thandle;    //声明变量 临时句柄
  thwnd :Thandle ;   //声明变量 窗口句柄
  pid:Thandle;      //进程句柄
  exp,qian,Dengji,test,hp,lan,maxhp,maxlan:integer; //读出的人物信息
  lpNumberOfBytesRead:DWORD;
  r_Name:array[0..16] of WideChar;  //宽字符变量
  r_test: integer;
  myini: Tinifile;
  a:integer;

  goal:string;

begin
   thWnd := FindWindow(nil,'Element Client'); //得窗口句柄
   GetWindowThreadProcessId(thwnd,@pid);//得进程ID
   phandle := OpenProcess(PROCESS_ALL_ACCESS,False,pid); //打开进程
   if phandle=0 then
      begin
        Application.MessageBox ('请先运行游戏再打开本程序','友情提示',MB_OK);
        Application.Terminate;
      end
   else
      begin
        ReadProcessMemory(pHandle,Pointer($9374f4),@test,sizeof(test),lpNumberOfBytesRead); //读基址
        ReadProcessMemory(pHandle,Pointer(test+$1c),@test,sizeof(test),lpNumberOfBytesRead); //一次偏移
        ReadProcessMemory(pHandle,Pointer(test+$24),@test,sizeof(test),lpNumberOfBytesRead); //二次偏移
        ReadProcessMemory(pHandle,Pointer(test+$25c),@hp,sizeof(hp),lpNumberOfBytesRead); //当前血
        ReadProcessMemory(pHandle,Pointer(test+$274),@maxhp,sizeof(maxhp),lpNumberOfBytesRead);//最大血
        ReadProcessMemory(pHandle,Pointer(test+$260),@lan,sizeof(lan),lpNumberOfBytesRead);//当前蓝
        ReadProcessMemory(pHandle,Pointer(test+$278),@maxlan,sizeof(maxlan),lpNumberOfBytesRead);//最大蓝
        ReadProcessMemory(pHandle,Pointer(test+$250),@Dengji,sizeof(Dengji),lpNumberOfBytesRead);//人物等级
        ReadProcessMemory(pHandle,Pointer(test+$2e8),@qian,sizeof(qian),lpNumberOfBytesRead); //金钱
        ReadProcessMemory(pHandle,Pointer(test+$3a8),@r_test,sizeof(r_test),lpNumberOfBytesRead);//人名长度
        ReadProcessMemory(pHandle,Pointer(r_test),@r_Name,sizeof(r_Name),lpNumberOfBytesRead);//人名
        ReadProcessMemory(pHandle,Pointer(test+$264),@exp,sizeof(exp),lpNumberOfBytesRead);//人物经验

        CloseHandle(pHandle);  //关闭进程
        try
        myini:=Tinifile.Create('.\配置文件.ini'); //读配置项
        goal:= myini.ReadString('经验总表',inttostr(Dengji),'');
        finally
        myini.Free;
        end;
        yan.Caption:=inttostr(exp)+'/'+goal;//当前经验
        ming.Caption:=r_Name ;   //显示人物名
        xie.Caption:=inttostr(hp)+'/'+inttostr(maxhp);//标签显示血
        jing.Caption:=inttostr(lan)+'/'+inttostr(maxlan);//标签显示蓝
        ji.Caption:=inttostr(Dengji); //标签显示等级
        money.Caption:=inttostr(qian div 10000)+'金'+inttostr(qian div 100)+'银'+inttostr(qian-qian div 10000*10000-qian div 100*100)+'铜';  //标签显示金钱
      end;
end;


end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -