forked from 0xflux/Basic-C-Reflective-DLL-Injector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dll_injector.h
29 lines (24 loc) · 782 Bytes
/
dll_injector.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef DLL_INJECTOR_H
#define DLL_INJECTOR_H
#include <windows.h>
#include <tlhelp32.h>
/**
* Structure to hold various pointers and flags related to a PE (Portable Executable) file.
* This includes pointers to functions like GetProcAddress() and LoadLibraryA()
*/
typedef struct _DLL_INFO {
LPVOID get_process_addr;
LPVOID load_library_a_addr;
LPVOID base;
BOOL base_relocation_required;
} DLL_INFO, *LDLL_INFO;
// prototypes
LPVOID load_dll_from_resource(const char *dll_path, int resourceID);
LPVOID read_dll_from_file(char *FileName);
HANDLE find_process_and_get_handle(char *process_name);
int launch_reflective_processes(char *process_name);
// to allow DLL builds
#ifdef BUILD_DLL
__declspec(dllexport) void runMain();
#endif
#endif // DLL_INJECTOR_H