////////////////////打坐//////////////////////
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.