How to Get A Function Name From a Library and Address in Linux C -


i learning how use functions dlopen, dlsym, etc. address of given function within given library, how do opposite? example, if know process @ gtk_main+0xa7 in libgtk-x11-2.0.so.0, how can determine function is?

thanks in advance!

if know address related object space can use nm. on own libgtk-x11… gives:

# nm -d /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.23 000000000006da20 t gtk_about_dialog_get_artists 000000000006d800 t gtk_about_dialog_get_authors 000000000006d260 t gtk_about_dialog_get_comments … 

option -d needed dynamic symbols, , should have "t" symbols (which "really" inside object). of course these addresses related object, not address space in program.

note starting addresses of entries, if address inside function should have compute nearest address. @ nm manpage other data available.

you may find objects mapped given program looking @ /proc/pid/maps, @ least.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

android - Go back to previous fragment -