MSVC删除ESP和JMC(Checkfordebugger)特定功能的呼叫生成

发布于 2025-02-13 00:27:15 字数 288 浏览 0 评论 0原文

我有一个要反弹到shellCode的函数。为了将来易于使用,我不必在可能使用它的项目上单独编译它或诱导严格的编译器设置。

我有3件事,我想做3件事

禁用JMC _checkFormyDebugger呼叫call nod

disable _check_esp call eneration(使用__declSpec(SafeBuffer)完成)

禁用函数comdat linking/jmp linking/jmp函数链接

到所有功能,我可以使用任何线索,我可以使用任何线索是否使用MSVC?

I have a function I want to bounce to shellcode. for ease of use in the future, i'd like to not have to separately compile it or induce strict compiler settings on projects that may use it.

I have 3 things i'd like to do

disable JMC _CheckForMyDebugger call generation

disable _Check_ESP call generation (done with __declspec(safebuffer))

disable function comdat linking/jmp function linking

All on a per function basis, any clues into what I can use to do this using MSVC?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

在风中等你 2025-02-20 00:27:15

如果您发现了这个问题,则通过搜索数小时,这就是我所弄清楚的:

用__declSpec(SafeBuffers)声明功能,并将它们包装在以下pragma中定义:

#pragma runtime_checks( "", off )
[function here]
#pragma runtime_checks( "", restore )

这将删除ESP检查

JMC和COMDAT链接,您必须调整调整项目设置。不幸的是,MSVC没有提供设置以每功能调整这些设置。

If you found this question, through hours of searching here's what I've figured out:

Declare functions with __declspec(safebuffers) and wrap them in the following pragma defines :

#pragma runtime_checks( "", off )
[function here]
#pragma runtime_checks( "", restore )

This removes the ESP checks

As for JMC and comdat linking, you must adjust the project settings. Unfortunately MSVC doesn't offer settings to adjust those on a per-function basis.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文