Linux

Steinar H. Gunderson: Decompilation patterns, part 7: if to condition

A variation of the pattern from yesterday; say you have: if (x == 3) { y = 0; } else { y = 1; } When these are zero and one, sometimes this will give a better match, since booleans are evaluated as such: y = (x != 3); It's rare to have something else than zero or one work for this pattern (e.g. you would rarely write y = (x != 3) * 2 + 1).

Quelle: Originalartikel öffnen

AI Assistant
Context loaded: Steinar H. Gunderson: Decompilation patterns, part 7: if to