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
| 1 | #pragma once |
| 2 | |
| 3 | #include <windows.h> |
| 4 | #include <stdbool.h> |
| 5 | #include <stdint.h> |
| 6 | |
| 7 | // Version info |
| 8 | #define DYHEXINJECT_VERSION_MAJOR 1 |
| 9 | #define DYHEXINJECT_VERSION_MINOR 0 |
| 10 | |
| 11 | // Error codes |
| 12 | typedef enum { |
| 13 | DYHEXINJECT_SUCCESS = 0, |
| 14 | DYHEXINJECT_ERROR_PROCESS_NOT_FOUND = 1, |
| 15 | DYHEXINJECT_ERROR_ACCESS_DENIED = 2, |
| 16 | DYHEXINJECT_ERROR_INJECTION_FAILED = 3, |
| 17 | DYHEXINJECT_ERROR_COMMUNICATION_FAILED = 4, |
| 18 | DYHEXINJECT_ERROR_INVALID_PARAMETERS = 5, |
| 19 | DYHEXINJECT_ERROR_EJECTION_FAILED = 6, |
| 20 | DYHEXINJECT_ERROR_DLL_NOT_FOUND = 7, |
| 21 | DYHEXINJECT_ERROR_SHARED_MEMORY_FAILED = 8 |
| 22 | } DyHexInjectError; |
| 23 | |
| 24 | // Process information structure |
| 25 | typedef struct { |
| 26 | DWORD processId; |
| 27 | HANDLE processHandle; |
| 28 | wchar_t processName[MAX_PATH]; |
| 29 | wchar_t processPath[MAX_PATH]; |
| 30 | bool is64Bit; |
| 31 | } DyHexInjectProcessInfo; |
| 32 | |
| 33 | // Injection configuration |
| 34 | typedef struct { |
| 35 | const wchar_t* dllPath; |
| 36 | bool waitForInjection; |
| 37 | bool hideInjection; |
| 38 | bool enableDebugLogging; |
| 39 | bool enableSharedMemory; |
| 40 | int sharedMemorySize; |
| 41 | } DyHexInjectConfig; |
| 42 | |
| 43 | // Communication structure |
| 44 | typedef struct { |
| 45 | HANDLE sharedMemoryHandle; |
| 46 | void* sharedMemoryPtr; |
| 47 | bool isConnected; |
| 48 | } DyHexInjectCommunication; |
| 49 | |
| 50 | // Export macro |
| 51 | #ifdef DYHEXINJECT_EXPORTS |
| 52 | #define DYHEXINJECT_API __declspec(dllexport) |
| 53 | #else |
| 54 | #define DYHEXINJECT_API __declspec(dllimport) |
| 55 | #endif |
| 56 | |
| 57 | // Function declarations |
| 58 | #ifdef __cplusplus |
| 59 | extern "C" { |
| 60 | #endif |
| 61 | |
| 62 | // Core functions |
| 63 | DYHEXINJECT_API DyHexInjectError DyHexInject_Initialize(void); |
| 64 | DYHEXINJECT_API void DyHexInject_Cleanup(void); |
| 65 | |
| 66 | // Process management |
| 67 | DYHEXINJECT_API DyHexInjectError DyHexInject_OpenProcess(DWORD processId, DyHexInjectProcessInfo* processInfo); |
| 68 | DYHEXINJECT_API void DyHexInject_CloseProcess(DyHexInjectProcessInfo* processInfo); |
| 69 | |
| 70 | // Injection functions |
| 71 | DYHEXINJECT_API DyHexInjectError DyHexInject_InjectDll(const DyHexInjectProcessInfo* processInfo, const DyHexInjectConfig* config); |
| 72 | DYHEXINJECT_API DyHexInjectError DyHexInject_EjectDll(const DyHexInjectProcessInfo* processInfo, const wchar_t* dllPath); |
| 73 | |
| 74 | // Communication functions |
| 75 | DYHEXINJECT_API DyHexInjectError DyHexInject_StartCommunication(const DyHexInjectProcessInfo* processInfo, DyHexInjectCommunication* communication); |
| 76 | DYHEXINJECT_API DyHexInjectError DyHexInject_StopCommunication(DyHexInjectCommunication* communication); |
| 77 | DYHEXINJECT_API DyHexInjectError DyHexInject_SendCommand(DyHexInjectCommunication* communication, const char* command, size_t commandLength); |
| 78 | DYHEXINJECT_API DyHexInjectError DyHexInject_ReceiveResponse(DyHexInjectCommunication* communication, char* buffer, size_t bufferSize, size_t* bytesReceived); |
| 79 | |
| 80 | // Utility functions |
| 81 | DYHEXINJECT_API const char* DyHexInject_GetErrorString(DyHexInjectError error); |
| 82 | DYHEXINJECT_API void DyHexInject_EnableDebugLogging(bool enable); |
| 83 | DYHEXINJECT_API bool DyHexInject_IsDllLoaded(const DyHexInjectProcessInfo* processInfo, const wchar_t* dllPath); |
| 84 | |
| 85 | // Simplified API |
| 86 | DYHEXINJECT_API int InjectDll(const char* processName, const char* dllPath); |
| 87 | DYHEXINJECT_API int InjectDllByPID(int processId, const char* dllPath); |
| 88 | |
| 89 | #ifdef __cplusplus |
| 90 | } |
| 91 | #endif |