Reputation:
I'm dealing with some x86 code and I know for the most part what the jmp
command is used for and what it does, but this one line absolutely perplexes me.
jmp *0x804a0e0(,%eax,4)
eax
is dependent on earlier input and should be an int. 0x804a0e0 contains 60 (base 10). Can someone please explain what this is saying?
Upvotes: 2
Views: 743
Reputation: 213456
jmp *0x804a0e0(,%eax,4)
This instruction is quite simple: given an array
of function pointers (the array starts at address 0x804a0e0
), and an index i
(stored in %eax
), call the function, a pointer to which is stored in array[i]
.
You are most likely to encounter such instruction in C++ (virtual function calls are implemented this way).
Using (gdb) info symbol 0x804a0e0
will tell you what global the array
actually corresponds to.
Upvotes: 3