I am going through the book Hacking : The Art of Exploitation which uses 32bit assembly, and my machine is 64 bit. Now I understand that's not a great thing, but this is the question.
As I debug this program,
Reading symbols from ./a.out...
(gdb) break main
Breakpoint 1 at 0x113d: file first.c, line 6.
(gdb) run
Starting program: /home/kingvon/Desktop/asm/a.out
Breakpoint 1, main () at first.c:6
6 for(i=0; i < 10; i++){
(gdb) x/3i $rip
=> 0x55555555513d <main+8>: movl $0x0,-0x4(%rbp)
0x555555555144 <main+15>: jmp 0x555555555156 <main+33>
0x555555555146 <main+17>: lea 0xeb7(%rip),%rdi # 0x555555556004
this is what I see on my machine(64 bit),
0x55555555513d <main+8>: movl $0x0,-0x4(%rbp)
but in the example(32 bit) given it says:
0x55555555513d <main+8>: mov DWORD PTR [ebp-4],0x0
From reading the 32 bit assembly it is quite clear that this should mean that the machine will move the value of 0 into memory location stored in the EBP register minus 4. I am aware both instructions do the same things, but I feel the 64 instruction does not look like what it really means. How can the 64 instruction interpreted/worded? I am aware that the register names are different on 64 bit