Skip to content

Commit

Permalink
Removed duplicated address checks from memory read/write opcodes. (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiranDMC authored Mar 26, 2024
1 parent 52b6513 commit f363d5f
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions cleo_plugins/MemoryOperations/MemoryOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,6 @@ class MemoryOperations
auto virtualProtect = OPCODE_READ_PARAM_BOOL();

// validate params
if ((size_t)address <= MinValidAddress)
{
SHOW_ERROR("Invalid '0x%X' pointer param in script %s\nScript suspended.", address, ScriptInfoStr(thread).c_str());
return thread->Suspend();
}

if (size < 0)
{
SHOW_ERROR("Invalid '%d' size argument in script %s\nScript suspended.", size, ScriptInfoStr(thread).c_str());
Expand Down Expand Up @@ -263,12 +257,6 @@ class MemoryOperations
auto virtualProtect = OPCODE_READ_PARAM_BOOL();

// validate params
if ((size_t)address <= MinValidAddress)
{
SHOW_ERROR("Invalid '0x%X' pointer param of in script %s\nScript suspended.", address, ScriptInfoStr(thread).c_str());
return thread->Suspend();
}

if (size < 0 || size > sizeof(SCRIPT_VAR))
{
SHOW_ERROR("Invalid '%d' size argument in script %s\nScript suspended.", size, ScriptInfoStr(thread).c_str());
Expand Down

0 comments on commit f363d5f

Please sign in to comment.