LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-10-2019, 08:00 PM   #1
Portal
LQ Newbie
 
Registered: Jun 2019
Posts: 27

Rep: Reputation: Disabled
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.
 
Old 11-10-2019, 10:22 PM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,852
Blog Entries: 1

Rep: Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868
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

Last edited by NevemTeve; 11-11-2019 at 06:02 AM.
 
2 members found this post helpful.
Old 11-11-2019, 05:05 AM   #3
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,882

Rep: Reputation: 4988Reputation: 4988Reputation: 4988Reputation: 4988Reputation: 4988Reputation: 4988Reputation: 4988Reputation: 4988Reputation: 4988Reputation: 4988Reputation: 4988
grep 0x0804a340

You have a leading 0 missing.

Having said that, this might be easier.
objdump -d --start-address=0x804a340
 
1 members found this post helpful.
Old 11-12-2019, 06:40 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,877
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Threaded function cannot call a function with extern "C" but nonthreaded function can morty346 Programming 16 01-12-2010 05:00 PM
Address Space Randomization on 2.6.28-15-generic ubuntu 9.04. Finding base address nullprocess Linux - Kernel 1 09-14-2009 08:31 PM
Address Space Randomization on 2.6.28-15-generic ubuntu 9.04. Finding base address nullprocess Linux - Kernel 0 09-14-2009 10:45 AM
Finding Ip address with Mac address rupeshdwivedi Linux - Networking 6 09-01-2005 07:44 AM
Finding function name from address itsme86 Programming 3 07-16-2004 02:16 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration