1
0
Fork 0
x64dbg/help/Calculations.htm

70 lines
2.7 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Calculations</title>
<meta name="GENERATOR" content="WinCHM">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
html,body {
/* Default Font */
font-family: Courier New;
font-size: 11pt;
}
</style>
</head>
<body>
<P><STRONG>Calculations<BR></STRONG>The debugger allows usage of basic math
operations, just type an expression in the
command window and the result will be displayed in the console. Apart from
calculations, it allows quick&nbsp;variable changes using a C-like syntax.</P>
<P><STRONG>Operators</STRONG><BR> You can use the following operators in your expression.
They are processed in the following order (<A
href="http://en.cppreference.com/w/c/language/operator_precedence"
target=_blank>source</A>):</P>
<P><U>1:parentheses/brackets</U>: <EM>(1+2)</EM>, [1+6] have
priority over other operations.</P>
<P><U>2:unary minus/binary not/logical not</U>: <EM>-1</EM> (negative 1), <EM>~1</EM> (binary not of 1), <EM>!0</EM>
(logical not of 0).</P>
<P><U>
3:multiplication/division</U>:
<EM>2*3</EM> (regular multiplication), <EM>2`3</EM> (gets high part of the
multiplication),&nbsp;6/3 (regular division), <EM>5%3</EM> (modulo/remainder of
the division).</P>
<P><U>4:addition/subtraction</U>:
<EM>1+3</EM> (addition), <EM>5-2</EM>
(subtraction).</P>
<P><U>5:left/right
shift</U>:&nbsp;<EM>1&lt;&lt;2</EM> (shift left, shl for unsigned, sal for
signed), <EM>10&gt;&gt;1</EM> (shift right, shl
for&nbsp;unsigned, sal for signed). </P>
<P><U>6:smaller (equal)/bigger (equal)</U>: 4&lt;10, 3&gt;6,
<EM>1&lt;=2</EM>, <EM>6&gt;=7</EM> (resolves to 1 if true,
0 if false).</P>
<P><U>7:equal/not equal</U>: <EM>1==1</EM>, <EM>2!=6</EM>
(resolves to 1 if true, 0 if
false).</P>
<P><U>8:binary and</U>: <EM>12&amp;2</EM>
(regular binary
and).</P>
<P><U>9:binary xor</U>: <EM>2^1</EM>
(regular binary
xor).</P>
<P><U>10:binary or</U>: <EM>2|8</EM>
(regular binary
or).</P>
<P><U>11:logical and</U>: <EM>0&amp;&amp;3</EM>
(resolves to 1 if true, 0 if
false).</P>
<P><U>12:logical or</U>: <EM>0||3</EM>
(resolves to 1 if true, 0 if
false).</P>
<P><STRONG><U>Quick-Assigning<BR></U></STRONG>Changing memory, a
variable, register or&nbsp;flag can be easily done using a C-like
syntax:</P>
<P>a?= b: '?' can be any non-logical operator.
'a' can be any register, flag, variable or memory location. 'b' can be anything that is recognized as an
expression.</P>
<P>a++/a--: 'a' can be any register, flag, variable or memory
location.</P></body>