diff --git a/cleo_plugins/MemoryOperations/MemoryOperations.cpp b/cleo_plugins/MemoryOperations/MemoryOperations.cpp index d2ecb49d..4b48dda1 100644 --- a/cleo_plugins/MemoryOperations/MemoryOperations.cpp +++ b/cleo_plugins/MemoryOperations/MemoryOperations.cpp @@ -279,8 +279,8 @@ class MemoryOperations auto size = OPCODE_READ_PARAM_INT(); auto virtualProtect = OPCODE_READ_PARAM_BOOL(); - // validate params - if (size < 0 || size > sizeof(SCRIPT_VAR)) + // allowed sizes: 0, 1, 2, 3, 4 and multiplies of 4 until 256 + if (size < 0 || size > (64 * 4) || (size > 4 && (size % 4 != 0))) { SHOW_ERROR("Invalid '%d' size argument in script %s\nScript suspended.", size, ScriptInfoStr(thread).c_str()); return thread->Suspend();