Fix NO_RCT2 evaluation in hook.c

This commit is contained in:
Michał Janiszewski 2016-08-28 11:31:53 +02:00 committed by Ted John
parent 76043d4050
commit f73794e093
1 changed files with 3 additions and 3 deletions

View File

@ -14,10 +14,10 @@
*****************************************************************************/
#pragma endregion
#ifdef NO_RCT2
#include "common.h"
#ifndef NO_RCT2
#ifdef __WINDOWS__
#include <windows.h>
#else
@ -202,7 +202,7 @@ static void hookfunc(int address, int newaddress, int stacksize, int registerarg
data[i++] = 0xC3; // retn
#ifdef __WINDOWS__
WriteProcessMemory(GetCurrentProcess(), address, data, i, 0);
WriteProcessMemory(GetCurrentProcess(), (LPVOID)address, data, i, 0);
#else
// We own the pages with PROT_WRITE | PROT_EXEC, we can simply just memcpy the data
memcpy((void *)address, data, i);