diff options
| author | Rusty Wagner <rusty@vector35.com> | 2018-01-31 21:08:05 -0500 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2018-03-23 17:10:06 -0400 |
| commit | 736bd9358ec8c1cdd1c77025b10e576983c4001c (patch) | |
| tree | 9c861eeabf5267bd0ef748bc0a259dbfe183685b | |
| parent | 55e92538f37be39d915fa395287ff67a4c7dfdfb (diff) | |
Allow intrinsics to write flags
| -rw-r--r-- | binaryninjaapi.h | 3 | ||||
| -rw-r--r-- | lowlevelilinstruction.cpp | 6 | ||||
| -rw-r--r-- | python/lowlevelil.py | 4 |
3 files changed, 7 insertions, 6 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 9bdb0058..66c4b861 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -2678,7 +2678,8 @@ namespace BinaryNinja ExprId BoolToInt(size_t size, ExprId a, const ILSourceLocation& loc = ILSourceLocation()); ExprId SystemCall(const ILSourceLocation& loc = ILSourceLocation()); ExprId Intrinsic(const std::vector<RegisterOrFlag>& outputs, uint32_t intrinsic, - const std::vector<ExprId>& params, const ILSourceLocation& loc = ILSourceLocation()); + const std::vector<ExprId>& params, uint32_t flags = 0, + const ILSourceLocation& loc = ILSourceLocation()); ExprId IntrinsicSSA(const std::vector<SSARegisterOrFlag>& outputs, uint32_t intrinsic, const std::vector<ExprId>& params, const ILSourceLocation& loc = ILSourceLocation()); ExprId Breakpoint(const ILSourceLocation& loc = ILSourceLocation()); diff --git a/lowlevelilinstruction.cpp b/lowlevelilinstruction.cpp index 61eef39b..e0602a13 100644 --- a/lowlevelilinstruction.cpp +++ b/lowlevelilinstruction.cpp @@ -2140,7 +2140,7 @@ ExprId LowLevelILInstruction::CopyTo(LowLevelILFunction* dest, for (auto& i : GetParameterExprs<LLIL_INTRINSIC>()) params.push_back(subExprHandler(i)); return dest->Intrinsic(GetOutputRegisterOrFlagList<LLIL_INTRINSIC>(), GetIntrinsic<LLIL_INTRINSIC>(), - params, *this); + params, flags, *this); case LLIL_INTRINSIC_SSA: for (auto& i : GetParameterExprs<LLIL_INTRINSIC_SSA>()) params.push_back(subExprHandler(i)); @@ -3213,9 +3213,9 @@ ExprId LowLevelILFunction::SystemCall(const ILSourceLocation& loc) ExprId LowLevelILFunction::Intrinsic(const vector<RegisterOrFlag>& outputs, uint32_t intrinsic, - const vector<ExprId>& params, const ILSourceLocation& loc) + const vector<ExprId>& params, uint32_t flags, const ILSourceLocation& loc) { - return AddExprWithLocation(LLIL_INTRINSIC, loc, 0, 0, + return AddExprWithLocation(LLIL_INTRINSIC, loc, 0, flags, outputs.size(), AddRegisterOrFlagList(outputs), intrinsic, AddExprWithLocation(LLIL_CALL_PARAM, loc, 0, 0, params.size(), AddOperandList(params))); } diff --git a/python/lowlevelil.py b/python/lowlevelil.py index 33296ce8..273d3aeb 100644 --- a/python/lowlevelil.py +++ b/python/lowlevelil.py @@ -1770,7 +1770,7 @@ class LowLevelILFunction(object): """ return self.expr(LowLevelILOperation.LLIL_SYSCALL) - def intrinsic(self, outputs, intrinsic, params): + def intrinsic(self, outputs, intrinsic, params, flags=None): """ ``intrinsic`` return an intrinsic expression. @@ -1787,7 +1787,7 @@ class LowLevelILFunction(object): for param in params: param_list.append(param.index) return self.expr(LowLevelILOperation.LLIL_INTRINSIC, len(outputs), self.add_operand_list(output_list), - self.arch.get_intrinsic_index(intrinsic), len(params), self.add_operand_list(param_list)) + self.arch.get_intrinsic_index(intrinsic), len(params), self.add_operand_list(param_list), flags = flags) def breakpoint(self): """ |
