How to get the debuggee's command line in WinDbg?
Asked Answered
N

2

10

Is there any extension command could to do so? I just want to the the whole command line including all parameters.

Nest answered 3/6, 2011 at 8:40 Comment(0)
S
19

Information like the command line args are stored in the PEB (Process Environment Block).

You can find a list of common commands here.

!peb will display the PEB.

Sybil answered 3/6, 2011 at 10:36 Comment(5)
Yes, this works well, even if there are many unrelated information in the output. I just found another command version which could list the command line as well.Nest
So many WinDbg commands available, and what they can display is encyclopaedic! Here's a good reference: windbg.info/doc/1-common-cmds.htmlSybil
The "version" command lists the command-line of the windbg process, not the command-line of the process you're debugging.Pyroxylin
@alfa, you are right, in the case the debugge is launched by windbg, the command line for windbg hints the command line of the debuggee.Nest
You may use the following command not to parse the whole output of "!peb": .shell -ci "!peb" findstr "CommandLine".Dulin
S
-1

try vercommand it's a lot simpler than !peb this is a good place to get you started: http://windbg.info/doc/1-common-cmds.html#2_general_cmds

Sturgis answered 22/5, 2015 at 9:10 Comment(1)
This doesn't work since it reports command line of WinDbg, not the debuggee if it is attached at runtime.Nest

© 2022 - 2024 — McMap. All rights reserved.