-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMemory.h
More file actions
40 lines (32 loc) · 906 Bytes
/
Memory.h
File metadata and controls
40 lines (32 loc) · 906 Bytes
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
37
38
39
40
#pragma once
#include <cstdint>
#include <Windows.h>
#include <string>
//ADD IN YOUR OWN KERNEL STUFF, ReadProcessMemory will get you banned
namespace Memory
{
inline uint64_t ModuleBaseAddress = 0;
inline DWORD ProcessID = 0;
inline HANDLE ProcessHandle = 0;
}
template <typename R> R Read(uint64_t address)
{
R value = R();
if (ReadProcessMemory(Memory::ProcessHandle, (LPCVOID)address, &value, sizeof(R), NULL))
return value;
}
template<typename T>
std::string read_stringRPM(uint64_t address)
{
char buffer[70];
ReadProcessMemory(Memory::ProcessHandle, reinterpret_cast<LPCVOID>(address), &buffer, sizeof(buffer), 0);
std::string nameString;
for (int i = 0; i < 70; i += 2) {
if (buffer[i] == 0)
break;
else
nameString += buffer[i];
};
return nameString;
}
uint64_t FindModuleBaseAddress(uint64_t ProcessID, const char* modulename);