你能找出哪个编译器是用来编译程序的吗?
给定一个从 C 编译并在 Solaris 上运行的可执行文件,是否可以确定使用哪个编译器来编译相关的不完整的可执行文件?
使用字符串或文件命令时我看不到任何内容,并且 magic 似乎不包含任何特定内容。
编译器通常会在其可执行输出文件中添加指纹吗?
干杯,
Given an executable that is compiled from C to run on Solaris, is it possible to determine which compiler was used to compile the associated incomplete executable?
I can't see anything when using either the strings or the file command, and magic doesn't seem to contain anything specific.
Do compilers generally put a fingerprint in their executable output files?
cheers,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
是的,IDA 对此非常有用。 它使用一种名为 FLIRT 的技术。
Yes IDA is great for this. It uses a technology called FLIRT.
PEID 就可以了。 它通常工作得很好。 显然PEID是一个Windows工具,但它不重要,应该向编译器显示(有时甚至是特定的版本信息)
PEID will do the trick. It generally works just great. Obviously PEID is a windows tool but it shouldn't matter and should show you to compiler (sometimes even specific version information)
如果可执行文件未被删除,请尝试 /usr/ccs/bin mcs-p
这通常会显示编译器、链接器和所有使用的头文件
If the executable isn't stripped, try /usr/ccs/bin mcs-p
This will usually show the compiler, linker and all the header files used
使用您尝试识别的每个编译器构建小型测试应用程序。 然后在十六进制编辑器中查看结果,并尝试查找模式。 它可能会变得非常明显 - 例如 "Rich" 签名微软的链接器。
Build small test apps with each compiler you're trying to identify. Then look at the results in a hex editor, and try to find patterns. It might turn out to be really obvious -- for example the "Rich" signatures from Microsoft's linker.
未剥离:
$ cc -O hello.c
$ 文件 a.out
a.out:ELF 32 位 MSB 可执行文件 SPARC32PLUS 版本 1,V8+ 必需,动态链接,未剥离
$ strings -a a.out | 未剥离: grep cc
/opt/solarisstudio12.3/prod/bin/cc -O hello.c
$ dwarfdump -i a.out | grep cc /opt/solarisstudio12.3/prod/bin/cc -O hello.c grepcompile_o
DW_AT_SUN_compile_options Xa;O;R=Sun C 5.12 SunOS_sparc 补丁 148917-07 2013/10/18;backend;raw;cd;
剥离:
$ strip a.out
$ 文件 a.out
a.out:ELF 32 位 MSB 可执行文件 SPARC32PLUS 版本 1,V8+ 必需,动态链接,剥离
$ strings -a a.out | grep 抄送
(无)
Not stripped:
$ cc -O hello.c
$ file a.out
a.out: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, dynamically linked, not stripped
$ strings -a a.out | grep cc
/opt/solarisstudio12.3/prod/bin/cc -O hello.c
$ dwarfdump -i a.out | grep compile_o
DW_AT_SUN_compile_options Xa;O;R=Sun C 5.12 SunOS_sparc Patch 148917-07 2013/10/18;backend;raw;cd;
Stripped:
$ strip a.out
$ file a.out
a.out: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, dynamically linked, stripped
$ strings -a a.out | grep cc
(none)
Visual Studio 和 GCC 通常遵循不同的启动例程(调用 main)。 这也许是一个暗示。 不过我不知道其他人的情况。 对于 dll,我想不出类似的东西。
Visual Studio and GCC typically follow different startup routines (which call main). That maybe a hint. I don't know about others though. For dlls, can't think of something similar off the top of my head.
编译器通常在编译文件中添加自己的个人“签名”作为明文。 您可以使用字符串等工具来提取明文。
Compilers usually add their own personal "signature" as plaintext in the compiled files. You can use a tool such as strings to suss the plaintext out.