Home > OS >  What does call *(%rax, %rcx,8) mean in a loop? Why do RAX and RCX change afterwards?
What does call *(%rax, %rcx,8) mean in a loop? Why do RAX and RCX change afterwards?

Time:12-12

I have this function pointer and this code:

0x0000555555556e80 < 0>:     push   %rbp
0x0000555555556e81 < 1>:     mov    %rsp,%rbp
0x0000555555556e84 < 4>:     sub    $0x10,%rsp
0x0000555555556e88 < 8>:     movl   $0x0,-0x4(%rbp)
0x0000555555556e8f < 15>:    movslq -0x4(%rbp),%rcx
0x0000555555556e93 < 19>:    lea    0x7406(%rip),%rax        # 0x55555555e2a0 <init_functions>
0x0000555555556e9a < 26>:    cmpq   $0x0,(%rax,%rcx,8)
0x0000555555556e9f < 31>:    je     0x555555556ec1 <initialize_bomb 65>
0x0000555555556ea5 < 37>:    movslq -0x4(%rbp),%rcx
0x0000555555556ea9 < 41>:    lea    0x73f0(%rip),%rax        # 0x55555555e2a0 <init_functions>
0x0000555555556eb0 < 48>:    call   *(%rax,%rcx,8)
0x0000555555556eb3 < 51>:    mov    -0x4(%rbp),           
  • Related