| 341 | |
| 342 | |
| 343 | static void ConditionalJump(Architecture* arch, LowLevelILFunction& il, size_t cond, size_t addrSize, uint64_t t, uint64_t f) |
| 344 | { |
| 345 | BNLowLevelILLabel* trueLabel = il.GetLabelForAddress(arch, t); |
| 346 | BNLowLevelILLabel* falseLabel = il.GetLabelForAddress(arch, f); |
| 347 | |
| 348 | if (trueLabel && falseLabel) |
| 349 | { |
| 350 | il.AddInstruction(il.If(cond, *trueLabel, *falseLabel)); |
| 351 | return; |
| 352 | } |
| 353 | |
| 354 | LowLevelILLabel trueCode, falseCode; |
| 355 | |
| 356 | if (trueLabel) |
| 357 | { |
| 358 | il.AddInstruction(il.If(cond, *trueLabel, falseCode)); |
| 359 | il.MarkLabel(falseCode); |
| 360 | il.AddInstruction(il.Jump(il.ConstPointer(addrSize, f))); |
| 361 | return; |
| 362 | } |
| 363 | |
| 364 | if (falseLabel) |
| 365 | { |
| 366 | il.AddInstruction(il.If(cond, trueCode, *falseLabel)); |
| 367 | il.MarkLabel(trueCode); |
| 368 | il.AddInstruction(il.Jump(il.ConstPointer(addrSize, t))); |
| 369 | return; |
| 370 | } |
| 371 | |
| 372 | il.AddInstruction(il.If(cond, trueCode, falseCode)); |
| 373 | il.MarkLabel(trueCode); |
| 374 | il.AddInstruction(il.Jump(il.ConstPointer(addrSize, t))); |
| 375 | il.MarkLabel(falseCode); |
| 376 | il.AddInstruction(il.Jump(il.ConstPointer(addrSize, f))); |
| 377 | } |
| 378 | |
| 379 | |
| 380 | static void DirFlagIf(LowLevelILFunction& il, |
no test coverage detected