Files
UnleashedRecomp-hedge-dev/UnleashedRecomp/kernel/memory.h

30 lines
596 B
C++

#pragma once
class Memory
{
public:
char* base{};
size_t size{};
size_t guestBase{};
Memory(void* address, size_t size);
void* Alloc(size_t offset, size_t size, uint32_t type);
void* Commit(size_t offset, size_t size);
void* Reserve(size_t offset, size_t size);
void* Translate(size_t offset) const noexcept
{
return base + offset;
}
uint32_t MapVirtual(void* host) const noexcept
{
return static_cast<uint32_t>(static_cast<char*>(host) - base);
}
};
SWA_API void* MmGetHostAddress(uint32_t ptr);
extern Memory g_memory;