Luc@s
03-09-2004, 23:06
If the stack expands in this mode(after a push ebp and mov esp, ebp):
esp(0x00)
-----
| | |
| \./ |
|_____|
| |
| arg1| esp+0x04
|_____|
| |
| arg2| esp+0x08
|_____|
| |
-----
If I add anything(push), the stack'll expands to down.
If I sub anything(pop), the stack'll return to up(this is, in other words, the mothod to clean the stack... in tihs case we can use both sub esp, 0x08 and ret08).
Am I wrong?
P.S: to clean stack....is enougth do this?
mov esp, ebp
pop ebp
esp(0x00)
-----
| | |
| \./ |
|_____|
| |
| arg1| esp+0x04
|_____|
| |
| arg2| esp+0x08
|_____|
| |
-----
If I add anything(push), the stack'll expands to down.
If I sub anything(pop), the stack'll return to up(this is, in other words, the mothod to clean the stack... in tihs case we can use both sub esp, 0x08 and ret08).
Am I wrong?
P.S: to clean stack....is enougth do this?
mov esp, ebp
pop ebp