When using x64dbg you can often use various things as input.
Commands have the following format:
command arg1, arg2, argN
Variables optionally start with a
$ and can only store one DWORD (QWORD on x64).
All registers (of all sizes) can be used as variables.
- 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:
- In addition to the registers in the architecture, x64dbg provides the following registers:
CIP. These registers are mapped to 32-bit registers on 32-bit platform, and to 64-bit registers on 64-bit platform. For example,
EIPon 32-bit platform, and is
RIPon 64-bit platform. This feature is intended to support architecture-independent code.
You can read/write from/to a memory location by using one of the following expressions:
[addr]read a DWORD/QWORD from
n:[addr]read n bytes from
seg:[addr]read a DWORD/QWORD from a segment at
byte:[addr]read a BYTE from
word:[addr]read a WORD from
dword:[addr]read a DWORD from
qword:[addr]read a QWORD from
nis 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.
gshave an effect.
Debug flags (interpreted as integer) can be used as input. Flags are prefixed with an
_ followed by the flag name. Valid flags are:
All numbers are interpreted as hex by default! If you want to be sure, you can
0x as a prefix. Decimal numbers can be used by prefixing the number with a dot:
See the expressions section for more information.
User-defined labels and symbols are a valid expressions (they resolve to the address of said label/symbol).
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]:[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:
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] 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]:ep. Notice that when there are exports with the names
ep the address of these will be returned instead.
Instead of the
: delimiter you can also use a
. If you need to query module information such as
[module]:entry you are advised to use a
? as delimiter instead:
? delimiter does checking for named exports later, so it will still work when there is an export called
entry in the module.
Input for arguments can always be done in any of the above forms, except if stated otherwise.