Fixed possible "page boundary" crashes
authorRuben Gonzalez <drifter01620@gmail.com>
Fri Mar 22 14:42:08 2013 -0400 (2013-03-22)
changeset 137d83c89c65e91
parent 136 fa5480581a4a
child 138 e32cd100b7c2
Fixed possible "page boundary" crashes
cssdm_utils.cpp
     1.1 --- a/cssdm_utils.cpp	Thu Mar 21 20:03:24 2013 -0400
     1.2 +++ b/cssdm_utils.cpp	Fri Mar 22 14:42:08 2013 -0400
     1.3 @@ -29,6 +29,7 @@
     1.4  #include "cssdm_utils.h"
     1.5  #include "cssdm_includesdk.h"
     1.6  #include <sh_list.h>
     1.7 +#include <sh_memory.h>
     1.8  
     1.9  #if defined PLATFORM_POSIX
    1.10  #include <sys/mman.h>
    1.11 @@ -276,7 +277,8 @@
    1.12  
    1.13  void DM_SetMemPatchable(void *address, size_t size)
    1.14  {
    1.15 -	DM_ProtectMemory(address, (int)size, PAGE_EXECUTE_READWRITE);
    1.16 +	//DM_ProtectMemory(address, (int)size, PAGE_EXECUTE_READWRITE);
    1.17 +	SourceHook::SetMemAccess(address, (int)size, SH_MEM_READ|SH_MEM_WRITE|SH_MEM_EXEC);
    1.18  }
    1.19  
    1.20  void DM_ProtectMemory(void *addr, int length, int prot)