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/include/TerminalUI.h
Hermes / DyForge / include / TerminalUI.h
1#pragma once
2 
3#include <string>
4#include <vector>
5#include <memory>
6#include <functional>
7#include <Windows.h>
8#include "../../DyMain/include/DyMain.h"
9 
10namespace DyForge {
11 
12class TerminalUI {
13public:
14 TerminalUI();
15 ~TerminalUI();
16 
17 // Core functionality
18 bool Initialize();
19 void Cleanup();
20 bool IsInitialized() const;
21 
22 // Process management
23 bool OpenProcess(DWORD processId);
24 bool CloseProcess();
25 bool IsProcessOpen() const;
26 DWORD GetCurrentProcessId() const;
27 
28 // Injection management
29 bool InjectDll(const std::wstring& dllPath);
30 bool UnloadDll();
31 bool IsDllInjected() const;
32 
33 // Analysis management
34 bool StartAnalysis();
35 bool StopAnalysis();
36 bool IsAnalysisRunning() const;
37 
38 // Reporting
39 bool GenerateReport(const std::wstring& outputPath);
40 bool ExportData(const std::wstring& format, const std::wstring& outputPath);
41 
42 // Event handling
43 using EventCallback = std::function<void(const std::string&)>;
44 void RegisterEventCallback(const std::string& eventName, EventCallback callback);
45 void UnregisterEventCallback(const std::string& eventName);
46 
47 // Menu principale
48 void ShowMainMenu();
49 void ShowProcessSelection();
50 void ShowCommandMenu();
51 void ShowAnalysisMenu();
52 void ShowModMenu();
53 void ShowWebServerMenu();
54 
55 // Gestione processi
56 bool SelectProcess(DWORD& processId);
57 bool InjectDLL(DWORD processId);
58 bool EjectDLL(DWORD processId);
59 
60 // Comandi
61 bool StartWebServer();
62 bool StopWebServer();
63 bool LoadMod(const std::string& modPath);
64 bool UnloadMod(const std::string& modName);
65 
66private:
67 // Prevent copying
68 TerminalUI(const TerminalUI&) = delete;
69 TerminalUI& operator=(const TerminalUI&) = delete;
70 
71 // Internal state
72 bool m_initialized;
73 HANDLE m_stdin;
74 HANDLE m_stdout;
75 HANDLE m_stderr;
76 
77 // Event handling
78 std::unordered_map<std::string, std::vector<EventCallback>> m_eventCallbacks;
79 
80 // Stato interno
81 DWORD selectedProcessId;
82 bool isDLLInjected;
83 bool isAnalysisRunning;
84 bool isWebServerRunning;
85 
86 // Funzioni di utilità
87 void ClearScreen();
88 void PrintHeader();
89 void PrintProcessList();
90 void PrintStatus();
91 void WaitForKey();
92 std::string GetInput(const std::string& prompt);
93 bool ConfirmAction(const std::string& message);
94 
95 // Gestione colori
96 void SetColor(int color);
97 void ResetColor();
98 
99 // Costanti
100 static const int COLOR_DEFAULT = 7;
101 static const int COLOR_HEADER = 11;
102 static const int COLOR_SUCCESS = 10;
103 static const int COLOR_ERROR = 12;
104 static const int COLOR_WARNING = 14;
105 static const int COLOR_INFO = 9;
106};
107 
108} // namespace DyForge