在调试器下运行时更改程序流程
有什么方法可以检测调试器是否在内存中运行?
这是表单加载伪代码。
if debugger.IsRunning then
Application.exit
end if
编辑:原来的标题是“检测内存调试器”
Is there any way of detecting that a debugger is running in memory?
and here comes the on Form Load pseudocode.
if debugger.IsRunning then
Application.exit
end if
Edit: The original title was "Detecting an in memory debugger"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试以下操作
Try the following
在使用它来关闭在调试器中运行的应用程序之前,需要记住两件事:
现在,为了更有用,以下是如何使用此检测来保留 func eval 会更改程序状态。
我有时也使用此变体来确保我的调试器单步执行不会跳过评估:
Two things to keep in mind before using this to close an application running in the debugger:
Now, to be of more use, here's how to use this detection to keep func eval in the debugger from changing your program state if you have a cache a lazily evaluated property for performance reasons.
I've also used this variant at times to ensure my debugger step-through doesn't skip the evaluation: