This is the part of the program that matters:
void print_flag() { // lives at address 0x214E4957 ... // nothing in the program ever calls it } void greet() { char name[16]; gets(name); // copies everything you type. never checks the length. printf("Hello %s\n", name); } // greet() is done: jump to the return address int main() { greet(); // greet() should come back here, to 0x0804925A ... }
Memory inside greet(). Each box is one byte: its value in hex, and the letter it stands for.
Return address = 0x0804925A