宝峰科技

 找回密码
 注册

QQ登录

只需一步,快速开始

智能终端设备维修查询系统注册会员邮箱认证须知!
查看: 3451|回复: 8

[已回复] DELPHI菜鸟,求教

[复制链接]

该用户从未签到

wupeiju 发表于 2010-6-2 19:08:35 | 显示全部楼层 |阅读模式

欢迎您注册加入!这里有您将更精采!

您需要 登录 才可以下载或查看,没有账号?注册

x
我刚学DELPHI自学的,没人指点我,首先感谢潇潇老大,为我门提供了那么好的交流平台,无谓的精神。
问题1。我今天在学习过程中看到了别人发布的,DELPHI辅助模版,代码,我想研究下,但是把代码全都闹到DELPHI里 全是错误,代码应该没错 ,是不是DELPHI只有代码,是生成不了EXE文件的,。。要怎么做, 代码我发一下。。请老大指点 高手指点,别笑我是菜鸟 我很爱学习的,
问题2对象树形查看器关闭了不知道怎么打开,,老大说了按F11我按了,只能按出对象检查器 按不出对象树形查看器对象树形查看器就是在对象检查器上面的那个窗口 不知道怎么按出来,我是中文版的,所以要说详细点 希望人能看明白 帮帮我,

该用户从未签到

 楼主| wupeiju 发表于 2010-6-2 19:12:03 | 显示全部楼层
