#include <stdio.h> int main(void){ int sum = 0; sum += 0xabcd; printf("%x", sum); return 0; }
This is my code, and when I use gdb, I can find another address if break main / break * main.
When I just type disassemble main, it looks like this:
Dump of assembler code for function main: 0x080483c4 <+0>: push %ebp 0x080483c5 <+1>: mov %esp,%ebp 0x080483c7 <+3>: and $0xfffffff0,%esp 0x080483ca <+6>: sub $0x20,%esp 0x080483cd <+9>: movl $0x0,0x1c(%esp) 0x080483d5 <+17>:addl $0xabcd,0x1c(%esp) 0x080483dd <+25>:mov $0x80484c0,%eax 0x080483e2 <+30>:mov 0x1c(%esp),%edx 0x080483e6 <+34>:mov %edx,0x4(%esp) 0x080483ea <+38>:mov %eax,(%esp) 0x080483ed <+41>:call 0x80482f4 < printf@plt > 0x080483f2 <+46>:mov $0x0,%eax 0x080483f7 <+51>:leave 0x080483f8 <+52>:ret End of assembler dump.
So, when I type [break * main], it starts 0x080483c4, but types [break main], it starts 0x080483cd
Why is the starting address different?
source share