Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ELLIOTTCABLE/17f0f45ab69a06d788bb1251ff5883ae to your computer and use it in GitHub Desktop.
Save ELLIOTTCABLE/17f0f45ab69a06d788bb1251ff5883ae to your computer and use it in GitHub Desktop.
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
0xFF008┃(envp) ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
0xFF004┃(argv) ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
0xFF000│(argc) │◀──── (start-$sp)
├~~~~~~~~~~~~~~~~~~~~~~~~~~~~~┤ ┐
[ ($fp)-00 ] 0xFEFFC│0x00000 (non-existent $fp) │◀┼─── (previous-$fp)
├─────────────────────────────┤ │
[ ($fp)-04 ] 0xFEFF8│0xFECAFECA (another $ra) │ │ Previous
├─────────────────────────────┤ │ stack-frame
[ ($fp)-08 ] 0xFEFF4│... │ │
├─────────────────────────────┤ │
[ ($fp)-0C ] 0xFEFF0│... │ │
├~~~~~~~~~~~~~~~~~~~~~~~~~~~~~┤ ┘
[ $fp +08 ] 0xFEFEC│(2nd stack-passed arg) │
├─────────────────────────────┤
[ $fp +04 ] 0xFEFE8│(1nd stack-passed arg) │◀──── (previous-$sp)
├~~~~~~~~~~~~~~~~~~~~~~~~~~~~~┤ ┓
[ $fp -00 ] 0xFEFE4│0xFEFFC (prev. $fp) │◀╋─── $fp: 0xFEFE4
├─────────────────────────────┤ ┃
[ $fp -04 ] 0xFEFE0│0xDEADBEEF (prev. $ra) │ ┃
├─────────────────────────────┤ ┃ Current
[ $fp -08 ] 0xFEFDC│... │ ┃ stack-frame
├─────────────────────────────┤ ┃
[ $fp -0C ] 0xFEFD8│... │ ┃
├─────────────────────────────┤ ┃
[ $fp -10 ] 0xFEFD4│... │◀╋─── $sp: 0xFEFD4
└~~~~~~~~~~~~~~~~~~~~~~~~~~~~~┘ ┛
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment