其他分享
首页 > 其他分享> > Windbg命令系列---.printf

Windbg命令系列---.printf

作者:互联网

.printf的行为跟C语言的printf函数类似。

语法

.printf [/D] [Option] "FormatString" [, Argument , ...] 

参数

/D

  指定格式字符串包含调试器标记语言(DML)。

Option

  指定WinDbg应将FormatString解释为的文本消息类型。WinDbg为每种类型的调试器命令窗口消息分配背景和文本颜色;选择其中一个选项会使消息以适当的颜色显示。默认情况下,文本显示为正常级别的         消息。以下选项可用:
  

OptionType of messageTitle of colors in Options dialog box

/od

debuggee

Debuggee level command window

/oD

debuggee prompt

Debuggee prompt level command window

/oe

error

Error level command window

/on

normal

Normal level command window

/op

prompt

Prompt level command window

/oP

prompt registers

Prompt registers level command window

/os

symbols

Symbol message level command window

/ov

verbose

Verbose level command window

/ow

warning

Warning level command window

FormatString   指定格式字符串,如printf中所示。通常,转换字符的工作方式与C完全相同。对于浮点转换字符,除非使用l修饰符,否则64位参数将被解释为32位浮点数。支持%p转换字符,但它表示目标虚拟地址空间中的指针。它不能有任何修饰符,并且使用调试器的内部地址格式。支持以下附加转换字符:
  
CharacterArgument typeArgumentText printed

%p

ULONG64

A pointer in the target's virtual address space.

The value of the pointer.

%N

DWORD_PTR (32 or 64 bits, depending on the host's architecture)

A pointer in the host's virtual address space.

The value of the pointer. (This is equivalent to the standard C %p character.)

%I

ULONG64

Any 64-bit value.

The specified value. If this is greater than 0xFFFFFFFF, it is printed as a 64-bit address; otherwise it is printed as a 32-bit address.

%ma

ULONG64

The address of a NULL-terminated ASCII string in the target's virtual address space.

The specified string.

%mu

ULONG64

The address of a NULL-terminated Unicode string in the target's virtual address space.

The specified string.

%msa

ULONG64

The address of an ANSI_STRING structure in the target's virtual address space.

The specified string.

%msu

ULONG64

The address of a UNICODE_STRING structure in the target's virtual address space.

The specified string.

%y

ULONG64

The address of a debugger symbol in the target's virtual address space.

A string containing the name of the specified symbol (and displacement, if any).

%ly

ULONG64

The address of a debugger symbol in the target's virtual address space.

A string containing the name of the specified symbol (and displacement, if any), as well as any available source line information.

  Arguments    指定格式字符串的参数,如printf中的参数。指定的参数数应与FormatString中的转换字符数匹配。每个参数都是一个将由默认表达式计算器(MASM或C++)计算的表达式。

说明

默认情况下,可以使用Options参数选择的颜色设置。要充分利用这些选项,必须首先使用“查看|选项”打开“选项”对话框,并更改调试器命令窗口消息的颜色设置。

下面的示例演示如何在格式字符串中包含DML标记:

.printf /D "Click <link cmd=\".chain /D\">here</link> to see extensions DLLs."

上图中显示的输出有一个链接,您可以单击该链接执行<link>标记中指定的命令。下图显示了单击链接的结果。

 

 

标签:Windbg,level,printf,space,virtual,window,---.,command,address
来源: https://www.cnblogs.com/yilang/p/15632557.html