LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Finding function with address (https://www.linuxquestions.org/questions/programming-9/finding-function-with-address-4175664030/)

Portal 11-10-2019 08:00 PM

Finding function with address
 
I have the following line of assembly code
Code:

0x08048c12 <+72>:        jmp    *0x804a340(,%eax,4)
How do I find the code block corresponding to 0x804a340? I did a
Code:

objdump -d file | grep 0x804a340
but nothing is showing, besides from the line I showed above.

NevemTeve 11-10-2019 10:22 PM

Doesn't look-like a function call... Though it might have something to do with the Procedure Linkage Table (PLT)
https://www.technovelty.org/linux/pl...libraries.html

GazL 11-11-2019 05:05 AM

grep 0x0804a340

You have a leading 0 missing.

Having said that, this might be easier.
objdump -d --start-address=0x804a340

rtmistler 11-12-2019 06:40 AM

I wouldn't use the exact address, this could be within a range of symbols, and likely is. I.e. some function is at 0x08049bab and this line happens to be within the scope of the function. The jmp does not mean it is calling a function, and there are additional references %eax,4 which are part of that line of code. Not an expert, but I thought function calls would be a branch statement. Maybe I have that in reverse and jump is the one used. Anyways, when I'm looking for where a line resides, I loop at the symbols file entirely and zero in on the location by getting close. I've rarely found an exact match.


All times are GMT -5. The time now is 12:25 AM.