I am having trouble grasping the answer in this stackoverflow thread. https://stackoverflow.com/a/1395646
In the middle of the answer it says Most function prologs look something like:...
As I understand the instructions in the mentioned answer --> The first instruction pushes ebp on to the stack. Then we move esp into ebp. And lastly we subract 20 from esp, making esp point 20 addresses down from where it was.
From the instructions above I visualize the stack as this.
high address
__________________________
| (an address) | <-- ebp
..........................
..........................
| | <-- esp points to an address 20
| | bytes lower
| |
| |
| |
|________________________|
low address
If this visualization is correct, how can you then push anything on the stack when you dont even have any reference to where the next local variable can be placed?