MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / ConditionalJump

Function ConditionalJump

arch/armv7/thumb2_disasm/il_thumb2.cpp:409–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407
408
409static void ConditionalJump(Architecture* arch, LowLevelILFunction& il, uint32_t cond, uint32_t t, uint32_t f)
410{
411 BNLowLevelILLabel* trueLabel = il.GetLabelForAddress(arch, t);
412 BNLowLevelILLabel* falseLabel = il.GetLabelForAddress(arch, f);
413
414 if (trueLabel && falseLabel)
415 {
416 il.AddInstruction(il.If(GetCondition(il, cond), *trueLabel, *falseLabel));
417 return;
418 }
419
420 LowLevelILLabel trueCode, falseCode;
421
422 if (trueLabel)
423 {
424 il.AddInstruction(il.If(GetCondition(il, cond), *trueLabel, falseCode));
425 il.MarkLabel(falseCode);
426 il.AddInstruction(il.Jump(il.ConstPointer(4, f)));
427 return;
428 }
429
430 if (falseLabel)
431 {
432 il.AddInstruction(il.If(GetCondition(il, cond), trueCode, *falseLabel));
433 il.MarkLabel(trueCode);
434 il.AddInstruction(il.Jump(il.ConstPointer(4, t)));
435 return;
436 }
437
438 il.AddInstruction(il.If(GetCondition(il, cond), trueCode, falseCode));
439 il.MarkLabel(trueCode);
440 il.AddInstruction(il.Jump(il.ConstPointer(4, t)));
441 il.MarkLabel(falseCode);
442 il.AddInstruction(il.Jump(il.ConstPointer(4, f)));
443}
444
445
446static void CompareWithZeroAndConditionalJump(Architecture* arch, LowLevelILFunction& il, uint32_t reg,

Callers 1

Calls 7

GetLabelForAddressMethod · 0.80
GetConditionFunction · 0.70
AddInstructionMethod · 0.45
IfMethod · 0.45
MarkLabelMethod · 0.45
JumpMethod · 0.45
ConstPointerMethod · 0.45

Tested by

no test coverage detected