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
DyHexInject/include/DyHexInjectTypes.h
Hermes / DyHexInject / include / DyHexInjectTypes.h
1#pragma once
2 
3#include <Windows.h>
4#include <stdbool.h>
5 
6#ifdef __cplusplus
7extern "C" {
8#endif
9 
10#ifdef _WIN32
11#ifdef DYHEXINJECT_EXPORTS
12#define DYHEXINJECT_API __declspec(dllexport)
13#else
14#define DYHEXINJECT_API __declspec(dllimport)
15#endif
16#else
17#define DYHEXINJECT_API
18#endif
19 
20typedef int DyHexInjectError;
21 
22#define DYHEXINJECT_SUCCESS 0
23#define DYHEXINJECT_ERROR_PROCESS_NOT_FOUND 1
24#define DYHEXINJECT_ERROR_ACCESS_DENIED 2
25#define DYHEXINJECT_ERROR_DLL_NOT_FOUND 3
26#define DYHEXINJECT_ERROR_INJECTION_FAILED 4
27#define DYHEXINJECT_ERROR_COMMUNICATION_FAILED 5
28#define DYHEXINJECT_ERROR_INVALID_PARAMETER 6
29#define DYHEXINJECT_ERROR_INVALID_PARAMETERS 7
30#define DYHEXINJECT_ERROR_EJECTION_FAILED 8
31#define DYHEXINJECT_ERROR_SHARED_MEMORY_FAILED 9
32 
33typedef struct {
34 HANDLE processHandle;
35 DWORD processId;
36 HMODULE dllHandle;
37 void* baseAddress;
38 bool is64Bit;
39 wchar_t processPath[MAX_PATH];
40 wchar_t processName[MAX_PATH];
41} DyHexInjectProcessInfo;
42 
43typedef struct {
44 HANDLE sharedMemory;
45 void* mappedMemory;
46 bool isConnected;
47 size_t memorySize;
48 HANDLE sharedMemoryHandle;
49 void* sharedMemoryPtr;
50} DyHexInjectCommunication;
51 
52typedef struct {
53 const wchar_t* dllPath;
54 bool waitForInjection;
55 bool hideInjection;
56 bool enableDebugLogging;
57 bool enableSharedMemory;
58 size_t sharedMemorySize;
59} DyHexInjectConfig;
60 
61// Function declarations
62DYHEXINJECT_API DyHexInjectError DyHexInject_Initialize(void);
63DYHEXINJECT_API void DyHexInject_Cleanup(void);
64DYHEXINJECT_API DyHexInjectError DyHexInject_OpenProcess(DWORD processId, DyHexInjectProcessInfo* processInfo);
65DYHEXINJECT_API void DyHexInject_CloseProcess(DyHexInjectProcessInfo* processInfo);
66DYHEXINJECT_API DyHexInjectError DyHexInject_InjectDll(DyHexInjectProcessInfo* processInfo, const DyHexInjectConfig* config);
67DYHEXINJECT_API DyHexInjectError DyHexInject_EjectDll(DyHexInjectProcessInfo* processInfo, const wchar_t* dllPath);
68DYHEXINJECT_API DyHexInjectError DyHexInject_StartCommunication(DyHexInjectProcessInfo* processInfo, DyHexInjectCommunication* communication);
69DYHEXINJECT_API void DyHexInject_StopCommunication(DyHexInjectCommunication* communication);
70DYHEXINJECT_API DyHexInjectError DyHexInject_SendCommand(DyHexInjectCommunication* communication, const char* command, size_t length);
71DYHEXINJECT_API DyHexInjectError DyHexInject_ReceiveResponse(DyHexInjectCommunication* communication, char* buffer, size_t bufferSize, size_t* bytesReceived);
72DYHEXINJECT_API const char* DyHexInject_GetErrorString(DyHexInjectError error);
73 
74#ifdef __cplusplus
75}
76#endif