MCPcopy Create free account
hub / github.com/dobin/RedEdr / ProcessResolver

Class ProcessResolver

RedEdrShared/process_resolver.h:12–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11
12class ProcessResolver {
13public:
14 ProcessResolver();
15 ~ProcessResolver();
16
17 void addObject(DWORD id, const Process& obj);
18 BOOL containsObject(DWORD pid);
19 Process* getObject(DWORD id);
20 void removeObject(DWORD id);
21
22 void ResetData();
23 BOOL PopulateAllProcesses();
24 void LogCacheStatistics();
25 //void RefreshCache();
26 void RefreshTargetMatching();
27
28 void SetTargetNames(const std::vector<std::string>& names);
29 size_t GetCacheCount();
30
31 // Cleanup thread management
32 void StartCleanupThread(std::chrono::minutes interval);
33 void StopCleanupThread();
34
35private:
36 std::vector<std::string> targetProcessNames = {};
37 std::unordered_map<DWORD, Process> cache;
38
39 // Cleanup thread members
40 std::atomic<bool> cleanupThreadRunning{false};
41 std::thread cleanupThread;
42 std::chrono::minutes cleanupInterval{1};
43
44 // Cleanup Helper methods
45 void CleanupWorker();
46 void CleanupStaleProcesses();
47 bool IsProcessAlive(DWORD pid);
48};
49
50// Declare a global instance
51extern ProcessResolver g_ProcessResolver;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected