Memory and the Stack
How overflows work.
Process Memory Layout
When a program runs, the operating system gives it a memory layout with distinct regions: the text (code), data/BSS (globals), the heap (dynamic allocation), and the stack.
Buffer overflows most often abuse the stack, so understanding it is essential.
What Is the Stack?
The stack is a region of memory used for function calls. It stores local variables, function arguments, and return addresses.
It grows downward on x86: pushing data moves the stack pointer toward lower addresses. This direction matters when an overflow happens.
All lessons in this course
- Memory and the Stack
- Fuzzing for Crashes
- Controlling EIP
- Shellcode and Exploitation