From 68a9e96c98dbed4e4154a13ffec7b9c94876661a Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Mon, 27 Apr 2020 23:14:44 -0400 Subject: Add names for goto labels --- highlevelilinstruction.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'highlevelilinstruction.h') diff --git a/highlevelilinstruction.h b/highlevelilinstruction.h index aa872e67..fd140e24 100644 --- a/highlevelilinstruction.h +++ b/highlevelilinstruction.h @@ -298,6 +298,7 @@ namespace BinaryNinja HighLevelILIndexList GetRawOperandAsIndexList(size_t operand) const; void UpdateRawOperand(size_t operandIndex, ExprId value); + void UpdateRawOperandAsInteger(size_t operandIndex, uint64_t value); void UpdateRawOperandAsSSAVariableList(size_t operandIndex, const std::vector& vars); void UpdateRawOperandAsExprList(size_t operandIndex, const std::vector& exprs); void UpdateRawOperandAsExprList(size_t operandIndex, const std::vector& exprs); @@ -411,7 +412,7 @@ namespace BinaryNinja template int64_t GetConstant() const { return As().GetConstant(); } template int64_t GetVector() const { return As().GetVector(); } template uint32_t GetIntrinsic() const { return As().GetIntrinsic(); } - template size_t GetTarget() const { return As().GetTarget(); } + template uint64_t GetTarget() const { return As().GetTarget(); } template HighLevelILInstructionList GetParameterExprs() const { return As().GetParameterExprs(); } template HighLevelILInstructionList GetSourceExprs() const { return As().GetSourceExprs(); } template HighLevelILInstructionList GetDestExprs() const { return As().GetDestExprs(); } @@ -438,6 +439,7 @@ namespace BinaryNinja template void SetSourceSSAVariables(const std::vector& vars) { As().SetSourceSSAVariables(vars); } template void SetSourceMemoryVersion(size_t version) { return As().SetSourceMemoryVersion(version); } template void SetDestMemoryVersion(size_t version) { return As().SetDestMemoryVersion(version); } + template void SetTarget(uint64_t target) { As().SetTarget(target); } bool GetOperandIndexForUsage(HighLevelILOperandUsage usage, size_t& operandIndex) const; @@ -468,7 +470,7 @@ namespace BinaryNinja int64_t GetConstant() const; int64_t GetVector() const; uint32_t GetIntrinsic() const; - size_t GetTarget() const; + uint64_t GetTarget() const; HighLevelILInstructionList GetParameterExprs() const; HighLevelILInstructionList GetSourceExprs() const; HighLevelILInstructionList GetDestExprs() const; @@ -624,11 +626,13 @@ namespace BinaryNinja }; template <> struct HighLevelILInstructionAccessor: public HighLevelILInstructionBase { - size_t GetTarget() const { return GetRawOperandAsIndex(0); } + uint64_t GetTarget() const { return GetRawOperandAsInteger(0); } + void SetTarget(uint64_t target) { UpdateRawOperandAsInteger(0, target); } }; template <> struct HighLevelILInstructionAccessor: public HighLevelILInstructionBase { - size_t GetTarget() const { return GetRawOperandAsIndex(0); } + uint64_t GetTarget() const { return GetRawOperandAsInteger(0); } + void SetTarget(uint64_t target) { UpdateRawOperandAsInteger(0, target); } }; template <> struct HighLevelILInstructionAccessor: public HighLevelILInstructionBase -- cgit v1.3.1