使用JNA列出所有导出的符号名称 [英] List all exported symbol names using JNA

查看:60
本文介绍了使用JNA列出所有导出的符号名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用JNA列出给定dll中的所有可用函数名称?

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

推荐答案

JNA允许您在运行时调用这些函数.要查看可用的工具,请使用适合该工作的工具.在Windows上,您具有" dumpbin/exports ".在Linux上,您有 objdump .在MacOSX上,您有 otool .

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.

如果要使用JNA从正在运行的Java程序中动态查找DLL中的函数名,则需要至少复制这些程序的某些功能,以分析目标文件以查找导出的符号.如果您只对Windows感兴趣,则此问题提供了一个DLL数据的解析相对简洁.

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.

这篇关于使用JNA列出所有导出的符号名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