对于检查一个特定的Windows DLL是32位还是64位,读PE头将产生所需的结果。 但是需要find一个linux文件(.so)是32位还是64位。
search时,find有助于查找此信息的Linux shell脚本或命令。 但是我们需要从Windows环境中find它。 在Windows操作系统上运行的任何Windows命令或代码都应该能够提供这些信息。
.NET开发人员的stream浪文件(Windows,IIS,MS sql)
在线计数,如何处理CRLF?
在Windows上安装时,node-sass会引发错误
何时使用Wave可扩展格式?
如何访问尚未开始运行的暂停线程的堆栈?
这听起来像你想能够以编程方式来检查,而不是依靠安装Cygwin(因为如果你只是需要检查文件状态可能矫枉过正)。 您可以通过查看magic表中的ELF部分(在Cygwin的/usr/share/misc/magic中)来模拟file命令的功能:
# elf: file(1) magic for ELF executables # # We have to check the byte order flag to see what byte order all the # other stuff in the header is in. # 0 string 177ELF ELF >4 byte 0 invalid class >4 byte 1 32-bit >4 byte 2 64-bit >5 byte 0 invalid byte order >5 byte 1 LSB >>16 leshort 0 no file type,!:strength *2 !:mime application/octet-stream >>16 leshort 1 relocatable,!:mime application/x-object >>16 leshort 2 executable,!:mime application/x-executable >>16 leshort 3 shared object,
我不知道magic格式规则的确切语法,但它看起来像我可能需要检查第5个字节,这将是1为32位和2为64位
最简单的方法是安装Cygwin并使用file命令:
$ file libc.so libc.so: ELF 64-bit LSB shared object,x86-64,version 1 (SYSV),dynamically linked (uses shared lib s),BuildID[sha1]=0xdf6c83b270f1e32ea0482d61ae16933aa090870b,for GNU/Linux 2.6.24,stripped
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。