lifting-bits / remill

Library for lifting machine code to LLVM bitcode
Apache License 2.0
1.26k stars 142 forks source link

Uniform handling of undefined aflags #541

Open lkorenc opened 2 years ago

lkorenc commented 2 years ago

After some instructions, value inside some arithmetic flags may be undefined. X86 semantics currently handle this non-uniformly by either using __remill_undefined_* intrinsics, storing arbitrary values, or ignoring the undefined value altogether.

Ideal solution would be to always use __remill_undefined_* but add an extra argument, that can be used to indicate a preferred value. Unfortunately a list of all affected instructions is rather long. Non-exhaustive list of instructions to check: