41 lines
879 B
C++
41 lines
879 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <vector>
|
|
#include <string>
|
|
|
|
// Forward declaration
|
|
class IOCPClient;
|
|
|
|
class SystemManager {
|
|
public:
|
|
SystemManager(IOCPClient* client, uint64_t clientID);
|
|
~SystemManager();
|
|
|
|
// Handle commands from server
|
|
void onReceive(const uint8_t* data, size_t size);
|
|
|
|
private:
|
|
// Send process list to server
|
|
void sendProcessList();
|
|
|
|
// Kill processes by PID
|
|
void killProcesses(const uint8_t* data, size_t size);
|
|
|
|
// Send window list (limited on macOS without accessibility)
|
|
void sendWindowsList();
|
|
|
|
// Get process name by PID
|
|
static std::string getProcessName(pid_t pid);
|
|
|
|
// Get process executable path by PID
|
|
static std::string getProcessPath(pid_t pid);
|
|
|
|
// Get all running PIDs
|
|
static std::vector<pid_t> getAllPids();
|
|
|
|
private:
|
|
IOCPClient* m_client;
|
|
uint64_t m_clientID;
|
|
};
|