Make RewriteRemoteEntryPointW report IErrorInfo, do VirtualProtectEx before WriteProcessMemory (#1642)

Make RewriteRemoteEntryPointW report IErrorInfo, do VirtualProtectEx before WriteProcessMemory
This commit is contained in:
goat 2024-02-15 00:07:23 +01:00 committed by GitHub
commit c48012418f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 254 additions and 123 deletions

View file

@ -111,10 +111,13 @@ namespace utils {
};
class memory_tenderizer {
HANDLE m_process;
std::span<char> m_data;
std::vector<MEMORY_BASIC_INFORMATION> m_regions;
public:
memory_tenderizer(HANDLE hProcess, const void* pAddress, size_t length, DWORD dwNewProtect);
memory_tenderizer(const void* pAddress, size_t length, DWORD dwNewProtect);
template<typename T, typename = std::enable_if_t<std::is_trivial_v<T>&& std::is_standard_layout_v<T>>>
@ -273,4 +276,6 @@ namespace utils {
void wait_for_game_window();
std::wstring escape_shell_arg(const std::wstring& arg);
std::wstring format_win32_error(DWORD err);
}