Seregon/Hermes

Hermes/Dyforge is a program written in c++ allows you to inject a dll that can analyze all processes in a program, can be used for mod and reverse engeneering

C/3.8 KB/No license
DyForge/src/injection/InjectionManager.h
Hermes / DyForge / src / injection / InjectionManager.h
1#pragma once
2 
3#include "DyHexInject.h"
4#include "../../include/CommandTypes.h"
5#include <string>
6#include <memory>
7#include <mutex>
8#include <queue>
9#include <condition_variable>
10#include <thread>
11 
12namespace DyForge {
13namespace Injection {
14 
15class InjectionManager {
16public:
17 static InjectionManager& getInstance();
18 ~InjectionManager();
19 
20 bool initialize();
21 void cleanup();
22 bool injectDll(const std::wstring& dllPath, DWORD processId);
23 bool ejectDll(const std::wstring& dllPath, DWORD processId);
24 bool startCommunication(DWORD processId);
25 void stopCommunication();
26 bool sendCommand(const Command& command);
27 bool receiveResponse(Response& response);
28 bool waitForResponse(Response& response, DWORD timeout);
29 
30private:
31 InjectionManager();
32 static InjectionManager* instance;
33 static std::mutex instanceMutex;
34 
35 bool initialized;
36 DyHexInjectProcessInfo processInfo;
37 DyHexInjectCommunication communication;
38 std::mutex communicationMutex;
39 std::queue<Command> commandQueue;
40 std::queue<Response> responseQueue;
41 std::condition_variable commandCondition;
42 std::thread m_communicationThread;
43 std::string lastError;
44 
45 void communicationThread();
46 bool processCommand(const Command& command);
47 void handleError(const char* error);
48 void logDebug(const char* format, ...);
49 bool initializeSharedMemory();
50 void cleanupSharedMemory();
51};
52 
53} // namespace Injection
54} // namespace DyForge