Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List all exported symbol names using JNA

Tags:

jna

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

like image 381
SimpleSam5 Avatar asked Sep 06 '25 09:09

SimpleSam5


1 Answers

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.

like image 113
technomage Avatar answered Sep 11 '25 04:09

technomage