x64dbg 条件断点相关文档
Input
When using x64dbg you can often use various things as input.
Commands
Commands have the following format:
command arg1, arg2, argN
Variables
Variables optionally start with a $
and can only store one DWORD (QWORD on x64).
Registers
All registers (of all sizes) can be used as variables.
Remarks
- The variable names for most registers are the same as the names for them, except for the following registers:
- x87 Control Word Flag: The flags for this register is named like this:
_x87CW_UM
- In addition to the registers in the architecture, x64dbg provides the following registers:
CAX
,CBX
,CCX
,CDX
,CSP
,CBP
,CSI
,CDI
,CIP
. These registers are mapped to 32-bit registers on 32-bit platform, and to 64-bit registers on 64-bit platform. For example,CIP
isEIP
on 32-bit platform, and isRIP
on 64-bit platform. This feature is intended to support architecture-independent code.
Memory locations
You can read/write from/to a memory location by using one of the following expressions:
[addr]
read a DWORD/QWORD fromaddr
.n:[addr]
read n bytes fromaddr
.seg:[addr]
read a DWORD/QWORD from a segment ataddr
.byte:[addr]
read a BYTE fromaddr
.word:[addr]
read a WORD fromaddr
.dword:[addr]
read a DWORD fromaddr
.qword:[addr]
read a QWORD fromaddr
(x64 only).
Remarks
n
is the amount of bytes to read, this can be anything smaller than 4 on x32 and smaller than 8 on x64 when specified, otherwise there will be an error.seg
can begs
,es
,cs
,fs
,ds
,ss
. Onlyfs
andgs
have an effect.
Flags
Debug flags (interpreted as integer) can be used as input. Flags are prefixed with an _
followed by the flag name. Valid flags are: _cf
, _pf
, _af
, _zf
, _sf
, _tf
, _if
, _df
, _of
, _rf
, _vm
, _ac
, _vif
, _vip
and _id
.
Numbers
All numbers are interpreted as hex by default! If you want to be sure, you can x
or 0x
as a prefix. Decimal numbers can be used by prefixing the number with a dot: .123=7B
.
Expressions
See the expressions section for more information.
Labels/Symbols
User-defined labels and symbols are a valid expressions (they resolve to the address of said label/symbol).
Module Data
DLL exports
Type GetProcAddress
and it will automatically be resolved to the actual address of the function. To explicitly define from which module to load the API, use: [module].dll:[api]
or [module]:[api]
. In a similar way you can resolve ordinals, try [module]:[ordinal]
. Another macro allows you to get the loaded base of a module. When [module]
is an empty string :GetProcAddress
for example, the module that is currently selected in the CPU will be used.
Loaded module bases
If you want to access the loaded module base, you can write: [module]:0
, [module]:base
, [module]:imagebase
or [module]:header
.
RVA/File offset
If you want to access a module RVA you can either write [module]:0+[rva]
or you can write [module]:$[rva]
. If you want to convert a file offset to a VA you can use [module]:#[offset]
. When [module]
is an empty string :0
for example, the module that is currently selected in the CPU will be used.
Module entry points
To access a module entry point you can write [module]:entry
, [module]:oep
or [module]:ep
. Notice that when there are exports with the names entry
, oep
or ep
the address of these will be returned instead.
Remarks
Instead of the :
delimiter you can also use a .
If you need to query module information such as [module]:imagebase
or [module]:entry
you are advised to use a ?
as delimiter instead: [module]?entry
. The ?
delimiter does checking for named exports later, so it will still work when there is an export called entry
in the module.
Last words
Input for arguments can always be done in any of the above forms, except if stated otherwise.
字符格式
String Formatting
This section explains the simple string formatter built into x64dbg.
The basic syntax is {?:expression}
where ?
is the optional type of the expression. The default type is x
. To output {
or }
in the result, escape them as {{
or }}
.
Types
d
signed decimal:-3
u
unsigned decimal:57329171
p
zero prefixed pointer:0000000410007683
s
string pointer:this is a string
x
hex:3C28A
a
address info:00401010 <module.EntryPoint>
i
instruction text:jmp 0x77ac3c87
Complex Type
// "[]" 中括号表示可选的意思
{mem;size@address}
will print the size
bytes starting at address
in hex.
{winerror@code}
will print the name of windows error code(returned with GetLastError()
) and the description of it(with FormatMessage
). It is similar to ErrLookup utility.
{ntstatus@code}
will print the name of NTSTATUS error code and the description of it(with FormatMessage
).
{ascii[;length]@address}
will print the ASCII string at address
with an optional length
(in bytes).
{ansi[;length]@address}
will print the ANSI string at address
with an optional length
(in bytes).
{utf8[;length]@address}
will print the UTF-8 string at address
with an optional length
(in bytes).
{utf16[;length]@address}
will print the UTF-16 string at address
with an optional length
(in words).
{disasm@address}
will print the disassembly at address
(equivalent to {i:address}
).
{modname@address}
will print the name of the module at address
.
{bswap[;size]@value}
will byte-swap value
for a specified size
(size of pointer per default).
Examples
rax: {rax}
formats torax: 4C76
password: {s:4*ecx+0x402000}
formats topassword: L"s3cret"
{x:bswap(rax)}
whererax=0000000078D333E0
formats toE033D37800000000
because of bswap fun which reverse the hex value{bswap;4@rax}
whererax=1122334455667788
formats to88776655
Logging
When using the log
command you should put quotes around the format string (log "{mem;8@rax}"
) to avoid ambiguity with the ;
(which separates two commands). See https://github.com/x64dbg/x64dbg/issues/1931 for more details.
Plugins
Plugins can use _plugin_registerformatfunction
to register custom string formatting functions. The syntax is {type;arg1;arg2;argN@expression}
where type
is the name of the registered function, argN
is any string (these are passed to the formatting function as arguments) and expression
is any valid expression.
条件断点
Conditional Breakpoints
This section describes the conditional breakpoint capability in x64dbg.
Operations overview
When a breakpoint is hit, x64dbg will do the following things:
- If the breakpoint is an exception breakpoint, set the system variable
$breakpointexceptionaddress
to the exception address; - Increment the hit counter;
- Set the system variable
$breakpointcounter
to the value of hit counter; - If break condition is set, evaluate the expression (defaults to
1
); - If fast resume is set and break condition evaluated to
0
:- Resume execution of the debuggee (skip the next steps). This will also skip executing plugin callbacks and GUI updates.
- If log condition is set, evaluate the expression (defaults to
1
); - If command condition is set, evaluate the expression (defaults to break condition);
- If break condition evaluated to
1
(or any value other than ‘0’):- Print the standard log message; (if the breakpoint is set to be silent, standard log message is supressed.)
- Execute plugin callbacks.
- If log text is set and log condition evaluated to
1
(or any value other than ‘0’):- Format and print the log text (see String Formatting).
- If command text is set and command condition evaluated to
1
:- Set the system variable
$breakpointcondition
to the break condition; - Set the system variable
$breakpointlogcondition
to the log condition; - Execute the command in command text;
- The break condition will be set to the value of
$breakpointcondition
. So if you modify this system variable in the script, you will be able to control whether the debuggee would break.
- Set the system variable
- If break condition evaluated to
1
(or any value other than ‘0’):- Break the debuggee and wait for the user to resume.
If any expression is invalid, the condition will be triggered (That is, an invalid expression as condition will cause the breakpoint to always break, log and execute command).
Hit counter
A hit counter records how many times a breakpoint has been reached. It will be incremented unconditionally, even if fast resume is enabled on this breakpoint. It may be viewed at breakpoint view and reset with ResetBreakpointHitCount.
Logging
The log can be formatted by x64dbg to log the current state of the program. See formatting on how to format the log string.
Notes
You can set a conditional breakpoint with GUI by setting a software breakpoint(key F2) first, then right-click on the instruction and select “Edit breakpoint” command from the context menu. Fill in the conditional expression and/or other information as necessary, then confirm and close the dialog.
You should not use commands that can change the running state of the debuggee (such as run
) inside the breakpoint command, because these commands are unstable when used here. You can use break condition, command condition or $breakpointcondition
instead.
If you don’t know where the condition will become true, try conditional tracing instead!
Examples
A conditional breakpoint which never breaks
break condition: 0
A conditional breakpoint which breaks only if EAX and ECX both equal to 1
break condition: EAX==1 && ECX==1
A conditional breakpoint which breaks only if EAX is a valid address
break condition: mem.valid(EAX)
A conditional breakpoint which breaks on the third hit
break condition: $breakpointcounter==3
or ($breakpointcounter%3)==0
A conditional breakpoint which breaks only if executed by the thread 1C0
break condition: tid()==1C0
x64dbg 条件断点相关文档的更多相关文章
- dotNET跨平台相关文档整理
一直在从事C#开发的相关技术工作,从C# 1.0一路用到现在的C# 6.0, 通常情况下被局限于Windows平台,Mono项目把我们C#程序带到了Windows之外的平台,在工作之余花了很多时间在M ...
- Mybatis-Generator 自动生成Dao、Model、Mapping相关文档
最近在学习mybatis,结果在写Mapping的映射文件时insert语句一直报错,于是想看看标准的映射文件是什么样.百度到Mybatis-Generator 自动生成Dao.Model.Mappi ...
- VLC的相关文档以及javascript接口
参看下面链接:VLC相关文档
- dotNET跨平台相关文档
dotNET跨平台相关文档整理 一直在从事C#开发的相关技术工作,从C# 1.0一路用到现在的C# 6.0, 通常情况下被局限于Windows平台,Mono项目把我们C#程序带到了Windows之外的 ...
- 大数据相关文档&Api下载
IT相关文档&Api下载(不断更新中) 下载地址:https://download.csdn.net/user/qq_42797237/uploads 如有没有你需要的API,可和我留言,留下 ...
- rn相关文档
RN相关文档: rn文档:https://reactnative.cn/ mbox文档:https://cn.mobx.js.org/ es6文档:http://es6.ruanyifeng.com/ ...
- OSS阿里云相关文档
OSS阿里云相关文档 oss文档链接
- hugo官方相关文档地址
+++ date="2020-10-17" title="hugo官方相关文档地址" tags=["hugo"] categories=[& ...
- iOS开发-相关文档
关于调试,查看Xcode Overview文档相关部分:http://developer.apple.com/library/ios/documentation/ToolsLanguages/Conc ...
随机推荐
- Apple 产品反人类的设计 All In One
Apple 产品反人类的设计 All In One 用户体验 shit rank WTF rank iPhone 更换铃声 WTF, 这么简单的一个功能搞得太复杂了 使用要下载 1.6 G的库乐队 A ...
- TypeScript 4.0 New Features
TypeScript 4.0 New Features $ npm install typescript@beta https://devblogs.microsoft.com/typescript/ ...
- components & slot
components & slot vue https://github.com/vuejs/rfcs/blob/master/active-rfcs/0001-new-slot-syntax ...
- OAuth:每次授权暗中保护你的那个“MAN”
摘要:OAuth是一种授权协议,允许用户在不将账号口令泄露给第三方应用的前提下,使第三方应用可以获得用户在某个web服务上存放资源的访问权限. 背景 在传统模式下,用户的客户端在访问某个web服务提供 ...
- 教你玩转CSS 伪元素
一.CSS 伪元素 CSS伪元素是用来添加一些选择器的特殊效果. 语法 伪元素的语法: selector:pseudo-element {property:value;} CSS类也可以使用伪元素: ...
- 数据序列化工具——flatbuffer
flatbuffer是一款类似于protobuf的数据序列化工具.所有数据序列化,简单来说,就是将某程数据结构按照一定的格式进行编码与解码,以方便在不同的进程间传递后,能够正确的还原成之前的数据结构. ...
- WPF 关于ComboBox在前台绑定XML数据的一些方法,使用XML数据提供器 XmlDataProvider
关于使用 数据提供器:XmlDataProvider 的一些问题,以及在WPF中是如何使用的一些介绍,还有踩到的一些坑,希望其他和我碰到一样问题的,可以更快的解决. 首先,要求是 在WPF 的前台代码 ...
- apiAutoTest:支持自定义函数,用例中可调用
0. 前言 apiAutoTest从去年8月以来开源至今,也更新了不少内容,一起来看看吧 第一个版本 - 2020/08/08 增加实际响应存储数据的方法,并在字典可以处理依赖见tools/svae_ ...
- 阻塞队列——四组API
方式 抛出异常 有返回值,不抛出异常 阻塞等待 超时等待 添加 add() offer() put() offer(...) 移除 remove() poll() take() poll(...) 检 ...
- linux 几种传输文件的方式
SimpleHTTPServer + wget 如果线上可以直连线下的话,在线上使用wget访问线下的文件服务器: web的方法,比较灵活,使用完要尽快关闭这个服务: cd temp temp$ py ...