diff options
| author | Rusty Wagner <rusty@vector35.com> | 2018-01-31 21:08:05 -0500 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2018-01-31 21:08:05 -0500 |
| commit | fd51307c7fa5baff29860b1e3be09aafca13c2f0 (patch) | |
| tree | 2bb384a3a0660fec08aeedd318cc3f0876130586 | |
| parent | 2f3873928078e8c21911ffeb5476781b31886514 (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 d1ca9cdb..3decc4e9 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -2671,7 +2671,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 2c00db68..1a834435 100644 --- a/lowlevelilinstruction.cpp +++ b/lowlevelilinstruction.cpp @@ -2139,7 +2139,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)); @@ -3212,9 +3212,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): """ |
