mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 20:39:01 +00:00
20 lines
No EOL
397 B
Text
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
|
|
}
|
|
} |