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

Function ConditionalJump

arch/arm64/il.cpp:1171–1206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1169}
1170
1171static 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
1209static void ApplyAttributeToLastInstruction(LowLevelILFunction& il, uint32_t attributes)

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