#include <WinAPIEx.au3>
Global $QQaddr = -1, $QQ
$QQPID = ProcessList('QQ.exe')
For $i = 1 To $QQPID[0][0]
$QQ &= getQQ($QQPID[$i][1]) & @CRLF
Next
MsgBox(64, 'QQ', "本机已经登入的QQ号为:" & @CRLF & $QQ)
Func getQQ($pid)
Local $QQNum
Local $QQPath = _WinAPI_GetProcessFileName($pid)
$QQPath = StringMid($QQPath, 1, StringInStr($QQPath, '\', 0, -2))
If $QQaddr = -1 Then
Local $addrs = _WinAPI_LoadLibraryEx($QQPath & "Bin\KernelUtil.dll", 1)
$QQaddr = $addrs
_WinAPI_FreeLibrary($addrs)
EndIf
Local $pHandle = _WinAPI_OpenProcess(0x1F0FFF, 0, $pid)
If $pHandle Then
Local $QQNumptr = DllStructCreate('long')
ConsoleWrite(@error & @CRLF)
Local $read
For $i = 0 To 9
_WinAPI_ReadProcessMemory($pHandle, $QQaddr + 0x80598 + 4096 * $i, DllStructGetPtr($QQNumptr), 4, $read)
$QQNum = DllStructGetData($QQNumptr, 1)
If FileExists($QQPath & "Users\" & $QQNum) Then
ExitLoop
EndIf
Next
Return $QQNum
_WinAPI_CloseHandle($pHandle)
EndIf
Return -1
EndFunc ;==>getQQ
|