-
-
[原创]QQJoker。附源码。
-
发表于:
2010-9-27 18:25
9189
-
有些人比较讨厌,老是占着自己的电脑。所以写了这个。
代码很简单,关键是如何获得QQ号。
这里我用的方法是遍历QQ进程打开的文件,因为在QQ打开的文件路径中会包含QQ号,比如QQ消息文件保存路径
C:\Documents and Settings\Administrator\My Documents\Tencent Files\123456789\msg2.0.db
----->
123456789
获得QQ号的代码
#define QQNUMBER L"123456789"
VOID __stdcall Joker()
{
ULONG uCurPID = 0;
ULONG uLength = 0;
BYTE *pBuffer = 0;
int iCount = 0;
NT::PSYSTEM_HANDLE_INFORMATION pHandles = 0;
Sleep( 1000*60);
uLength = 1024*10;
do
{
pBuffer = (BYTE*)realloc( pBuffer, uLength);
} while (NT::ZwQuerySystemInformation( NT::SYSTEM_INFORMATION_CLASS::SystemHandleInformation, pBuffer, uLength, &uLength));
pHandles = (NT::PSYSTEM_HANDLE_INFORMATION)(pBuffer + 4);
iCount = *(int*)pBuffer;
uCurPID = GetCurrentProcessId();
while ( iCount--)
{
NT::IO_STATUS_BLOCK io = {0};
NT::PFILE_NAME_INFORMATION pNameInfo = 0;
if ( pHandles[iCount].ProcessId == uCurPID)
{
pNameInfo = (NT::PFILE_NAME_INFORMATION)calloc(1024*5, 1);
if ( 0 == NT::ZwQueryInformationFile( (HANDLE)pHandles[iCount].Handle, &io, pNameInfo, 1024*5, NT::FILE_INFORMATION_CLASS::FileNameInformation))
{
WCHAR wQQmsg[] = L"\\" QQNUMBER L"\\msg2.0.db";
if ( pNameInfo->FileNameLength > sizeof(wQQmsg))
{
OutputDebugStringW( pNameInfo->FileName + pNameInfo->FileNameLength/2 - (sizeof(wQQmsg)-2)/2);
if (0 == lstrcmpiW( pNameInfo->FileName + pNameInfo->FileNameLength/2 - (sizeof(wQQmsg)-2)/2, wQQmsg))
{
// [COLOR="Blue"]Do what you wanna do .
while ( TRUE)
{
Sleep( (rand()%30+30)*1000);
EnableWindow( GetActiveWindow(), FALSE);
}
}
}
}
free(pNameInfo);
}
}
free( pBuffer);
}
[培训]科锐逆向工程师培训第53期2025年7月8日开班!