forked from R3nzTheCodeGOD/R3nzSkin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInjector.hpp
36 lines (31 loc) · 1 KB
/
Injector.hpp
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
30
31
32
33
34
35
36
#pragma once
#include <Windows.h>
#include <chrono>
#include <cinttypes>
#include <string>
#include <vector>
using namespace std::chrono_literals;
using proclist_t = std::vector<std::uint32_t>;
struct NtCreateThreadExBuffer {
SIZE_T Size;
SIZE_T Unknown1;
SIZE_T Unknown2;
PULONG Unknown3;
SIZE_T Unknown4;
SIZE_T Unknown5;
SIZE_T Unknown6;
PULONG Unknown7;
SIZE_T Unknown8;
};
#pragma comment(lib, "ntdll.lib")
EXTERN_C NTSYSAPI NTSTATUS NTAPI NtCreateThreadEx(PHANDLE, ACCESS_MASK, LPVOID, HANDLE, LPTHREAD_START_ROUTINE, LPVOID, BOOL, SIZE_T, SIZE_T, SIZE_T, LPVOID);
class Injector {
public:
static proclist_t WINAPI findProcesses(const std::wstring name) noexcept;
static bool WINAPI isInjected(const std::uint32_t pid) noexcept;
static bool WINAPI inject(const std::uint32_t pid) noexcept;
static void WINAPI enableDebugPrivilege() noexcept;
static std::string randomString(std::uint32_t size) noexcept;
static void renameExe() noexcept;
static void run() noexcept;
};