Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to read the contents of .so file without loading it?

Is there any way to read the content of a .SO(shared objects) file without loading it?

My use-case scenario is:

  1. I have a .so file on windows. I need to query for some methods whether they are present in .so or not.
  2. To know all the classes in a .so file.
  3. Given a class name need to find all the methods on this class.

Note: I can easily do these things on DLL. Also I am working on windows so I can't load a .SO file.

Thanks

like image 435
Guruji Avatar asked Oct 16 '13 05:10

Guruji


People also ask

How do I view the contents of a .so file?

Instead, they're just placed in an appropriate folder and used automatically by other programs via Linux's dynamic link loader. However, you might be able to read the SO file as a text file by opening it in a text editor like Leafpad, gedit, KWrite, or Geany if you're on Linux, or Notepad++ on Windows.

Can you open .so files?

An . so file is a binary file used as a native library on Android. Normally it's a part of an Android application. If you want to see its content, you need to open it as a binary file in a binary (hex) viewer.

What does .so file contain?

An SO file is a shared library used by programs installed on the Linux and Android operating systems. It contains common program functions and logic that multiple programs require access to.


1 Answers

To screen: readelf -a <file>

To save the output, dump it into a file. For example, I'm learning about the Python RPi.GPIO module on Raspberry Pi, which is stored in /usr/lib/python2.7/dist-packages/RPi, so I run: readelf -a GPIO.so > ~/gpio.so.out

like image 72
TCAllen07 Avatar answered Oct 04 '22 18:10

TCAllen07