- Stack (push, pop, stack pointer, stack frame pointer)
- Heap (malloc, calloc, global, static)
- Registers (addresses, values)
- Instructions (mov, add, jmp, jne)
- push adds an element to the top of the stack
- pop removes the top element from the stack
- each element has a stack address
- the stack grows towards lower memory addresses (windows)
- elements near the top of the stack have a lower address
- elements near the bottom of the stack have a higher address
- whenever a function is called that function is set up with a stack frame
- all the local variables of the function are stored in that function's stack frame
- ebp register, aka the base pointer, contains the address for the current stack frame
- esp register, aka the stack pointer, points to the top element of the current stack frame
TBC
- 6 General Purpose Registers (eax ebx ecx edx esi edi)
- 3 Reserved Registers (ebp esp eip)
- eip - instruction pointer
- esp - stack pointer
- ebp - (frame) base pointer
- mov, push, pop
- add, sub
- cmp
- jmp
- nop
- call
- inc
- ret
- lea
- je, jne, jle, jg