忘了发 辅助模版代码了,,请高手 或者老大告诉我,怎么把这代码变成EXE文件
谢谢了
  1. unit Unit1;

  2. interface

  3. uses
  4. Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5. Dialogs, ComCtrls, StdCtrls, ExtCtrls, StrUtils;

  6. type
  7. TForm1 = class(TForm)
  8. PageControl1: TPageControl;
  9. TabSheet1: TTabSheet;
  10. GroupBox1: TGroupBox;
  11. Label1: TLabel;
  12. Label2: TLabel;
  13. Label3: TLabel;
  14. EditName: TEdit;
  15. EditHP: TEdit;
  16. EditMP: TEdit;
  17. Button1: TButton;
  18. Button2: TButton;
  19. Button3: TButton;
  20. Button4: TButton;

  21. procedure Button4Click(Sender: TObject);
  22. procedure Button1Click(Sender: TObject);
  23. procedure FormCreate(Sender: TObject);
  24. procedure FormDestroy(Sender: TObject);

  25. procedure RetCity;
  26. procedure JiNeng;
  27. procedure Button2Click(Sender: TObject);
  28. procedure Button3Click(Sender: TObject);


  29. private
  30. { Private declarations }

  31. public
  32. { Public declarations }

  33. end;

  34. type // ---- 定义参数指针
  35. P1_STR = packed record
  36. Param1: DWORD;
  37. Param2: DWORD;
  38. end;
  39. PP1_STR = ^P1_STR;

  40. var
  41. Form1: TForm1;
  42. Base0, Base1, BaseT1: Integer;
  43. HP, MP: Integer;

  44. MyHwnd:Hwnd;
  45. hProcess_N: THandle;
  46. ThreadAdd, ParamAdd: Pointer;
  47. ThreadID: DWORD;

  48. MemSize, JNID: DWORD;
  49. ByteRead: Cardinal;

  50. implementation

  51. {$R *.dfm}


  52. procedure TForm1.FormCreate(Sender: TObject);
  53. begin
  54. MyHwnd:=findwindow(nil, 'Element Client');
  55. GetWindowThreadProcessId(MyHwnd, @ThreadID);
  56. hProcess_N := OpenProcess(PROCESS_ALL_ACCESS, False, ThreadID);
  57. if hProcess_N = 0 then
  58. begin
  59. Messagebox(handle, ' 请退出先登录运行《诛仙》游戏。 ','提示',MB_OK+MB_IconError);
  60. exit;
  61. end;

  62. Base0:=$9045EC; // $12F82C
  63. MemSize:=128;

  64. ThreadAdd := VirtualAllocEx(hProcess_N, nil, MemSize, MEM_COMMIT, PAGE_READWRITE);
  65. ParamAdd := VirtualAllocEx(hProcess_N, nil, 20, MEM_COMMIT, PAGE_READWRITE);
  66. end;


  67. procedure TForm1.FormDestroy(Sender: TObject);
  68. begin
  69. VirtualFreeEx(hProcess_N, ThreadAdd, MemSize, MEM_RELEASE);
  70. VirtualFreeEx(hProcess_N, ParamAdd, 20, MEM_RELEASE);
  71. CloseHandle(hProcess_N);
  72. end;


  73. procedure InjectFunc(Func: Pointer; Param: Pointer; ParamSize: DWORD);
  74. var
  75. hThread: THandle;
  76. lpNumberOfBytes: DWORD;

  77. begin
  78. if hProcess_N<>0 then
  79. begin
  80. // ---- 写入函数地址
  81. WriteProcessMemory(hProcess_N, ThreadAdd, Func, MemSize, lpNumberOfBytes);
  82. // ---- 写入参数地址
  83. WriteProcessMemory(hProcess_N, ParamAdd, Param, ParamSize, lpNumberOfBytes);
  84. // ---- 创建远程线程
  85. hThread := CreateRemoteThread(hProcess_N, nil, 0, ThreadAdd, ParamAdd, 0, lpNumberOfBytes);
  86. // ---- 等待线程结束
  87. WaitForSingleObject(hThread, INFINITE);
  88. CloseHandle(hThread);
  89. end;
  90. end;

  91. // ---- 死亡回城 CALL
  92. procedure MyCall1; Stdcall;
  93. var
  94. Address:pointer;
  95. begin
  96. Address:=Pointer($5A1F70);
  97. asm
  98. pushad
  99. call Address
  100. popad
  101. end;
  102. end;


  103. // ---- 技能 CALL
  104. procedure MyCall8(P:PP1_STR); Stdcall;
  105. var
  106. Address: pointer;
  107. P1: DWORD;
  108. begin
  109. Address:=Pointer($4656F0);
  110. P1:=P^.Param1; // ---- 技能ID号
  111. asm
  112. pushad
  113. push -1
  114. push 0
  115. push 0
  116. push P1
  117. mov ecx,DWORD PTR DS:[$900adc]
  118. mov edx,DWORD PTR DS:[ecx+$1c]
  119. mov ecx,DWORD PTR DS:[edx+$28]
  120. call address
  121. popad
  122. end;
  123. end;


  124. // --- 退出
  125. procedure TForm1.Button4Click(Sender: TObject);
  126. var
  127. FTxt: TextFile;
  128. S: String;

  129. begin
  130. SetWindowText(MyHwnd, 'Element Client');
  131. Close;
  132. end;

  133. // ---- 读角色信息
  134. procedure TForm1.Button1Click(Sender: TObject);
  135. var
  136. FTxt: TextFile;
  137. S: String;
  138. Name: array [0..16] of WideChar;

  139. begin
  140. ReadProcessMemory(hProcess_N, Pointer(Base0), @BaseT1, 4, ByteRead);
  141. ReadProcessMemory(hProcess_N, Pointer(BaseT1+($28)), @Base1, 4, ByteRead);

  142. ReadProcessMemory(hProcess_N, Pointer(Base1+($3A4)), @BaseT1, 4, ByteRead);
  143. ReadProcessMemory(hProcess_N, Pointer(BaseT1+($0)), @Name, 16, ByteRead); // ---- 主角信息
  144. ReadProcessMemory(hProcess_N, Pointer(Base1+($254)), @HP, 4, ByteRead);
  145. ReadProcessMemory(hProcess_N, Pointer(Base1+($258)), @MP, 4, ByteRead);

  146. EditName.Text:=Name;
  147. EditHP.Text:=IntToStr(HP);
  148. EditMP.Text:=IntToStr(MP);
  149. end;


  150. // --- 调用CALL 回城
  151. procedure TForm1.RetCity;
  152. var
  153. MyParam : P1_STR;
  154. ParamSum: DWORD;
  155. begin
  156. ParamSum:=0;
  157. if MyHwnd<>0 then
  158. begin
  159. injectfunc(@MyCall1, @MyParam, ParamSum);
  160. end;
  161. end;


  162. // ---- 调用CALL 技能
  163. procedure TForm1.JiNeng;
  164. var
  165. MyParam : P1_STR;
  166. ParamSum: DWORD;
  167. begin
  168. MyParam.Param1:=JNID;
  169. ParamSum:=SizeOf(MyParam);
  170. if MyHwnd<>0 then
  171. begin
  172. injectfunc(@MyCall8, @MyParam, ParamSum);
  173. end;
  174. end;


  175. procedure TForm1.Button2Click(Sender: TObject);
  176. begin
  177. RetCity;
  178. end;

  179. procedure TForm1.Button3Click(Sender: TObject);
  180. begin
  181. JNID:=$DA;
  182. JiNeng;
  183. end;

  184. end.
