| 1169 | } |
| 1170 | |
| 1171 | static void ConditionalJump(Architecture* arch, LowLevelILFunction& il, size_t cond, |
| 1172 | size_t addrSize, uint64_t t, uint64_t f) |
| 1173 | { |
| 1174 | BNLowLevelILLabel* trueLabel = il.GetLabelForAddress(arch, t); |
| 1175 | BNLowLevelILLabel* falseLabel = il.GetLabelForAddress(arch, f); |
| 1176 | |
| 1177 | if (trueLabel && falseLabel) |
| 1178 | { |
| 1179 | il.AddInstruction(il.If(cond, *trueLabel, *falseLabel)); |
| 1180 | return; |
| 1181 | } |
| 1182 | |
| 1183 | LowLevelILLabel trueCode, falseCode; |
| 1184 | |
| 1185 | if (trueLabel) |
| 1186 | { |
| 1187 | il.AddInstruction(il.If(cond, *trueLabel, falseCode)); |
| 1188 | il.MarkLabel(falseCode); |
| 1189 | il.AddInstruction(il.Jump(il.ConstPointer(addrSize, f))); |
| 1190 | return; |
| 1191 | } |
| 1192 | |
| 1193 | if (falseLabel) |
| 1194 | { |
| 1195 | il.AddInstruction(il.If(cond, trueCode, *falseLabel)); |
| 1196 | il.MarkLabel(trueCode); |
| 1197 | il.AddInstruction(il.Jump(il.ConstPointer(addrSize, t))); |
| 1198 | return; |
| 1199 | } |
| 1200 | |
| 1201 | il.AddInstruction(il.If(cond, trueCode, falseCode)); |
| 1202 | il.MarkLabel(trueCode); |
| 1203 | il.AddInstruction(il.Jump(il.ConstPointer(addrSize, t))); |
| 1204 | il.MarkLabel(falseCode); |
| 1205 | il.AddInstruction(il.Jump(il.ConstPointer(addrSize, f))); |
| 1206 | } |
| 1207 | |
| 1208 | |
| 1209 | static void ApplyAttributeToLastInstruction(LowLevelILFunction& il, uint32_t attributes) |
no test coverage detected