Buffer overflow in C
问题 I'm attempting to write a simple buffer overflow using C on Mac OS X 10.6 64-bit. Here's the concept: void function() { char buffer[64]; buffer[offset] += 7; // i'm not sure how large offset needs to be, or if // 7 is correct. } int main() { int x = 0; function(); x += 1; printf("%d\n", x); // the idea is to modify the return address so that // the x += 1 expression is not executed and 0 gets // printed return 0; } Here's part of main's assembler dump: ... 0x0000000100000ebe <main+30>: callq