diff --git a/TitanEngine/TitanEngine.Breakpoints.cpp b/TitanEngine/TitanEngine.Breakpoints.cpp index 712b68d..9cac823 100644 --- a/TitanEngine/TitanEngine.Breakpoints.cpp +++ b/TitanEngine/TitanEngine.Breakpoints.cpp @@ -435,11 +435,11 @@ __declspec(dllexport) bool TITCALL SetMemoryBPX(ULONG_PTR MemoryStart, SIZE_T Si __declspec(dllexport) bool TITCALL SetMemoryBPXEx(ULONG_PTR MemoryStart, SIZE_T SizeOfMemory, DWORD BreakPointType, bool RestoreOnHit, LPVOID bpxCallBack) { + if(MemoryStart % TITANENGINE_PAGESIZE || !SizeOfMemory || SizeOfMemory % TITANENGINE_PAGESIZE) //ensure the data is aligned with the page size + return false; CriticalSectionLocker lock(LockBreakPointBuffer); MEMORY_BASIC_INFORMATION MemInfo; ULONG_PTR NumberOfBytesReadWritten = 0; - DWORD NewProtect = 0; - DWORD OldProtect = 0; int bpcount=BreakPointBuffer.size(); //search for breakpoint for(int i=0; i