如何判断二进制文件是否经过 GS 编译且没有符号?
我希望能够确定二进制文件是否经过 GS 编译? /GS 是缓冲区安全检查,使用 cookie。我希望能够在没有符号的情况下以通用方式找到它。
BinScope 在尝试检查 GS 时向我提供以下信息: E_PDB_NO_DEBUG_INFO(PDB 已删除简历信息)
有什么想法吗?
I want to be able to determine if a binary is GS compiled or not? /GS being a buffer security check, using a cookie. I want to be able to find this without symbols and in a generic manner.
BinScope gives me the following when it tries to check for GS:
E_PDB_NO_DEBUG_INFO (PDB is stripped of cv info)
Any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您没有 PDB,除了检查二进制文件和查看函数之外,没有什么好方法可以做到这一点。我原以为应该可以检查记录安全 cookie 位置的 loadconfig 目录,但这并不好。即使程序是使用 /GS- 编译的,链接的 CRT 函数仍然使用 cookie:
If you don't have PDB, there is no good way to do it short of inspecting the binary and looking at the functions. I had thought it should be possible to check the loadconfig directory which records the location of the security cookie, but that's no good. Even if the program is compiled with /GS-, the linked CRT functions still use the cookie:
如果您的二进制文件没有“加载配置”(例如 Windows Mobile 二进制文件)
我认为识别该模式仍然很容易:
许多函数看起来像这样:
然后 sub_1007147 看起来像这样:
引用与其逆存储在一起的 cookie:
__security_cookie 将有很多引用,而前面的逆只有一个很少。
在 init 列表中会有一个函数用一些伪随机值初始化 cookie。
在二进制文件中搜索这些模式应该可以让您了解是否使用了 /GS。
if your binary does not have a 'load config' ( like for instance windows mobile binaries)
i think it is still quite easy to recognize the pattern:
many functions will look like this:
then sub_1007147 looks like this:
referencing the cookie which is stored together with it's inverse:
the __security_cookie will have lots of references while the preceeding inverse has only a few.
in the init list there will be a function to initialize the cookie with some pseudo random value.
searching the binary for these patterns should give you an idea if /GS was used.