Skip to content

Commit

Permalink
Fix DHooks jit code stack memory alignment (#1849)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kailo97 authored and Headline committed Oct 26, 2022
1 parent a5b1311 commit b5e029d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions extensions/dhooks/DynamicHooks/hook.cpp
Expand Up @@ -355,13 +355,13 @@ void CHook::Write_CallHandler(sp::MacroAssembler& masm, HookType_t type)
Write_SaveRegisters(masm, type);

// Align the stack to 16 bytes.
masm.subl(esp, 8);
masm.subl(esp, 4);

// Call the global hook handler
masm.push(type);
masm.push(intptr_t(this));
masm.call(ExternalAddress((void *&)HookHandler));
masm.addl(esp, 16);
masm.addl(esp, 12);
}

void CHook::Write_SaveRegisters(sp::MacroAssembler& masm, HookType_t type)
Expand Down Expand Up @@ -501,4 +501,4 @@ void CHook::Write_RestoreRegisters(sp::MacroAssembler& masm, HookType_t type)
default: puts("Unsupported register.");
}
}
}
}

0 comments on commit b5e029d

Please sign in to comment.