Confused by [ebp-0xc] instead of [ebp-4] in Art of Exploitation example
问题 I am reading the book Hacking: The Art of Exploitation , 2nd Edition and in the simple C program #include <stdio.h> int main() { int i; for (i = 0; i < 10; i++) { puts("Hello, world!\n"); } return 0; } The book lists that the gdb debug will modify the ebp register first: (gdb) x/i $eip 0x8048384 <main+16>: mov DWORD PTR [ebp-4],0x0 As it explains that This assembly instruction will move the value of 0 into memory located at the address stored in the EBP register, minus 4. This is where the C