Cosmos/source/Cosmos.Core.DebugStub/Utilities.xs
2017-07-14 15:20:59 -04:00

20 lines
No EOL
397 B
Text

namespace DebugStub
// Uses EAX: expected difference.
// Modifies: EBX
function CheckStack {
// after a call, the stack gets pushed to, so add 4 to the expected difference
eax + 4
EBX = EBP
EBX + EAX
if EBX != ESP {
// stack corruption.
EAX = ESP[0]
.CallerEIP = EAX
SendStackCorruptionOccurred()
halt:
goto halt
}
}