assembly - GDB expressions -
0x00000000004013fb <+334>: mov 0x602500(,%rax,8),%rdx
i want know 0x602500(,%rax,8)
means.
there source code
0x00000000004012fb <+78>: movq $0x400a8c,0x2011fa(%rip) # 0x602500 <func> 0x0000000000401306 <+89>: movq $0x400d44,0x2011f7(%rip) # 0x602508 <func+8> 0x0000000000401311 <+100>: movq $0x400faa,0x2011f4(%rip) # 0x602510 <func+16> 0x000000000040131c <+111>: movq $0x401262,0x2011f1(%rip) # 0x602518 <func+24> 0x0000000000401327 <+122>: movq $0x401295,0x2011ee(%rip) # 0x602520 <func+32>
each 0x400a8c, 400d44, 400faa, 401262 , 401295 address of functions guess 0x602500(,%rax,8)
choose proper function execute rax. want make sure guess
from gnu documentation:
https://sourceware.org/binutils/docs/as/i386_002dmemory.html#i386_002dmemory
an intel syntax indirect memory reference of form section:[base + index*scale + disp] translated at&t syntax section:disp(base, index, scale)
in other words:
you derive pointer (compute address) rax, scale = 8
then take offset of 0x602500 address
and write value (the value @ address + 0x602500) %rdx
scale values might 1, 2, 4, or 8: byte, 16-bit, 32-bit or 64-bit.
Comments
Post a Comment