ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Windbg命令系列---.printf

2022-02-08 09:01:57  阅读:222  来源: 互联网

标签:Windbg level printf space virtual window ---. command address


.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

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有