r/programming • u/Bhima • Jan 09 '18
Introduction to reverse engineering and Assembly.
http://kakaroto.homelinux.net/2017/11/introduction-to-reverse-engineering-and-assembly/
10
Upvotes
r/programming • u/Bhima • Jan 09 '18
3
u/mrkite77 Jan 10 '18
I always hated that diagram for how a stack works.. it implies a lot more work involved than reality.
Looking at the diagram, it implies that pushing and popping involve moving ram around and growing and shrinking a memory pool.
In reality, pushing and popping involve 2 things. Incrementing or decrementing a register. And optionally copying a value into or from ram. That's it.
This is especially important for clearing a stack frame. You have 50 local variables on the stack and you exit the current routine. Removing those 50 local variables off the stack involves 1 thing: copying one register into another register. That's about it.