3

How can you list all available function names in a given dll using JNA?

SimpleSam5
  • 3,280
  • 2
  • 16
  • 13

1 Answers1

5

JNA lets you invoke those functions at runtime. To see what is available, use a tool appropriate for the job. On windows, you have "dumpbin /exports". On linux, you have objdump. On MacOSX you have otool.

If you want to dynamically look up function names in a DLL from a running Java program using JNA, then you'd need to duplicate at least some of the functionality of those programs to parse the object file looking for exported symbols. If you're only interested in windows, then this question provides a relatively concise parsing of the DLL data.

Community
  • 1
  • 1
technomage
  • 9,861
  • 2
  • 26
  • 40