首页
社区
课程
招聘
[旧帖] delphi调用 武林F1-F8遇到问题 F1能用 其他都用不了 高手麻烦指点下 0.00雪花
发表于: 2011-5-20 17:49 2975

[旧帖] delphi调用 武林F1-F8遇到问题 F1能用 其他都用不了 高手麻烦指点下 0.00雪花

2011-5-20 17:49
2975
unit GProc;

interface             //接口
function F1_F8(index:integer=1):boolean;
function set;

const GameBase=$0AC1750;
implementation
function F1_F8(index:integer=1):boolean;
begin
index:=(index-1)*4;
      // [[[[[0ABDAB0]+1C]+28]+0b0c]+0C]+0*4
asm
mov eax,GameBase
mov eax,[eax+$1c]
mov eax,[eax+$28]
mov eax,[eax+$0b0c]
mov eax,[eax+$0c]
mov eax,[eax]
add eax,$4
mov edx,[eax]
mov ecx,eax
call [edx+$8]
end;
  result:=true;
end;

////////////////////打坐//////////////////////
function set;
begin
asm
call 0062f930;
end;
  result:=true;

end.

这是代码 下面是调用代码

var
  Form1: TForm1;

implementation
uses GProc;

{$R *.dfm}

procedure TForm1.Button3Click(Sender: TObject);
begin
    self.Visible:=not self.Visible;
end;

procedure TForm1.Btnf1Click(Sender: TObject);
begin
F1_F8(1);   //F1
end;

procedure TForm1.Btnf2Click(Sender: TObject);
begin
F1_F8(2);   //F2
end;

procedure TForm1.Btnf3Click(Sender: TObject);
begin
F1_F8(3);   //F3
end;

procedure TForm1.Btnf4Click(Sender: TObject);
begin
F1_F8(4);   //F4
end;

procedure TForm1.Btnf5Click(Sender: TObject);
begin
F1_F8(5);   //F5
end;

procedure TForm1.Btnf6Click(Sender: TObject);
begin
F1_F8(6);   //F6
end;

procedure TForm1.Btnf7Click(Sender: TObject);
begin
F1_F8(7);   //F7
end;

procedure TForm1.Btnf8Click(Sender: TObject);
begin
F1_F8(8);   //F8
end;

procedure TForm1.BtnsetClick(Sender: TObject);
begin
  set;
end;

end.

Dll模块代码

library DLLgame;

{ Important note about DLL memory management: ShareMem must be the
  first unit in your library's USES clause AND your project's (select
  Project-View Source) USES clause if your DLL exports any procedures or
  functions that pass strings as parameters or function results. This
  applies to all strings passed to and from your DLL--even those that
  are nested in records and classes. ShareMem is the interface unit to
  the BORLNDMM.DLL shared memory manager, which must be deployed along
  with your DLL. To avoid using BORLNDMM.DLL, pass string information
  using PChar or ShortString parameters. }

uses
  SysUtils,
  windows,
  Classes,
  GFrom in 'GFrom.pas' {Form1},
  GProc in 'GProc.pas';

{$R *.res}
var
keyhhk:HHOOK;
Function add (a,b:integer):integer;  //加法函数
begin
result:=a+b;
end;
Function keyproc(icode,wp,lp:integer):DWORD;stdcall;//键盘HOCK回调函数
begin
  if (icode=HC_ACTION)
  then begin
      if (wp=VK_HOME)and ((1 shl 31)and lp=0) then
            begin
            //MessageBox(0,'显示外挂','显示外挂',0);
            if form1=nil then form1:=Tform1.Create(nil);
            form1.Visible:=not form1.Visible;;
            end;
            end;
  keyproc:=CallNextHookEx(keyhhk,icode,wp,lp);
end;
Function installkeyProc():boolean;stdcall;
var
h:HWND;
GameTid:THandle;
begin
Result:=false;
h:=FindWindow(nil,'Element Client');
     if h=0
     then
         begin Messagebox(0,'未找到游戏','error',0);
             exit;
         end;////如果游戏未打开则退出
GameTid:=GetWindowThreadProcessId(h);
keyhhk:=SetWindowsHookEx(WH_KEYBOARD,@keyproc,GetModuleHandle('Dllgame.dll'),GameTid);
if keyhhk>0 then Result:=true;
end;
procedure DllEnterProc(reason:integer);
begin
   case reason of
   windows.DLL_PROCESS_ATTACH:begin end;
   windows.DLL_PROCESS_DETACH:begin Form1.Free;form1:=nil;end;
end;
end;
exports
add,
installkeyProc;

begin
//Messagebox(0,'loading','error',0)
dllProc:=@DllEnterProc;
end.

我按F1 技能就可以正常出来 不管F1上放什么技能都可以正常使用 但是 按F2-F8  却一个都不行 本人刚学不知道什么原因 也没找到原因..麻烦高手能够指点一二谢谢 
报错的图片我也截图 搞了3个来小时 怎么弄也不行..知道原因的请告诉一下 或者如果我发的不是很明白的话 我可以录制视频 谢谢

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

上传的附件:
收藏
免费 0
支持
分享
最新回复 (1)
雪    币: 165
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
我在把我的源码放上 希望有人解答我的疑惑
上传的附件:
2011-5-20 21:06
0
游客
登录 | 注册 方可回帖
返回
//