ESP 100 int fint x 200 int gint

  • Slides: 15
Download presentation
ESP 100: int f(int x) {. . } 200: int g(int y) { ….

ESP 100: int f(int x) {. . } 200: int g(int y) { …. 250: f(2); …. } EIP 300: int main() { …. 350: g(1); …. }

ESP 1 100: int f(int x) {. . } 200: int g(int y) {

ESP 1 100: int f(int x) {. . } 200: int g(int y) { …. 250: f(2); …. } EIP 300: int main() { …. 350: g(1); …. }

1 ESP 100: int f(int x) {. . } return address to main 200:

1 ESP 100: int f(int x) {. . } return address to main 200: int g(int y) { …. 250: f(2); …. } EIP 300: int main() { …. 350: g(1); …. }

1 ESP 100: int f(int x) {. . } return address to main EIP

1 ESP 100: int f(int x) {. . } return address to main EIP 200: int g(int y) { …. 250: f(2); …. } 300: int main() { …. 350: g(1); …. }

1 100: int f(int x) {. . } return address to main ESP Old

1 100: int f(int x) {. . } return address to main ESP Old EBP EIP 200: int g(int y) { …. 250: f(2); …. } 300: int main() { …. 350: g(1); …. }

1 100: int f(int x) {. . } return address to main ESP Old

1 100: int f(int x) {. . } return address to main ESP Old EBP EIP 200: int g(int y) { …. 250: f(2); …. } 300: int main() { …. 350: g(1); …. }

1 100: int f(int x) {. . } return address to main Old EBP

1 100: int f(int x) {. . } return address to main Old EBP ESI EDI EBX ESP Local Variables EIP 200: int g(int y) { …. 250: f(2); …. } 300: int main() { …. 350: g(1); …. }

1 100: int f(int x) {. . } return address to main Old EBP

1 100: int f(int x) {. . } return address to main Old EBP ESI EDI EBX ESP Local Variables EIP 200: int g(int y) { …. 250: f(2); …. } 300: int main() { …. 350: g(1); …. }

1 100: int f(int x) {. . } return address to main Old EBP

1 100: int f(int x) {. . } return address to main Old EBP ESI EDI EBX Local Variables ESP 2 EIP 200: int g(int y) { …. 250: f(2); …. } 300: int main() { …. 350: g(1); …. }

1 100: int f(int x) {. . } return address to main Old EBP

1 100: int f(int x) {. . } return address to main Old EBP ESI EDI EBX Local Variables 2 ESP return address to g EIP 200: int g(int y) { …. 250: f(2); …. } 300: int main() { …. 350: g(1); …. }

1 EIP return address to main Old EBP ESI EDI EBX Local Variables 2

1 EIP return address to main Old EBP ESI EDI EBX Local Variables 2 ESP return address to g EBP 100: int f(int x) {. . } 200: int g(int y) { …. 250: f(2); …. } 300: int main() { …. 350: g(1); …. }

1 EIP return address to main Old EBP ESI EDI EBX Local Variables 2

1 EIP return address to main Old EBP ESI EDI EBX Local Variables 2 return address to g ESP EBP 100: int f(int x) {. . } 200: int g(int y) { …. 250: f(2); …. } Old EBP 300: int main() { …. 350: g(1); …. }

1 EIP return address to main Old EBP ESI 200: int g(int y) {

1 EIP return address to main Old EBP ESI 200: int g(int y) { …. 250: f(2); …. } EDI EBX Local Variables 2 return address to g ESP Old EBP 100: int f(int x) {. . } EBP 300: int main() { …. 350: g(1); …. }

1 EIP return address to main Old EBP ESI 200: int g(int y) {

1 EIP return address to main Old EBP ESI 200: int g(int y) { …. 250: f(2); …. } EDI EBX Local Variables 2 return address to g Old EBP ESI EDI EBX ESP Local Variables 100: int f(int x) {. . } EBP 300: int main() { …. 350: g(1); …. }

1 EIP return address to main Old EBP ESI 200: int g(int y) {

1 EIP return address to main Old EBP ESI 200: int g(int y) { …. 250: f(2); …. } EDI EBX Local Variables 2 Function Frames return address to g Old EBP ESI EDI EBX ESP Local Variables 100: int f(int x) {. . } EBP 300: int main() { …. 350: g(1); …. }