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 7985889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:41:16+00:00 2026-06-04T11:41:16+00:00

I am trying to examine the assembly for an executable using WinDBG, but I

  • 0

I am trying to examine the assembly for an executable using WinDBG, but I am having a hard time getting to it. I want to set a breakpoint at the first instruction in my program, but when I try to do that manually (using the address of the module), WinDBG tells me that it is “unable to insert breakpoint” at that location due to an “Invalid access to memory location.”

I notice that when I create a breakpoint through the source code GUI, the address is not the same as the first part of my module (In my example: “Win32FileOpen”, a simple program I wrote.) Is there a header of some sort that requires adding an offset to the address of my module?

In another question, I saw the suggestion: “I would attempt to calculate the breakpoint address as: Module start + code start + code offset” but was unsure where to obtain those values. Can somebody please elaborate on this?

The reason I don’t just use the source GUI is that I want to be able to do this with a program that I may not have the source/symbols for.

If there is an easier way to immediately start working with the executable I open, please let me know. (e.g. Opening an .exe Olly immediately shows me the assembly for that .exe, searching for referenced strings gives me results from that module, etc. WinDBG seems to start me off in ntdll.dll, which is not usually useful for me.)

0:000> lm
start             end                 module name
00000000`00130000 00000000`0014b000   Win32FileOpen C (private pdb symbols)  C:\cfinley\code\Win32FileOpen\Debug\Win32FileOpen.pdb
00000000`73bd0000 00000000`73c2c000   wow64win   (deferred)            
00000000`73c30000 00000000`73c6f000   wow64      (deferred)            
00000000`74fe0000 00000000`74fe8000   wow64cpu   (deferred)            
00000000`77750000 00000000`778f9000   ntdll      (pdb symbols)          c:\symbols\mssymbols\ntdll.pdb\15EB43E23B12409C84E3CC7635BAF5A32\ntdll.pdb
00000000`77930000 00000000`77ab0000   ntdll32    (deferred)            
0:000> bu 00000000`00130000
0:000> bl
 0 e x86 00000000`001413a0     0001 (0001)  0:**** Win32FileOpen!main              <-- One that is generated via GUI
 1 e x86 00000000`00130000     0001 (0001)  0:**** Win32FileOpen!__ImageBase       <-- One I tried to set manually
0:000> g
Unable to insert breakpoint 1 at 00000000`00130000, Win32 error 0n998
    "Invalid access to memory location."
bp1 at 00000000`00130000 failed
WaitForEvent failed
ntdll!LdrpDoDebuggerBreak+0x31:
00000000`777fcb61 eb00            jmp     ntdll!LdrpDoDebuggerBreak+0x33 (00000000`777fcb63)
  • 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-06-04T11:41:18+00:00Added an answer on June 4, 2026 at 11:41 am

    You should be able to list all the entry points for your dll using the following:

    x myDLL!*
    

    but be warned this will list everything,

    if you wanted just Win32FileOpen:

    x myDLL!*Win32FileOpen*
    

    will list all that match, this will list the correct addresses that you can set the breakpoint on.

    Your other question about offsets, you can set a breakpoint on a method name or address and add an offset:

    bp myDLL!Win32FileOpen+0xa
    

    If you open the exectuable it will debugbreak immediately and probably not start loading your dlls, if this is an issue then you can set unresolved breakpoints:

    bu myDLL!Win32FileOpen
    

    or just attach when the app starts, list the strings and then set the breakpoints.

    You may also consider setting breakpoints on source line:

    bp `myDLL!mySourceFile.cpp:XXX` 
    

    where XXX is the line number, note you must use grave accents to demark the source line, hope this helps.

    Edit

    Just found this link which may be of interest for you: http://mattoh.wordpress.com/2010/08/06/setting-breakpoint-on-entry-poin-with-windbg/

    also one of the commentators pointed to one of the pseudo registers which allows you to set the bp on the entry point for your exe:

    bp $exentry
    

    or

    bu @$exentry
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to examine the contents of an assembly and find all classes
Thanks for taking the time to examine my issue. I'm trying to figure out
I am trying to examine the content of a NSDataDictionary using the following code:
Trying to get parameters from a PUT request using HttpServlet#doPut: public void doPut(HttpServletRequest request,
I am building a COM object in x86 assembly using NASM. I understand COM
I am trying to manipulate an image using a chain of CIFilters, and then
I have a variable that I am trying to examine its content that is
I am trying to solve Peg Solitaire with a depth-first search algorithm – it
we are trying to make an api server for our project. we are using
I am trying to debug my program using NSZombie. The debugger did return me

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.