unsigned __int8 v2; // cf@1
v2 = __CFSHL__(v3, 28);
What does the CFSHL function mean? I can't seem to find any documentation on it.
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 communityThis function usually generate a 'Carry Flag for SHift Left' operators (CFSHL).
__CFSHL__(x, y) // Generate a carry flag for (x<<y)
In fact, when decompiling we, sometimes, loose the origin of the very-low level operations such as manipulation of carry flags. Originally, this operation must have been linked to some arithmetic operation which might have been missed by the decompiler (or optimized out). But, the manipulation of the carry bit on the eflags
is still here, so to keep the semantic equivalence of the decompiled program, Hexrays' decompiler is sometimes forced to use such tricks (which appears to come from outer space even if they probably have a perfectly natural cause).
x
and y
. It simply computes if the carry bit of the %eflags
must be touched if an operation x << y
would have been performed (but without performing it). Sorry, I should have been clearer... I wrote my answer a bit too quickly. Shame on me. :-/