| 153 | |
| 154 | |
| 155 | static void ConditionalJump(Architecture* arch, LowLevelILFunction& il, size_t cond, size_t addrSize, uint64_t t, uint64_t f) |
| 156 | { |
| 157 | BNLowLevelILLabel* trueLabel = il.GetLabelForAddress(arch, t); |
| 158 | BNLowLevelILLabel* falseLabel = il.GetLabelForAddress(arch, f); |
| 159 | |
| 160 | if (trueLabel && falseLabel) |
| 161 | { |
| 162 | il.AddInstruction(il.If(cond, *trueLabel, *falseLabel)); |
| 163 | return; |
| 164 | } |
| 165 | |
| 166 | LowLevelILLabel trueCode, falseCode; |
| 167 | |
| 168 | if (trueLabel) |
| 169 | { |
| 170 | il.AddInstruction(il.If(cond, *trueLabel, falseCode)); |
| 171 | il.MarkLabel(falseCode); |
| 172 | il.AddInstruction(il.Jump(il.ConstPointer(addrSize, f))); |
| 173 | return; |
| 174 | } |
| 175 | |
| 176 | if (falseLabel) |
| 177 | { |
| 178 | il.AddInstruction(il.If(cond, trueCode, *falseLabel)); |
| 179 | il.MarkLabel(trueCode); |
| 180 | il.AddInstruction(il.Jump(il.ConstPointer(addrSize, t))); |
| 181 | return; |
| 182 | } |
| 183 | |
| 184 | il.AddInstruction(il.If(cond, trueCode, falseCode)); |
| 185 | il.MarkLabel(trueCode); |
| 186 | il.AddInstruction(il.Jump(il.ConstPointer(addrSize, t))); |
| 187 | il.MarkLabel(falseCode); |
| 188 | il.AddInstruction(il.Jump(il.ConstPointer(addrSize, f))); |
| 189 | } |
| 190 | |
| 191 | ExprId GetConditionForInstruction(LowLevelILFunction& il, Instruction& instr, size_t registerSize) |
| 192 | { |
no test coverage detected