Element #0
Element #1
Element #2
Stack Direction
Element #2
Element #3
Element #0
Element #1
Element #2
Element #3
Stack Direction
Descending
Ascending
Low memory addresses
Low memory addresses
Element #2
Buffer
#include <stdio.h>
int main(){
char buffer[500];
int deadbeef = 0xdeadbeef;
scanf("%600s",&input);
return 0;
}
Return address
Base pointer
input[500]
0xdeadbeef
The user inputs more than 500 characters
#include <stdio.h>
int main(){
char buffer[500];
int deadbeef = 0xdeadbeef;
scanf("%600s",&input);
return 0;
}
Return address
Base pointer
input[500]
0xdeadbeef
The user inputs more than 500 characters with shellcode.
Shellcode
Return address
Base pointer
input[500]
0xdeadbeef
Shellcode
NOP Slide
Intel x86 instruction - 0x90
ARM A64 instruction - 0xD503201F
Intel 8051 instruction - 0x00