I'm trying to reverse engineer a program and i found the following instruction:
test al, al je label
what does these two instruction do ? Can someone explain please ?
Reverse Engineering Stack Exchange is a question and answer site for researchers and developers who explore the principles of a system through analysis of its structure, function, and operation. It only takes a minute to sign up.Sign up to join this community
In x86 assembly,
al is the least significant byte of
eax register, which is typically used to return values from function calls.
test al,al is a bitwise AND operation between
al and itself.
al & al == 0, the zero flag will be set to 1.
jz) instruction will jump to the address of
label, if the zero flag is 1. Otherwise, the
je will do nothing.
In short: If eax == ######00 jump to label.