Q: Is it necessarily bad if you push a few too many values to the stack? i.e.
.code
invoke GetHandle,STD_OUTPUT_HANDLE
mov hConsole,eax
push eax
push ecx
push MyVar
push GeorgeW.Bush
invoke ExitProcess,0
What happens to those values, does ExitProcess clean up all the stack space used or simply increment past it? Thanks.
Well...if memory serves...the stack wouldn't be balanced. But since you're exiting I would assume it would be ignored
Presumably it loads the appropriate stack pointer from a fixed memory location (relative to FS probably) or changes context and simply frees all of the memory. If it doesn't crash on exit, it's probably all right.
It seems you can mess up the stack all you want - pushing or popping (as long as you don't get an exception as a result of those actions.)
ExitProcess destroys 'your' stack and ignores.