<small id='3s3Rf'></small><noframes id='3s3Rf'>

      <legend id='3s3Rf'><style id='3s3Rf'><dir id='3s3Rf'><q id='3s3Rf'></q></dir></style></legend>

        <tfoot id='3s3Rf'></tfoot>

        <i id='3s3Rf'><tr id='3s3Rf'><dt id='3s3Rf'><q id='3s3Rf'><span id='3s3Rf'><b id='3s3Rf'><form id='3s3Rf'><ins id='3s3Rf'></ins><ul id='3s3Rf'></ul><sub id='3s3Rf'></sub></form><legend id='3s3Rf'></legend><bdo id='3s3Rf'><pre id='3s3Rf'><center id='3s3Rf'></center></pre></bdo></b><th id='3s3Rf'></th></span></q></dt></tr></i><div id='3s3Rf'><tfoot id='3s3Rf'></tfoot><dl id='3s3Rf'><fieldset id='3s3Rf'></fieldset></dl></div>

          <bdo id='3s3Rf'></bdo><ul id='3s3Rf'></ul>

        如何在程序执行的最开始设置断点

        时间:2023-05-23
        <legend id='l0Qsd'><style id='l0Qsd'><dir id='l0Qsd'><q id='l0Qsd'></q></dir></style></legend>
              <i id='l0Qsd'><tr id='l0Qsd'><dt id='l0Qsd'><q id='l0Qsd'><span id='l0Qsd'><b id='l0Qsd'><form id='l0Qsd'><ins id='l0Qsd'></ins><ul id='l0Qsd'></ul><sub id='l0Qsd'></sub></form><legend id='l0Qsd'></legend><bdo id='l0Qsd'><pre id='l0Qsd'><center id='l0Qsd'></center></pre></bdo></b><th id='l0Qsd'></th></span></q></dt></tr></i><div id='l0Qsd'><tfoot id='l0Qsd'></tfoot><dl id='l0Qsd'><fieldset id='l0Qsd'></fieldset></dl></div>
                <bdo id='l0Qsd'></bdo><ul id='l0Qsd'></ul>
                  <tfoot id='l0Qsd'></tfoot>
                    <tbody id='l0Qsd'></tbody>
                • <small id='l0Qsd'></small><noframes id='l0Qsd'>

                • 本文介绍了如何在程序执行的最开始设置断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  如何在加载任何链接的 DLL 之前停止程序?

                  我尝试在 Break At Function 调试选项中设置 LoadLibraryExW 函数,它在该函数处停止,但在此之前,我在 Visual Studio 输出中有以下内容窗户:

                  <前>'test.exe':加载 'C:WindowsSystem32 tdll.dll',加载符号(源信息被删除).test.exe":加载C:WindowsSystem32kernel32.dll",加载符号(源信息被删除).'test.exe':已加载 'C:WindowsSystem32KernelBase.dll',已加载符号(源信息已删除).test.exe":加载C:WindowsSystem32uxtheme.dll",加载符号(源信息被删除).'test.exe':已加载 'C:WindowsSystem32msvcrt.dll',已加载符号(源信息已删除).---- 加上大约 30 个 DLL ---

                  那么如何在加载 ntdll.dll 之前停止调试器中的程序?好的,不是在加载之前,而是在执行任何 DllMain 函数之前和初始化任何静态对象之前.

                  解决方案

                  您可以通过将注册表项添加到图像文件执行选项"并使用您的 exe 名称来实现.添加名为Debugger"的字符串类型值并将其设置为 vsjitdebugger.exe 以启动即时调试器对话框.然后,您可以选择一种可用的调试器,包括 Visual Studio.此对话框在 Windows 加载 EXE 之后,在任何代码开始运行之前立即触发.

                  这是在您启动 notepad.exe 时触发对话框的示例 .reg 文件.将密钥名称修改为您的 .exe:

                  REGEDIT4[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionImage File Execution Options
                  otepad.exe]"调试器"="vsjitdebugger.exe"

                  How can I stop the program before loading any of the linked DLLs?

                  I've tried to set LoadLibraryExW function in the Break At Function debugging option and it stops at that function, but before that I have the following in Visual Studio output windows:

                  'test.exe': Loaded 'C:WindowsSystem32
                  tdll.dll', Symbols loaded (source information stripped).
                  'test.exe': Loaded 'C:WindowsSystem32kernel32.dll', Symbols loaded (source information stripped).
                  'test.exe': Loaded 'C:WindowsSystem32KernelBase.dll', Symbols loaded (source information stripped).
                  'test.exe': Loaded 'C:WindowsSystem32uxtheme.dll', Symbols loaded (source information stripped).
                  'test.exe': Loaded 'C:WindowsSystem32msvcrt.dll', Symbols loaded (source information stripped).
                  ---- plus about 30 DLLs ---
                  

                  So how can I stop the program in the debugger before loading the ntdll.dll? Ok, not before loading, but before executing any of DllMain functions and before initializing any of static objects.

                  解决方案

                  You can do this by adding a registry key to "Image File Execution Options" with the name of your exe. Add a value of type string named "Debugger" and set it to vsjitdebugger.exe to launch the just-in-time debugger dialog. Which then lets you pick one of the available debuggers, including Visual Studio. This dialog is triggered right after Windows has loaded the EXE, before any code starts running.

                  Here's is a sample .reg file that triggers the dialog when you start notepad.exe. Modify the key name to your .exe:

                  REGEDIT4
                  
                  [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionImage File Execution Options
                  otepad.exe]
                  "Debugger"="vsjitdebugger.exe"
                  

                  这篇关于如何在程序执行的最开始设置断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何获取 Windows 上的视频捕获设备(网络摄像头 下一篇:使用 CreateWindowExW 时堆损坏

                  相关文章

                  最新文章

                • <tfoot id='nr4eV'></tfoot>
                    <i id='nr4eV'><tr id='nr4eV'><dt id='nr4eV'><q id='nr4eV'><span id='nr4eV'><b id='nr4eV'><form id='nr4eV'><ins id='nr4eV'></ins><ul id='nr4eV'></ul><sub id='nr4eV'></sub></form><legend id='nr4eV'></legend><bdo id='nr4eV'><pre id='nr4eV'><center id='nr4eV'></center></pre></bdo></b><th id='nr4eV'></th></span></q></dt></tr></i><div id='nr4eV'><tfoot id='nr4eV'></tfoot><dl id='nr4eV'><fieldset id='nr4eV'></fieldset></dl></div>

                  1. <small id='nr4eV'></small><noframes id='nr4eV'>

                    • <bdo id='nr4eV'></bdo><ul id='nr4eV'></ul>

                    1. <legend id='nr4eV'><style id='nr4eV'><dir id='nr4eV'><q id='nr4eV'></q></dir></style></legend>