资源描述:
《游戏外挂开发接口》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、游戏外挂开发接口unitkbKernel;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Dialogs,StdCtrls,ComObj,ActiveX;typepRGBTripleArray=^TRGBTripleArray;TRGBTripleArray=ARRAY[0..32767]OFTRGBTriple;TRGBTriple=PACKEDRECORDrgbtBlue:BYTE;rgbtGreen:BYTE;rgbtRe
2、d:BYTE;END;pfindwindowstruct=^tfindwindowstruct;tfindwindowstruct=recordcaption:string;classname:string;windowhandle:hwnd;end;procedureCloseWindows;procedureLeftClick(x,y:integer);procedureRightClick(x,y:integer);procedureDoubleClick(x,y:integer);procedureMoveTo(x,y:integ
3、er);procedurePresskey(vk:integer);procedurePressTwoKey(key1,key2:integer);functionGetPixelColor(x,y:integer):integer;functionFindcolor(iLeft,iTop,iRight,iBottom,Acolor:integer;variX,iY:integer):boolean;functionFindpicture(iLeft,iTop,iRight,iBottom:integer;strPic:string;va
4、riX,iY:integer):boolean;procedureinputNum(num:integer);functionGetXY(varx,y:integer):boolean;procedureSayStr(aStr:string);ProcedureSayString(aStr:string);functionfindawindow(caption:string;classname:string):hwnd;functionReadMem(caption:string;classname:string;lpBuffer:pBy
5、te;addr:integer;Count:integer):boolean;implementationfunctionenumwindowproc(hwindow:hwnd;lparam:longint):bool;{$ifdefwin32}stdcall;{$else};export;{$endif}varlpbuffer:pchar;//定义一个缓冲区windowcaptionfound:bool;//标题找到classnamefound:bool;//类名找到begingetmem(lpbuffer,255);//分配缓冲区re
6、sult:=true;//设为TRUE代表继续玫举窗体windowcaptionfound:=false;classnamefound:=false;tryifpfindwindowstruct(lparam).caption=''thenwindowcaptionfound:=true//如果要查找的标题为空的则标题为找到elseifgetwindowtext(hwindow,lpbuffer,255)>0then//得到窗体的标题ifpos(pfindwindowstruct(lparam).caption,strpas(lpbuff
7、er))>0thenwindowcaptionfound:=true;ifpfindwindowstruct(lparam).classname=''thenclassnamefound:=true//如果要查找的类名为空的则类名为找到elseifgetclassname(hwindow,lpbuffer,255)>0thenifpos(pfindwindowstruct(lparam).classname,strpas(lpbuffer))>0thenclassnamefound:=true;if(windowcaptionfounda
8、ndclassnamefound)thenbegin//如果标题名和类名都匹配的话pfindwindowstruct(lparam)^.windowhandle:=hwindow;//返回匹配