16 lines
314 B
C++
16 lines
314 B
C++
#include <include.h>
|
|
|
|
void* instr::system_call_t::stub() noexcept
|
|
{
|
|
auto length = sizeof(*this);
|
|
auto* result = win_api::rebuilt::virtual_alloc(nullptr, length, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
|
|
|
|
if (result)
|
|
{
|
|
memset(result, 0, length);
|
|
memcpy(result, this, length);
|
|
}
|
|
|
|
return result;
|
|
}
|