【发布时间】:2017-01-20 18:13:55
【问题描述】:
给定来自cl.exe 的两个 PE 对象文件,一个 32 位和一个 64 位,我如何在不使用 unix 实用程序的情况下,最好在命令行(cmd.exe 或PowerShell)?
C:\> "...\VC\bin\cl.exe" -c test.c -Fotest32.obj
C:\> "...\VC\bin\x86_amd64\cl.exe" -c test.c -Fotest64.obj
如果我安装msys2 file 实用程序可以理解它:
$ file test*.obj
test32.obj: Intel 80386 COFF object file, not stripped, 3 sections, [...]
test64.obj: data
file --version 是 5.28,但新的 5.25 并没有做得更好。 msys2 不提供objdump.exe,但是当复制到 Linux 时,它可以正确区分这两个文件:
$ objdump -a test64.obj
test64.obj: file format pe-x86-64
$ objdump -a test32.obj
test32.obj: file format pe-i386
比file 做得更好并且可以通过 msys2 的 pacman 获得的东西也可能很有趣。
【问题讨论】:
-
微软工具是
dumpbin。
标签: c++ windows executable msys2 cl