Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6030771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:05:11+00:00 2026-05-23T05:05:11+00:00

When debugging a Windows process, it would sometimes be convenient to break as early

  • 0

When debugging a Windows process, it would sometimes be convenient to break as early as possible.

Inital Callstack looks like this: (you get this e.g. when you set a breakpoint in a DllMain function on DLL_PROCESS_ATTACH)

    ...
    ntdll.dll!_LdrpCallInitRoutine@16()  + 0x14 bytes   
    ntdll.dll!_LdrpRunInitializeRoutines@4()  + 0x205 bytes 
>   ntdll.dll!_LdrpInitializeProcess@20()  - 0x96d bytes    
    ntdll.dll!__LdrpInitialize@12()  + 0x6269 bytes 
    ntdll.dll!_KiUserApcDispatcher@20()  + 0x7 bytes    

so setting a breakpoint in one of these ntdll routines should really break the process very early.

However, I can’t figure out how to set a breakpoint there prior to starting the process in the debugger. Is it possible in Visual Studio (2005)? How? Can it be done in WinDbg?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T05:05:12+00:00Added an answer on May 23, 2026 at 5:05 am

    I have found out how to do it in Visual Studio.

    The problem here is, that setting a breakpoint in any assembly function will be remembered as a “Data Breakpoint”. These breakpoints are disabled as soon as the process stops, so even if I set one in this function (I can do this because I have the function on the stack if I set a breakpoint in any DllMain function) this breakpoint will be disabled for a new process run.

    However for ntdll.dll (and kernel32.dll) the load addresses are pretty much fixed and won’t change (and least not until reboot).

    So, before starting the process, I just have to re-enable the Data Breakpoint for the address that corresponds to this NtDll function and the debugger will then stop there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I am debugging on my Windows 7 IIS7 machine, I get this error
Is it possible to debug a website running under xsp on windows? I would
We're debugging java webapps, and would like to use the jetty-maven-plugin to launch a
My question is somewhat similar to this How to stop debugging (or detach process)
M 8.0.1, windows 7. A debugging question. Sometimes when I start M and open
We get a seemingly random AppCrash, where windows actually takes over the process and
i try to debug a windows gadget. Just-In-Time debugging fires up and i can
Are there any free Perl IDEs out there for Windows that have debugging capabilities,
I am working on an old .NET 1.1 windows application. In the debugging configuration
how to easily develop print css? with live preview/debugging, i'm on windows xp, use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.