Skip to content

Commit

Permalink
0AA6 pointer validation relaxed for legacy scripts (#82)
Browse files Browse the repository at this point in the history
* 0AA6 pointer validation relaxed for legacy scripts

* fixup! 0AA6 pointer validation relaxed for legacy scripts
  • Loading branch information
MiranDMC authored Mar 1, 2024
1 parent 8386bb1 commit aace429
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cleo_plugins/MemoryOperations/MemoryOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,17 @@ class MemoryOperations
static OpcodeResult __stdcall opcode_0AA6(CLEO::CRunningScript* thread)
{
auto func = OPCODE_READ_PARAM_PTR();
auto obj = OPCODE_READ_PARAM_PTR();

void* obj = nullptr;
if (!IsLegacyScript(thread))
{
obj = OPCODE_READ_PARAM_PTR();
}
else
{
obj = (void*)OPCODE_READ_PARAM_INT(); // at least one mod used 0AA6 with 0 as struct argument (effectively turning it into 0AA5 opcode...)
}

auto numArgs = OPCODE_READ_PARAM_INT();
auto numPop = OPCODE_READ_PARAM_INT();

Expand Down

0 comments on commit aace429

Please sign in to comment.