Skip to content

Custom Flag Conditions #1575

Answered by rssor
ehntoo asked this question in Architectures
Apr 17, 2020 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

So there are basically 3 different ways flags can be used in lifters. In this case, you don't want flag conditions (LLFC_*) or semantic flags (LLIL_FLAG_GROUP), you're going to have to use custom flag write types with SpecialFlagRole on the flags we don't have existing roles for.

When you emit an expression to read the value of one of those flags with il.Flag, getFlagWriteLowLevelIL in the custom architecture will be invoked with information from the instruction that set that flag, giving you the constant/registers used as arguments, which you then use to build up an LLIL expression reprenting the boolean value of that flag expressed in terms of inputs to the instruction that set the flag…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@plafosse
Comment options

@ehntoo
Comment options

Answer selected by ehntoo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants