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, 09:00 PM   #1
Portal
LQ Newbie
 
Registered: Jun 2019
Posts: 15

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, 11:22 PM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 3,882

Rep: Reputation: 1356Reputation: 1356Reputation: 1356Reputation: 1356Reputation: 1356Reputation: 1356Reputation: 1356Reputation: 1356Reputation: 1356Reputation: 1356
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 07:02 AM.
 
2 members found this post helpful.
Old 11-11-2019, 06:05 AM   #3
GazL
LQ Guru
 
Registered: May 2008
Posts: 5,262
Blog Entries: 18

Rep: Reputation: 3014Reputation: 3014Reputation: 3014Reputation: 3014Reputation: 3014Reputation: 3014Reputation: 3014Reputation: 3014Reputation: 3014Reputation: 3014Reputation: 3014
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, 07:40 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: MA, USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,158
Blog Entries: 13

Rep: Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567
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 06:00 PM
Address Space Randomization on 2.6.28-15-generic ubuntu 9.04. Finding base address nullprocess Linux - Kernel 1 09-14-2009 09:31 PM
Address Space Randomization on 2.6.28-15-generic ubuntu 9.04. Finding base address nullprocess Linux - Kernel 0 09-14-2009 11:45 AM
Finding Ip address with Mac address rupeshdwivedi Linux - Networking 6 09-01-2005 08:44 AM
Finding function name from address itsme86 Programming 3 07-16-2004 03:16 AM

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

All times are GMT -5. The time now is 01:15 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration