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

Function ConditionalJump

arch/x86/il.cpp:343–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341
342
343static 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
380static void DirFlagIf(LowLevelILFunction& il,

Callers 1

Calls 6

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

Tested by

no test coverage detected