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

Method cond_branch

python/examples/nes.py:402–418  ·  view source on GitHub ↗
(il:LowLevelILFunction, cond:ExpressionIndex, dest:ExpressionIndex)

Source from the content-addressed store, hash-verified

400
401 @staticmethod
402 def cond_branch(il:LowLevelILFunction, cond:ExpressionIndex, dest:ExpressionIndex) -> None:
403 t = None
404 instr = LowLevelILInstruction.create(il, dest)
405 if isinstance(instr, LowLevelILConst):
406 t = il.get_label_for_address(Architecture['6502'], instr.constant) # type: ignore
407 if t is None:
408 t = LowLevelILLabel()
409 indirect = True
410 else:
411 indirect = False
412 f = LowLevelILLabel()
413 il.append(il.if_expr(cond, t, f))
414 if indirect:
415 il.mark_label(t)
416 il.append(il.jump(dest))
417 il.mark_label(f)
418 return None
419
420 @staticmethod
421 def jump(il:LowLevelILFunction, dest:ExpressionIndex) -> None:

Callers 1

M6502Class · 0.80

Calls 7

LowLevelILLabelClass · 0.90
get_label_for_addressMethod · 0.80
createMethod · 0.45
appendMethod · 0.45
if_exprMethod · 0.45
mark_labelMethod · 0.45
jumpMethod · 0.45

Tested by

no test coverage detected