SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 283 | Next

Shon Harris, Allen Harper, Chris Eagle, and Jonathan Ness

"Gray Hat Hacking, Second Edition"

The sub command is used to subtract the source from the destination and
store the result in the destination.
add ,
sub ,
add eax, 51h
sub eax, 51h
addl $51h, %eax
subl $51h, %eax
push and pop
The push and pop commands are used to push and pop items from the stack.
push
pop
push eax
pop eax
pushl %eax
popl %eax
xor
The xor command is used to conduct a bitwise logical ???exclusive or??? (XOR) function??”
for example, 11111111 XOR 11111111 = 00000000. Therefore, XOR value, value can be
used to zero out or clear a register or memory location.
xor , xor eax, eax xor %eax, %eax
jne, je, jz, jnz, and jmp
The jne, je, jz, jnz, and jmp commands are used to branch the flow of the program to
another location based on the value of the eflag ???zero flag.??? jne/jnz will jump if the
???zero flag??? = 0; je/jz will jump if the ???zero flag??? = 1; and jmp will always jump.
Chapter 6: Programming Survival Skills
135
PART III
jnz / jne
jz /je
jmp
jne start
jz loop
jmp end
jne start
jz loop
jmp end
call and ret
The call command is used to call a procedure (not jump to a label). The ret command is
used at the end of a procedure to return the flow to the command after the call.


Pages:
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295