-1

I was going through a project which has program files but their definitions are defined elsewhere,so how to open .so file in linux to check if c++ source files/objects files for the program are present in .so file

PRASH
  • 17
  • 3
  • @drescherjn it shows how to list all the .so files but I need to open the files that is made into shared library file – PRASH May 15 '20 at 17:29
  • You cannot recover the original source code from compiled files. The compilation process is a *one way* transformation. – Jesper Juhl May 15 '20 at 17:47
  • Will decompiler help in any case? – PRASH May 17 '20 at 17:09
  • Not in reconstructing the original source. That's *impossible*. A decompiler *may* get you some version of a C++ source that can *maybe* get re-compiled to generate something close to what it decompiled, but it'll never look even close to the original. – Jesper Juhl May 17 '20 at 17:17

2 Answers2

2

.so files are shared library files. You can use nm to inspect which symbols are defined in the file.

https://linux.die.net/man/1/nm

zman200
  • 21
  • 2
0

The readelf can help you. The website is http://man7.org/linux/man-pages/man1/readelf.1.html.

You can use readelf -s ./your-file.so to see it.

tyChen
  • 1,404
  • 8
  • 27