I have a static C library (say mylib.a) and I was wondering if it's possible to find out what functions are implemented inside that file. I don't have a corresponding header file. what I need is like the equivalent of javap for Java.
Asked
Active
Viewed 4.0k times
40
Vadim Kotov
- 8,084
- 8
- 48
- 62
cd1
- 15,908
- 12
- 46
- 47
2 Answers
49
On Windows you can use dumpbin. On Linux and friends you can use nm.
James McNellis
- 348,265
- 75
- 913
- 977
-
6nm works with both dynamic (libfoo.so) and static (libbar.a) libraries – Kemin Zhou Jan 07 '17 at 07:40
36
Use nm. That will only give you the symbol names - of which most of the symbols prefixed with T will be functions. Function arguments are not retained in the binary.
Vadim Kotov
- 8,084
- 8
- 48
- 62
nos
- 223,662
- 58
- 417
- 506