Cosmos/source/Cosmos.Debug.DebugStub/Utilities.xs
2014-11-26 01:13:58 +00:00

20 lines
No EOL
416 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
}
}