The stack grows up negatively The stack has a size is:

Stack Representations

C Initial Program Run Stack

Function Stack

Drawing 2025-06-24 20.46.23.excalidraw

⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠

Text Elements

Ret Addr

esp

0x3000

0x4000

first argument

older variables…

Function Locals

Function

second argument

n bytes

4 bytes

n bytes

n bytes

Function With Arguments

Link to original

  • Oftentimes, the return address is 4 bytes, so 4 bytes of junk are used as padding

Concepts