复制代码
  • TA的每日心情
    开心
    2024-12-9 18:45
  • 签到天数: 124 天

    [LV.7]常住居民III

    admin 发表于 2010-6-2 20:40:29 | 显示全部楼层
    问题1。上面的代码算最简单的调用CALL代码,你把代码全复制然后回到代码编辑窗口,把原来的删除,保存。然后回form1窗口把相应控件画上就可以。要生成EXE文件,运行后在默认路径下就自动生成EXE文件。另外我把代码整理了下。

    1. unit Unit1;
    2. interface
    3. uses
    4. Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
    5. Dialogs, ComCtrls, StdCtrls, ExtCtrls, StrUtils;
    6. type
    7. TForm1 = class(TForm)
    8.     Label1: TLabel;
    9.     Label2: TLabel;
    10.     Label3: TLabel;
    11.     Button1: TButton;
    12.     Button2: TButton;
    13.     Button3: TButton;
    14.     Button4: TButton;
    15.     EditHP: TEdit;
    16.     EditMP: TEdit;
    17.     EditName: TEdit;
    18. procedure Button4Click(Sender: TObject);
    19. procedure Button1Click(Sender: TObject);
    20. procedure FormCreate(Sender: TObject);
    21. procedure FormDestroy(Sender: TObject);
    22. procedure RetCity;
    23. procedure JiNeng;
    24. procedure Button2Click(Sender: TObject);
    25. procedure Button3Click(Sender: TObject);

    26. private
    27. { Private declarations }
    28. public
    29. { Public declarations }
    30. end;
    31. type // ---- 定义参数指针
    32. P1_STR = packed record
    33. Param1: DWORD;
    34. Param2: DWORD;
    35. end;
    36. PP1_STR = ^P1_STR;
    37. var
    38. Form1: TForm1;
    39. Base0, Base1, BaseT1: Integer;
    40. HP, MP: Integer;
    41. MyHwnd:Hwnd;
    42. hProcess_N: THandle;
    43. ThreadAdd, ParamAdd: Pointer;
    44. ThreadID: DWORD;
    45. MemSize, JNID: DWORD;
    46. ByteRead: Cardinal;
    47. implementation
    48. {$R *.dfm}

    49. procedure TForm1.FormCreate(Sender: TObject);
    50. begin
    51. MyHwnd:=findwindow(nil, 'Element Client');
    52. GetWindowThreadProcessId(MyHwnd, @ThreadID);
    53. hProcess_N := OpenProcess(PROCESS_ALL_ACCESS, False, ThreadID);
    54. if hProcess_N = 0 then
    55. begin
    56. Messagebox(handle, ' 请退出先登录运行《诛仙》游戏。 ','提示',MB_OK+MB_IconError);
    57. exit;
    58. end;
    59. Base0:=$9045EC; // $12F82C
    60. MemSize:=128;
    61. ThreadAdd := VirtualAllocEx(hProcess_N, nil, MemSize, MEM_COMMIT, PAGE_READWRITE);
    62. ParamAdd := VirtualAllocEx(hProcess_N, nil, 20, MEM_COMMIT, PAGE_READWRITE);
    63. end;

    64. procedure TForm1.FormDestroy(Sender: TObject);
    65. begin
    66. VirtualFreeEx(hProcess_N, ThreadAdd, MemSize, MEM_RELEASE);
    67. VirtualFreeEx(hProcess_N, ParamAdd, 20, MEM_RELEASE);
    68. CloseHandle(hProcess_N);
    69. end;

    70. procedure InjectFunc(Func: Pointer; Param: Pointer; ParamSize: DWORD);
    71. var
    72. hThread: THandle;
    73. lpNumberOfBytes: DWORD;
    74. begin
    75. if hProcess_N<>0 then
    76. begin
    77. // ---- 写入函数地址
    78. WriteProcessMemory(hProcess_N, ThreadAdd, Func, MemSize, lpNumberOfBytes);
    79. // ---- 写入参数地址
    80. WriteProcessMemory(hProcess_N, ParamAdd, Param, ParamSize, lpNumberOfBytes);
    81. // ---- 创建远程线程
    82. hThread := CreateRemoteThread(hProcess_N, nil, 0, ThreadAdd, ParamAdd, 0, lpNumberOfBytes);
    83. // ---- 等待线程结束
    84. WaitForSingleObject(hThread, INFINITE);
    85. CloseHandle(hThread);
    86. end;
    87. end;
    88. // ---- 死亡回城 CALL
    89. procedure MyCall1; Stdcall;
    90. var
    91. Address:pointer;
    92. begin
    93. Address:=Pointer($5A1F70);
    94. asm
    95. pushad
    96. call Address
    97. popad
    98. end;
    99. end;

    100. // ---- 技能 CALL
    101. procedure MyCall8(P:PP1_STR); Stdcall;
    102. var
    103. Address: pointer;
    104. P1: DWORD;
    105. begin
    106. Address:=Pointer($4656F0);
    107. P1:=P^.Param1; // ---- 技能ID号
    108. asm
    109. pushad
    110. push -1
    111. push 0
    112. push 0
    113. push P1
    114. mov ecx,DWORD PTR DS:[$900adc]
    115. mov edx,DWORD PTR DS:[ecx+$1c]
    116. mov ecx,DWORD PTR DS:[edx+$28]
    117. call address
    118. popad
    119. end;
    120. end;

    121. // --- 退出
    122. procedure TForm1.Button4Click(Sender: TObject);
    123. begin
    124. SetWindowText(MyHwnd, 'Element Client');
    125. Close;
    126. end;
    127. // ---- 读角色信息
    128. procedure TForm1.Button1Click(Sender: TObject);
    129. var
    130. Name: array [0..16] of WideChar;
    131. begin
    132. ReadProcessMemory(hProcess_N, Pointer(Base0), @BaseT1, 4, ByteRead);
    133. ReadProcessMemory(hProcess_N, Pointer(BaseT1+($28)), @Base1, 4, ByteRead);
    134. ReadProcessMemory(hProcess_N, Pointer(Base1+($3A4)), @BaseT1, 4, ByteRead);
    135. ReadProcessMemory(hProcess_N, Pointer(BaseT1+($0)), @Name, 16, ByteRead); // ---- 主角信息
    136. ReadProcessMemory(hProcess_N, Pointer(Base1+($254)), @HP, 4, ByteRead);
    137. ReadProcessMemory(hProcess_N, Pointer(Base1+($258)), @MP, 4, ByteRead);
    138. EditName.Text:=Name;
    139. EditHP.Text:=IntToStr(HP);
    140. EditMP.Text:=IntToStr(MP);
    141. end;

    142. // --- 调用CALL 回城
    143. procedure TForm1.RetCity;
    144. var
    145. MyParam : P1_STR;
    146. ParamSum: DWORD;
    147. begin
    148. ParamSum:=0;
    149. if MyHwnd<>0 then
    150. begin
    151. injectfunc(@MyCall1, @MyParam, ParamSum);
    152. end;
    153. end;

    154. // ---- 调用CALL 技能
    155. procedure TForm1.JiNeng;
    156. var
    157. MyParam : P1_STR;
    158. ParamSum: DWORD;
    159. begin
    160. MyParam.Param1:=JNID;
    161. ParamSum:=SizeOf(MyParam);
    162. if MyHwnd<>0 then
    163. begin
    164. injectfunc(@MyCall8, @MyParam, ParamSum);
    165. end;
    166. end;

    167. procedure TForm1.Button2Click(Sender: TObject);
    168. begin
    169. RetCity;
    170. end;
    171. procedure TForm1.Button3Click(Sender: TObject);
    172. begin
    173. JNID:=$DA;
    174. JiNeng;
    175. end;
    176. end.
    复制代码
    源码下载:

    问题2:
    对象树形查看器打开方法:
    1、View(视图)-Object TreeView(对象树形查看器);2、快捷键:Shift+Alt+F11。
    对象检查器:
    1、View(视图)-Object Inspector(对象检查器);2、快捷键:F11。

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?注册

    x

    该用户从未签到

     楼主| wupeiju 发表于 2010-6-2 21:19:24 | 显示全部楼层
    老大 爱死你了,你给我了 学下去的勇气,终于有老师教我了,不知道说什么好了,感激吧

    该用户从未签到

     楼主| wupeiju 发表于 2010-6-2 21:26:09 | 显示全部楼层
    还帮按直接做好了,在次感谢老大

    该用户从未签到

     楼主| wupeiju 发表于 2010-6-2 22:08:41 | 显示全部楼层
    我还是失败了,提示我有那些按纽,但是按F9运行 他又说我没那些按纽,真气人 ,好象这很矛盾啊,。老大能不能 录制个30秒的操作过程,我看一下 好吗 我实在是太笨了 急死了,

    该用户从未签到

     楼主| wupeiju 发表于 2010-6-2 22:12:39 | 显示全部楼层
    我的操作步骤是这样的,先打开DELPHI 在窗体上双击 进到输入代码的地方  把里面的代码全删了 换上了新代码,然后回到FORM1里 画按纽什么的,他提示我有按纽了,但是我又按F9运行程序 他又说我没按纽 气气气
  • TA的每日心情
    开心
    2024-12-9 18:45
  • 签到天数: 124 天

    [LV.7]常住居民III

    admin 发表于 2010-6-2 22:25:02 | 显示全部楼层
    要在添加按钮等控件前删除代码里的
    PageControl1: TPageControl;
    TabSeet1: TTabSheet;
    GroupBox1: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    EditName: TEdit;
    EditHP: TEdit;
    EditMP: TEdit;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;

    该用户从未签到

     楼主| wupeiju 发表于 2010-6-2 22:57:52 | 显示全部楼层
    经过老大的,在次提醒 我成功了,做下笔记 也让和我一样的菜鸟分享一起学习
    1要删除代码里那些窗体上还没有出现的按纽,Label1: TLabel;
        Label2: TLabel;
        Label3: TLabel;
        Button1: TButton;
        Button2: TButton;
        Button3: TButton;
        Button4: TButton;
        EditHP: TEdit;
        EditMP: TEdit;
        EditName: TEdit;
    这样你可以直接按F9运行程序 他会提示你你缺少了EDITNAME  我门只要在试图面版上画个EDIT控件就可以把属性里的名字改成EDITNAME他就不提示错误,在按F9他提示缺少EDITHP 按纽 办法和前面一样,,这样就搞定了,,, 谢谢老大 我好高兴哦
    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    免责声明

    本站中所有被研究的素材与信息全部来源于互联网,版权争议与本站无关。本站所发布的任何软件编程开发或软件的逆向分析文章、逆向分析视频、补丁、注册机和注册信息,仅限用于学习和研究软件安全的目的。全体用户必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。学习编程开发技术或逆向分析技术是为了更好的完善软件可能存在的不安全因素,提升软件安全意识。所以您如果喜欢某程序,请购买注册正版软件,获得正版优质服务!不得将上述内容私自传播、销售或者用于商业用途!否则,一切后果请用户自负!

    QQ|Archiver|手机版|小黑屋|联系我们|宝峰科技 ( 滇公网安备 53050202000040号 | 滇ICP备09007156号-2 )

    Copyright © 2001-2023 Discuz! Team. GMT+8, 2024-12-22 22:12 , File On Powered by Discuz! X3.49

    快速回复 返回顶部 返回列表