- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
template <typename function_type, typename vector_type>
function_type read_memory(HANDLE hProcess, function_type base_address, std::vector< vector_type >&& offsets) {
function_type tmp = base_address;
for (function_type i : **reinterpret_cast< vector_type** >( &offsets )) {
ReadProcessMemory(hProcess, reinterpret_cast< PBYTE* >( tmp + i ), &tmp, sizeof(function_type), nullptr);
}
return tmp;
}
int main() {
std::vector< DWORD > offset = {
0x10,
0x14,
0x158
};
auto buffer = read_memory< DWORD, DWORD >(hProcess, base_address, std::move(offset));
}