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

Method GetExprForRegisterOrConstantOperation

lowlevelil.cpp:510–539  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

508
509
510ExprId LowLevelILFunction::GetExprForRegisterOrConstantOperation(
511 BNLowLevelILOperation op, size_t size, BNRegisterOrConstant* operands, size_t operandCount)
512{
513 if (operandCount == 0)
514 return AddExpr(op, size, 0);
515 if (operandCount == 1)
516 {
517 if (op == LLIL_SET_REG)
518 return GetExprForRegisterOrConstant(operands[0], size);
519 return AddExpr(op, size, 0, GetExprForRegisterOrConstant(operands[0], size));
520 }
521 if (operandCount == 2)
522 {
523 return AddExpr(op, size, 0, GetExprForRegisterOrConstant(operands[0], size),
524 GetExprForRegisterOrConstant(operands[1], size));
525 }
526 if (operandCount == 3)
527 {
528 if ((op == LLIL_ADC) || (op == LLIL_SBB) || (op == LLIL_RLC) || (op == LLIL_RRC))
529 {
530 return AddExpr(op, size, 0, GetExprForRegisterOrConstant(operands[0], size),
531 GetExprForRegisterOrConstant(operands[1], size), GetExprForFlagOrConstant(operands[2]));
532 }
533 return AddExpr(op, size, 0, GetExprForRegisterOrConstant(operands[0], size),
534 GetExprForRegisterOrConstant(operands[1], size), GetExprForRegisterOrConstant(operands[2], size));
535 }
536 return AddExpr(op, size, 0, GetExprForRegisterOrConstant(operands[0], size),
537 GetExprForRegisterOrConstant(operands[1], size), GetExprForRegisterOrConstant(operands[2], size),
538 GetExprForRegisterOrConstant(operands[3], size));
539}
540
541
542ExprId LowLevelILFunction::Operand(size_t n, ExprId expr)

Callers 4

Calls

no outgoing calls

Tested by

no test coverage detected