summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2020-05-08 05:26:56 -0400
committerRusty Wagner <rusty@vector35.com>2020-05-11 15:55:54 -0400
commit0cf59807fa364b11de65dc3f1e1c2d2bc7dd87a2 (patch)
treea909c15c117f5eb1cf38853659ba799f1b5c1506
parentceacbae6b36e1425c2e0dd87c73075858f21ec10 (diff)
Modifications for supporting jemalloc in the core
-rw-r--r--highlevelilinstruction.cpp8
-rw-r--r--highlevelilinstruction.h80
-rw-r--r--json/json.h2
-rw-r--r--json/jsoncpp.cpp4
-rw-r--r--lowlevelilinstruction.cpp4
-rw-r--r--lowlevelilinstruction.h87
-rw-r--r--mediumlevelilinstruction.cpp2
-rw-r--r--mediumlevelilinstruction.h109
8 files changed, 176 insertions, 120 deletions
diff --git a/highlevelilinstruction.cpp b/highlevelilinstruction.cpp
index 88f833e0..d7d1c6aa 100644
--- a/highlevelilinstruction.cpp
+++ b/highlevelilinstruction.cpp
@@ -30,7 +30,9 @@ using namespace BinaryNinjaCore;
using namespace BinaryNinja;
#endif
+#ifndef BINARYNINJACORE_LIBRARY
using namespace std;
+#endif
unordered_map<HighLevelILOperandUsage, HighLevelILOperandType>
@@ -2320,7 +2322,7 @@ ExprId HighLevelILFunction::Nop(const ILSourceLocation& loc)
}
-ExprId HighLevelILFunction::Block(const std::vector<ExprId>& exprs, const ILSourceLocation& loc)
+ExprId HighLevelILFunction::Block(const vector<ExprId>& exprs, const ILSourceLocation& loc)
{
return AddExprWithLocation(HLIL_BLOCK, loc, 0, exprs.size(), AddOperandList(exprs));
}
@@ -2373,7 +2375,7 @@ ExprId HighLevelILFunction::ForSSA(ExprId initExpr, ExprId conditionPhi, ExprId
}
-ExprId HighLevelILFunction::Switch(ExprId condition, ExprId defaultExpr, const std::vector<ExprId>& cases,
+ExprId HighLevelILFunction::Switch(ExprId condition, ExprId defaultExpr, const vector<ExprId>& cases,
const ILSourceLocation& loc)
{
return AddExprWithLocation(HLIL_SWITCH, loc, 0, condition, defaultExpr,
@@ -2381,7 +2383,7 @@ ExprId HighLevelILFunction::Switch(ExprId condition, ExprId defaultExpr, const s
}
-ExprId HighLevelILFunction::Case(const std::vector<ExprId>& values, ExprId expr, const ILSourceLocation& loc)
+ExprId HighLevelILFunction::Case(const vector<ExprId>& values, ExprId expr, const ILSourceLocation& loc)
{
return AddExprWithLocation(HLIL_CASE, loc, 0, values.size(), AddOperandList(values), expr);
}
diff --git a/highlevelilinstruction.h b/highlevelilinstruction.h
index fd140e24..497cf122 100644
--- a/highlevelilinstruction.h
+++ b/highlevelilinstruction.h
@@ -142,6 +142,16 @@ namespace BinaryNinjaCore
namespace BinaryNinja
#endif
{
+#ifdef BINARYNINJACORE_LIBRARY
+#define _STD_VECTOR vector
+#define _STD_SET set
+#define _STD_UNORDERED_MAP unordered_map
+#else
+#define _STD_VECTOR std::vector
+#define _STD_SET std::set
+#define _STD_UNORDERED_MAP std::unordered_map
+#endif
+
class HighLevelILInstructionAccessException: public std::exception
{
public:
@@ -181,7 +191,7 @@ namespace BinaryNinja
size_t size() const;
uint64_t operator[](size_t i) const;
- operator std::vector<uint64_t>() const;
+ operator _STD_VECTOR<uint64_t>() const;
};
class HighLevelILIndexList
@@ -208,7 +218,7 @@ namespace BinaryNinja
size_t size() const;
size_t operator[](size_t i) const;
- operator std::vector<size_t>() const;
+ operator _STD_VECTOR<size_t>() const;
};
class HighLevelILInstructionList
@@ -240,7 +250,7 @@ namespace BinaryNinja
size_t size() const;
const HighLevelILInstruction operator[](size_t i) const;
- operator std::vector<HighLevelILInstruction>() const;
+ operator _STD_VECTOR<HighLevelILInstruction>() const;
};
class HighLevelILSSAVariableList
@@ -267,7 +277,7 @@ namespace BinaryNinja
size_t size() const;
const SSAVariable operator[](size_t i) const;
- operator std::vector<SSAVariable>() const;
+ operator _STD_VECTOR<SSAVariable>() const;
};
struct HighLevelILInstructionBase: public BNHighLevelILInstruction
@@ -280,11 +290,11 @@ namespace BinaryNinja
size_t exprIndex, instructionIndex;
bool ast;
- static std::unordered_map<HighLevelILOperandUsage, HighLevelILOperandType> operandTypeForUsage;
- static std::unordered_map<BNHighLevelILOperation,
- std::vector<HighLevelILOperandUsage>> operationOperandUsage;
- static std::unordered_map<BNHighLevelILOperation,
- std::unordered_map<HighLevelILOperandUsage, size_t>> operationOperandIndex;
+ static _STD_UNORDERED_MAP<HighLevelILOperandUsage, HighLevelILOperandType> operandTypeForUsage;
+ static _STD_UNORDERED_MAP<BNHighLevelILOperation,
+ _STD_VECTOR<HighLevelILOperandUsage>> operationOperandUsage;
+ static _STD_UNORDERED_MAP<BNHighLevelILOperation,
+ _STD_UNORDERED_MAP<HighLevelILOperandUsage, size_t>> operationOperandIndex;
HighLevelILOperandList GetOperands() const;
@@ -299,13 +309,13 @@ namespace BinaryNinja
void UpdateRawOperand(size_t operandIndex, ExprId value);
void UpdateRawOperandAsInteger(size_t operandIndex, uint64_t value);
- void UpdateRawOperandAsSSAVariableList(size_t operandIndex, const std::vector<SSAVariable>& vars);
- void UpdateRawOperandAsExprList(size_t operandIndex, const std::vector<HighLevelILInstruction>& exprs);
- void UpdateRawOperandAsExprList(size_t operandIndex, const std::vector<size_t>& exprs);
+ void UpdateRawOperandAsSSAVariableList(size_t operandIndex, const _STD_VECTOR<SSAVariable>& vars);
+ void UpdateRawOperandAsExprList(size_t operandIndex, const _STD_VECTOR<HighLevelILInstruction>& exprs);
+ void UpdateRawOperandAsExprList(size_t operandIndex, const _STD_VECTOR<size_t>& exprs);
RegisterValue GetValue() const;
- PossibleValueSet GetPossibleValues(const std::set<BNDataFlowQueryOption>& options =
- std::set<BNDataFlowQueryOption>()) const;
+ PossibleValueSet GetPossibleValues(const _STD_SET<BNDataFlowQueryOption>& options =
+ _STD_SET<BNDataFlowQueryOption>()) const;
Confidence<Ref<Type>> GetType() const;
size_t GetMediumLevelILExprIndex() const;
@@ -426,17 +436,17 @@ namespace BinaryNinja
template <BNHighLevelILOperation N> void SetSSAVersion(size_t version) { As<N>().SetSSAVersion(version); }
template <BNHighLevelILOperation N> void SetDestSSAVersion(size_t version) { As<N>().SetDestSSAVersion(version); }
- template <BNHighLevelILOperation N> void SetParameterExprs(const std::vector<MediumLevelILInstruction>& params) { As<N>().SetParameterExprs(params); }
- template <BNHighLevelILOperation N> void SetParameterExprs(const std::vector<ExprId>& params) { As<N>().SetParameterExprs(params); }
- template <BNHighLevelILOperation N> void SetSourceExprs(const std::vector<MediumLevelILInstruction>& params) { As<N>().SetSourceExprs(params); }
- template <BNHighLevelILOperation N> void SetSourceExprs(const std::vector<ExprId>& params) { As<N>().SetSourceExprs(params); }
- template <BNHighLevelILOperation N> void SetDestExprs(const std::vector<MediumLevelILInstruction>& params) { As<N>().SetDestExprs(params); }
- template <BNHighLevelILOperation N> void SetDestExprs(const std::vector<ExprId>& params) { As<N>().SetDestExprs(params); }
- template <BNHighLevelILOperation N> void SetBlockExprs(const std::vector<MediumLevelILInstruction>& params) { As<N>().SetBlockExprs(params); }
- template <BNHighLevelILOperation N> void SetBlockExprs(const std::vector<ExprId>& params) { As<N>().SetBlockExprs(params); }
- template <BNHighLevelILOperation N> void SetCases(const std::vector<MediumLevelILInstruction>& params) { As<N>().SetCases(params); }
- template <BNHighLevelILOperation N> void SetCases(const std::vector<ExprId>& params) { As<N>().SetCases(params); }
- template <BNHighLevelILOperation N> void SetSourceSSAVariables(const std::vector<SSAVariable>& vars) { As<N>().SetSourceSSAVariables(vars); }
+ template <BNHighLevelILOperation N> void SetParameterExprs(const _STD_VECTOR<MediumLevelILInstruction>& params) { As<N>().SetParameterExprs(params); }
+ template <BNHighLevelILOperation N> void SetParameterExprs(const _STD_VECTOR<ExprId>& params) { As<N>().SetParameterExprs(params); }
+ template <BNHighLevelILOperation N> void SetSourceExprs(const _STD_VECTOR<MediumLevelILInstruction>& params) { As<N>().SetSourceExprs(params); }
+ template <BNHighLevelILOperation N> void SetSourceExprs(const _STD_VECTOR<ExprId>& params) { As<N>().SetSourceExprs(params); }
+ template <BNHighLevelILOperation N> void SetDestExprs(const _STD_VECTOR<MediumLevelILInstruction>& params) { As<N>().SetDestExprs(params); }
+ template <BNHighLevelILOperation N> void SetDestExprs(const _STD_VECTOR<ExprId>& params) { As<N>().SetDestExprs(params); }
+ template <BNHighLevelILOperation N> void SetBlockExprs(const _STD_VECTOR<MediumLevelILInstruction>& params) { As<N>().SetBlockExprs(params); }
+ template <BNHighLevelILOperation N> void SetBlockExprs(const _STD_VECTOR<ExprId>& params) { As<N>().SetBlockExprs(params); }
+ template <BNHighLevelILOperation N> void SetCases(const _STD_VECTOR<MediumLevelILInstruction>& params) { As<N>().SetCases(params); }
+ template <BNHighLevelILOperation N> void SetCases(const _STD_VECTOR<ExprId>& params) { As<N>().SetCases(params); }
+ template <BNHighLevelILOperation N> void SetSourceSSAVariables(const _STD_VECTOR<SSAVariable>& vars) { As<N>().SetSourceSSAVariables(vars); }
template <BNHighLevelILOperation N> void SetSourceMemoryVersion(size_t version) { return As<N>().SetSourceMemoryVersion(version); }
template <BNHighLevelILOperation N> void SetDestMemoryVersion(size_t version) { return As<N>().SetDestMemoryVersion(version); }
template <BNHighLevelILOperation N> void SetTarget(uint64_t target) { As<N>().SetTarget(target); }
@@ -513,7 +523,7 @@ namespace BinaryNinja
struct ListIterator
{
const HighLevelILOperandList* owner;
- std::vector<HighLevelILOperandUsage>::const_iterator pos;
+ _STD_VECTOR<HighLevelILOperandUsage>::const_iterator pos;
bool operator==(const ListIterator& a) const { return pos == a.pos; }
bool operator!=(const ListIterator& a) const { return pos != a.pos; }
bool operator<(const ListIterator& a) const { return pos < a.pos; }
@@ -522,22 +532,22 @@ namespace BinaryNinja
};
HighLevelILInstruction m_instr;
- const std::vector<HighLevelILOperandUsage>& m_usageList;
- const std::unordered_map<HighLevelILOperandUsage, size_t>& m_operandIndexMap;
+ const _STD_VECTOR<HighLevelILOperandUsage>& m_usageList;
+ const _STD_UNORDERED_MAP<HighLevelILOperandUsage, size_t>& m_operandIndexMap;
public:
typedef ListIterator const_iterator;
HighLevelILOperandList(const HighLevelILInstruction& instr,
- const std::vector<HighLevelILOperandUsage>& usageList,
- const std::unordered_map<HighLevelILOperandUsage, size_t>& operandIndexMap);
+ const _STD_VECTOR<HighLevelILOperandUsage>& usageList,
+ const _STD_UNORDERED_MAP<HighLevelILOperandUsage, size_t>& operandIndexMap);
const_iterator begin() const;
const_iterator end() const;
size_t size() const;
const HighLevelILOperand operator[](size_t i) const;
- operator std::vector<HighLevelILOperand>() const;
+ operator _STD_VECTOR<HighLevelILOperand>() const;
};
struct HighLevelILConstantInstruction: public HighLevelILInstructionBase
@@ -638,7 +648,7 @@ namespace BinaryNinja
template <> struct HighLevelILInstructionAccessor<HLIL_RET>: public HighLevelILInstructionBase
{
HighLevelILInstructionList GetSourceExprs() const { return GetRawOperandAsExprList(0); }
- void SetSourceExprs(const std::vector<ExprId>& exprs) { UpdateRawOperandAsExprList(0, exprs); }
+ void SetSourceExprs(const _STD_VECTOR<ExprId>& exprs) { UpdateRawOperandAsExprList(0, exprs); }
};
template <> struct HighLevelILInstructionAccessor<HLIL_VAR_DECLARE>: public HighLevelILInstructionBase
@@ -742,7 +752,7 @@ namespace BinaryNinja
{
SSAVariable GetDestSSAVariable() const { return GetRawOperandAsSSAVariable(0); }
HighLevelILSSAVariableList GetSourceSSAVariables() const { return GetRawOperandAsSSAVariableList(2); }
- void SetSourceSSAVariables(const std::vector<SSAVariable>& vars) { UpdateRawOperandAsSSAVariableList(2, vars); }
+ void SetSourceSSAVariables(const _STD_VECTOR<SSAVariable>& vars) { UpdateRawOperandAsSSAVariableList(2, vars); }
};
template <> struct HighLevelILInstructionAccessor<HLIL_MEM_PHI>: public HighLevelILInstructionBase
{
@@ -897,4 +907,8 @@ namespace BinaryNinja
template <> struct HighLevelILInstructionAccessor<HLIL_FLOOR>: public HighLevelILOneOperandInstruction {};
template <> struct HighLevelILInstructionAccessor<HLIL_CEIL>: public HighLevelILOneOperandInstruction {};
template <> struct HighLevelILInstructionAccessor<HLIL_FTRUNC>: public HighLevelILOneOperandInstruction {};
+
+#undef _STD_VECTOR
+#undef _STD_SET
+#undef _STD_UNORDERED_MAP
}
diff --git a/json/json.h b/json/json.h
index 51a38e65..da91470a 100644
--- a/json/json.h
+++ b/json/json.h
@@ -308,7 +308,7 @@ typedef UInt64 LargestUInt;
std::basic_istringstream<char, std::char_traits<char>, \
Json::SecureAllocator<char> >
#define JSONCPP_ISTREAM std::istream
-#else
+#elif !defined(JSONCPP_STRING)
#define JSONCPP_STRING std::string
#define JSONCPP_OSTRINGSTREAM std::ostringstream
#define JSONCPP_OSTREAM std::ostream
diff --git a/json/jsoncpp.cpp b/json/jsoncpp.cpp
index c2a949d3..4154200b 100644
--- a/json/jsoncpp.cpp
+++ b/json/jsoncpp.cpp
@@ -71,7 +71,9 @@ license you like.
-
+#ifdef BINARYNINJACORE_LIBRARY
+#include "binaryninjacore_global.h"
+#endif
#include "json/json.h"
diff --git a/lowlevelilinstruction.cpp b/lowlevelilinstruction.cpp
index f55d15f0..faaa79a9 100644
--- a/lowlevelilinstruction.cpp
+++ b/lowlevelilinstruction.cpp
@@ -30,7 +30,9 @@ using namespace BinaryNinjaCore;
using namespace BinaryNinja;
#endif
+#ifndef BINARYNINJACORE_LIBRARY
using namespace std;
+#endif
unordered_map<LowLevelILOperandUsage, LowLevelILOperandType>
@@ -3262,7 +3264,7 @@ ExprId LowLevelILFunction::Call(ExprId dest, const ILSourceLocation& loc)
ExprId LowLevelILFunction::CallStackAdjust(ExprId dest, int64_t adjust,
- const std::map<uint32_t, int32_t>& regStackAdjust, const ILSourceLocation& loc)
+ const map<uint32_t, int32_t>& regStackAdjust, const ILSourceLocation& loc)
{
vector<size_t> list;
for (auto& i : regStackAdjust)
diff --git a/lowlevelilinstruction.h b/lowlevelilinstruction.h
index 0fcc36eb..183ce10b 100644
--- a/lowlevelilinstruction.h
+++ b/lowlevelilinstruction.h
@@ -316,6 +316,18 @@ namespace BinaryNinjaCore
namespace BinaryNinja
#endif
{
+#ifdef BINARYNINJACORE_LIBRARY
+#define _STD_VECTOR vector
+#define _STD_SET set
+#define _STD_UNORDERED_MAP unordered_map
+#define _STD_MAP map
+#else
+#define _STD_VECTOR std::vector
+#define _STD_SET std::set
+#define _STD_UNORDERED_MAP std::unordered_map
+#define _STD_MAP std::map
+#endif
+
class LowLevelILInstructionAccessException: public std::exception
{
public:
@@ -356,7 +368,7 @@ namespace BinaryNinja
size_t size() const;
uint64_t operator[](size_t i) const;
- operator std::vector<uint64_t>() const;
+ operator _STD_VECTOR<uint64_t>() const;
};
class LowLevelILIndexList
@@ -383,7 +395,7 @@ namespace BinaryNinja
size_t size() const;
size_t operator[](size_t i) const;
- operator std::vector<size_t>() const;
+ operator _STD_VECTOR<size_t>() const;
};
class LowLevelILIndexMap
@@ -410,7 +422,7 @@ namespace BinaryNinja
size_t size() const;
size_t operator[](uint64_t value) const;
- operator std::map<uint64_t, size_t>() const;
+ operator _STD_MAP<uint64_t, size_t>() const;
};
class LowLevelILInstructionList
@@ -440,7 +452,7 @@ namespace BinaryNinja
size_t size() const;
const LowLevelILInstruction operator[](size_t i) const;
- operator std::vector<LowLevelILInstruction>() const;
+ operator _STD_VECTOR<LowLevelILInstruction>() const;
};
class LowLevelILRegisterOrFlagList
@@ -467,7 +479,7 @@ namespace BinaryNinja
size_t size() const;
const RegisterOrFlag operator[](size_t i) const;
- operator std::vector<RegisterOrFlag>() const;
+ operator _STD_VECTOR<RegisterOrFlag>() const;
};
class LowLevelILSSARegisterList
@@ -494,7 +506,7 @@ namespace BinaryNinja
size_t size() const;
const SSARegister operator[](size_t i) const;
- operator std::vector<SSARegister>() const;
+ operator _STD_VECTOR<SSARegister>() const;
};
class LowLevelILSSARegisterStackList
@@ -521,7 +533,7 @@ namespace BinaryNinja
size_t size() const;
const SSARegisterStack operator[](size_t i) const;
- operator std::vector<SSARegisterStack>() const;
+ operator _STD_VECTOR<SSARegisterStack>() const;
};
class LowLevelILSSAFlagList
@@ -548,7 +560,7 @@ namespace BinaryNinja
size_t size() const;
const SSAFlag operator[](size_t i) const;
- operator std::vector<SSAFlag>() const;
+ operator _STD_VECTOR<SSAFlag>() const;
};
class LowLevelILSSARegisterOrFlagList
@@ -575,7 +587,7 @@ namespace BinaryNinja
size_t size() const;
const SSARegisterOrFlag operator[](size_t i) const;
- operator std::vector<SSARegisterOrFlag>() const;
+ operator _STD_VECTOR<SSARegisterOrFlag>() const;
};
struct LowLevelILInstructionBase: public BNLowLevelILInstruction
@@ -587,11 +599,11 @@ namespace BinaryNinja
#endif
size_t exprIndex, instructionIndex;
- static std::unordered_map<LowLevelILOperandUsage, LowLevelILOperandType> operandTypeForUsage;
- static std::unordered_map<BNLowLevelILOperation,
- std::vector<LowLevelILOperandUsage>> operationOperandUsage;
- static std::unordered_map<BNLowLevelILOperation,
- std::unordered_map<LowLevelILOperandUsage, size_t>> operationOperandIndex;
+ static _STD_UNORDERED_MAP<LowLevelILOperandUsage, LowLevelILOperandType> operandTypeForUsage;
+ static _STD_UNORDERED_MAP<BNLowLevelILOperation,
+ _STD_VECTOR<LowLevelILOperandUsage>> operationOperandUsage;
+ static _STD_UNORDERED_MAP<BNLowLevelILOperation,
+ _STD_UNORDERED_MAP<LowLevelILOperandUsage, size_t>> operationOperandIndex;
LowLevelILOperandList GetOperands() const;
@@ -612,15 +624,15 @@ namespace BinaryNinja
LowLevelILSSARegisterStackList GetRawOperandAsSSARegisterStackList(size_t operand) const;
LowLevelILSSAFlagList GetRawOperandAsSSAFlagList(size_t operand) const;
LowLevelILSSARegisterOrFlagList GetRawOperandAsSSARegisterOrFlagList(size_t operand) const;
- std::map<uint32_t, int32_t> GetRawOperandAsRegisterStackAdjustments(size_t operand) const;
+ _STD_MAP<uint32_t, int32_t> GetRawOperandAsRegisterStackAdjustments(size_t operand) const;
void UpdateRawOperand(size_t operandIndex, ExprId value);
- void UpdateRawOperandAsSSARegisterList(size_t operandIndex, const std::vector<SSARegister>& regs);
- void UpdateRawOperandAsSSARegisterOrFlagList(size_t operandIndex, const std::vector<SSARegisterOrFlag>& outputs);
+ void UpdateRawOperandAsSSARegisterList(size_t operandIndex, const _STD_VECTOR<SSARegister>& regs);
+ void UpdateRawOperandAsSSARegisterOrFlagList(size_t operandIndex, const _STD_VECTOR<SSARegisterOrFlag>& outputs);
RegisterValue GetValue() const;
- PossibleValueSet GetPossibleValues(const std::set<BNDataFlowQueryOption>& options =
- std::set<BNDataFlowQueryOption>()) const;
+ PossibleValueSet GetPossibleValues(const _STD_SET<BNDataFlowQueryOption>& options =
+ _STD_SET<BNDataFlowQueryOption>()) const;
RegisterValue GetRegisterValue(uint32_t reg);
RegisterValue GetRegisterValueAfter(uint32_t reg);
@@ -762,7 +774,7 @@ namespace BinaryNinja
template <BNLowLevelILOperation N> LowLevelILSSARegisterOrFlagList GetOutputSSARegisterOrFlagList() const { return As<N>().GetOutputSSARegisterOrFlagList(); }
template <BNLowLevelILOperation N> LowLevelILIndexList GetSourceMemoryVersions() const { return As<N>().GetSourceMemoryVersions(); }
template <BNLowLevelILOperation N> LowLevelILIndexMap GetTargets() const { return As<N>().GetTargets(); }
- template <BNLowLevelILOperation N> std::map<uint32_t, int32_t> GetRegisterStackAdjustments() const { return As<N>().GetRegisterStackAdjustments(); }
+ template <BNLowLevelILOperation N> _STD_MAP<uint32_t, int32_t> GetRegisterStackAdjustments() const { return As<N>().GetRegisterStackAdjustments(); }
template <BNLowLevelILOperation N> void SetDestSSAVersion(size_t version) { As<N>().SetDestSSAVersion(version); }
template <BNLowLevelILOperation N> void SetSourceSSAVersion(size_t version) { As<N>().SetSourceSSAVersion(version); }
@@ -772,8 +784,8 @@ namespace BinaryNinja
template <BNLowLevelILOperation N> void SetTopSSAVersion(size_t version) { As<N>().SetTopSSAVersion(version); }
template <BNLowLevelILOperation N> void SetDestMemoryVersion(size_t version) { As<N>().SetDestMemoryVersion(version); }
template <BNLowLevelILOperation N> void SetSourceMemoryVersion(size_t version) { As<N>().SetSourceMemoryVersion(version); }
- template <BNLowLevelILOperation N> void SetOutputSSARegisters(const std::vector<SSARegister>& regs) { As<N>().SetOutputSSARegisters(regs); }
- template <BNLowLevelILOperation N> void SetOutputSSARegisterOrFlagList(const std::vector<SSARegisterOrFlag>& outputs) { As<N>().SetOutputSSARegisterOrFlagList(outputs); }
+ template <BNLowLevelILOperation N> void SetOutputSSARegisters(const _STD_VECTOR<SSARegister>& regs) { As<N>().SetOutputSSARegisters(regs); }
+ template <BNLowLevelILOperation N> void SetOutputSSARegisterOrFlagList(const _STD_VECTOR<SSARegisterOrFlag>& outputs) { As<N>().SetOutputSSARegisterOrFlagList(outputs); }
bool GetOperandIndexForUsage(LowLevelILOperandUsage usage, size_t& operandIndex) const;
@@ -827,7 +839,7 @@ namespace BinaryNinja
LowLevelILSSARegisterOrFlagList GetOutputSSARegisterOrFlagList() const;
LowLevelILIndexList GetSourceMemoryVersions() const;
LowLevelILIndexMap GetTargets() const;
- std::map<uint32_t, int32_t> GetRegisterStackAdjustments() const;
+ _STD_MAP<uint32_t, int32_t> GetRegisterStackAdjustments() const;
};
class LowLevelILOperand
@@ -865,7 +877,7 @@ namespace BinaryNinja
LowLevelILSSAFlagList GetSSAFlagList() const;
LowLevelILRegisterOrFlagList GetRegisterOrFlagList() const;
LowLevelILSSARegisterOrFlagList GetSSARegisterOrFlagList() const;
- std::map<uint32_t, int32_t> GetRegisterStackAdjustments() const;
+ _STD_MAP<uint32_t, int32_t> GetRegisterStackAdjustments() const;
};
class LowLevelILOperandList
@@ -873,7 +885,7 @@ namespace BinaryNinja
struct ListIterator
{
const LowLevelILOperandList* owner;
- std::vector<LowLevelILOperandUsage>::const_iterator pos;
+ _STD_VECTOR<LowLevelILOperandUsage>::const_iterator pos;
bool operator==(const ListIterator& a) const { return pos == a.pos; }
bool operator!=(const ListIterator& a) const { return pos != a.pos; }
bool operator<(const ListIterator& a) const { return pos < a.pos; }
@@ -882,22 +894,22 @@ namespace BinaryNinja
};
LowLevelILInstruction m_instr;
- const std::vector<LowLevelILOperandUsage>& m_usageList;
- const std::unordered_map<LowLevelILOperandUsage, size_t>& m_operandIndexMap;
+ const _STD_VECTOR<LowLevelILOperandUsage>& m_usageList;
+ const _STD_UNORDERED_MAP<LowLevelILOperandUsage, size_t>& m_operandIndexMap;
public:
typedef ListIterator const_iterator;
LowLevelILOperandList(const LowLevelILInstruction& instr,
- const std::vector<LowLevelILOperandUsage>& usageList,
- const std::unordered_map<LowLevelILOperandUsage, size_t>& operandIndexMap);
+ const _STD_VECTOR<LowLevelILOperandUsage>& usageList,
+ const _STD_UNORDERED_MAP<LowLevelILOperandUsage, size_t>& operandIndexMap);
const_iterator begin() const;
const_iterator end() const;
size_t size() const;
const LowLevelILOperand operator[](size_t i) const;
- operator std::vector<LowLevelILOperand>() const;
+ operator _STD_VECTOR<LowLevelILOperand>() const;
};
struct LowLevelILConstantInstruction: public LowLevelILInstructionBase
@@ -1145,7 +1157,7 @@ namespace BinaryNinja
{
LowLevelILInstruction GetDestExpr() const { return GetRawOperandAsExpr(0); }
int64_t GetStackAdjustment() const { return GetRawOperandAsInteger(1); }
- std::map<uint32_t, int32_t> GetRegisterStackAdjustments() const { return GetRawOperandAsRegisterStackAdjustments(2); }
+ _STD_MAP<uint32_t, int32_t> GetRegisterStackAdjustments() const { return GetRawOperandAsRegisterStackAdjustments(2); }
};
template <> struct LowLevelILInstructionAccessor<LLIL_TAILCALL>: public LowLevelILInstructionBase
{
@@ -1193,7 +1205,7 @@ namespace BinaryNinja
void SetDestMemoryVersion(size_t version) { GetRawOperandAsExpr(0).UpdateRawOperand(0, version); }
void SetSourceMemoryVersion(size_t version) { GetRawOperandAsExpr(2).UpdateRawOperand(2, version); }
void SetStackSSAVersion(size_t version) { GetRawOperandAsExpr(2).UpdateRawOperand(1, version); }
- void SetOutputSSARegisters(const std::vector<SSARegister>& regs) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSARegisterList(1, regs); }
+ void SetOutputSSARegisters(const _STD_VECTOR<SSARegister>& regs) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSARegisterList(1, regs); }
};
template <> struct LowLevelILInstructionAccessor<LLIL_SYSCALL_SSA>: public LowLevelILInstructionBase
{
@@ -1205,7 +1217,7 @@ namespace BinaryNinja
void SetDestMemoryVersion(size_t version) { GetRawOperandAsExpr(0).UpdateRawOperand(0, version); }
void SetSourceMemoryVersion(size_t version) { GetRawOperandAsExpr(1).UpdateRawOperand(2, version); }
void SetStackSSAVersion(size_t version) { GetRawOperandAsExpr(1).UpdateRawOperand(1, version); }
- void SetOutputSSARegisters(const std::vector<SSARegister>& regs) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSARegisterList(1, regs); }
+ void SetOutputSSARegisters(const _STD_VECTOR<SSARegister>& regs) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSARegisterList(1, regs); }
};
template <> struct LowLevelILInstructionAccessor<LLIL_TAILCALL_SSA>: public LowLevelILInstructionBase
{
@@ -1218,7 +1230,7 @@ namespace BinaryNinja
void SetDestMemoryVersion(size_t version) { GetRawOperandAsExpr(0).UpdateRawOperand(0, version); }
void SetSourceMemoryVersion(size_t version) { GetRawOperandAsExpr(2).UpdateRawOperand(2, version); }
void SetStackSSAVersion(size_t version) { GetRawOperandAsExpr(2).UpdateRawOperand(1, version); }
- void SetOutputSSARegisters(const std::vector<SSARegister>& regs) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSARegisterList(1, regs); }
+ void SetOutputSSARegisters(const _STD_VECTOR<SSARegister>& regs) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSARegisterList(1, regs); }
};
template <> struct LowLevelILInstructionAccessor<LLIL_INTRINSIC>: public LowLevelILInstructionBase
@@ -1232,7 +1244,7 @@ namespace BinaryNinja
LowLevelILSSARegisterOrFlagList GetOutputSSARegisterOrFlagList() const { return GetRawOperandAsSSARegisterOrFlagList(0); }
uint32_t GetIntrinsic() const { return GetRawOperandAsRegister(2); }
LowLevelILInstructionList GetParameterExprs() const { return GetRawOperandAsExpr(3).GetRawOperandAsExprList(0); }
- void SetOutputSSARegisterOrFlagList(const std::vector<SSARegisterOrFlag>& outputs) { UpdateRawOperandAsSSARegisterOrFlagList(0, outputs); }
+ void SetOutputSSARegisterOrFlagList(const _STD_VECTOR<SSARegisterOrFlag>& outputs) { UpdateRawOperandAsSSARegisterOrFlagList(0, outputs); }
};
template <> struct LowLevelILInstructionAccessor<LLIL_REG_PHI>: public LowLevelILInstructionBase
@@ -1343,4 +1355,9 @@ namespace BinaryNinja
template <> struct LowLevelILInstructionAccessor<LLIL_FLOOR>: public LowLevelILOneOperandInstruction {};
template <> struct LowLevelILInstructionAccessor<LLIL_CEIL>: public LowLevelILOneOperandInstruction {};
template <> struct LowLevelILInstructionAccessor<LLIL_FTRUNC>: public LowLevelILOneOperandInstruction {};
+
+#undef _STD_VECTOR
+#undef _STD_SET
+#undef _STD_UNORDERED_MAP
+#undef _STD_MAP
}
diff --git a/mediumlevelilinstruction.cpp b/mediumlevelilinstruction.cpp
index 0ff7323e..3779eb90 100644
--- a/mediumlevelilinstruction.cpp
+++ b/mediumlevelilinstruction.cpp
@@ -30,7 +30,9 @@ using namespace BinaryNinjaCore;
using namespace BinaryNinja;
#endif
+#ifndef BINARYNINJACORE_LIBRARY
using namespace std;
+#endif
unordered_map<MediumLevelILOperandUsage, MediumLevelILOperandType>
diff --git a/mediumlevelilinstruction.h b/mediumlevelilinstruction.h
index 76b4ae61..f3b3062a 100644
--- a/mediumlevelilinstruction.h
+++ b/mediumlevelilinstruction.h
@@ -179,6 +179,18 @@ namespace BinaryNinjaCore
namespace BinaryNinja
#endif
{
+#ifdef BINARYNINJACORE_LIBRARY
+#define _STD_VECTOR vector
+#define _STD_SET set
+#define _STD_UNORDERED_MAP unordered_map
+#define _STD_MAP map
+#else
+#define _STD_VECTOR std::vector
+#define _STD_SET std::set
+#define _STD_UNORDERED_MAP std::unordered_map
+#define _STD_MAP std::map
+#endif
+
class MediumLevelILInstructionAccessException: public std::exception
{
public:
@@ -219,7 +231,7 @@ namespace BinaryNinja
size_t size() const;
uint64_t operator[](size_t i) const;
- operator std::vector<uint64_t>() const;
+ operator _STD_VECTOR<uint64_t>() const;
};
class MediumLevelILIndexList
@@ -246,7 +258,7 @@ namespace BinaryNinja
size_t size() const;
size_t operator[](size_t i) const;
- operator std::vector<size_t>() const;
+ operator _STD_VECTOR<size_t>() const;
};
class MediumLevelILIndexMap
@@ -273,7 +285,7 @@ namespace BinaryNinja
size_t size() const;
size_t operator[](uint64_t) const;
- operator std::map<uint64_t, size_t>() const;
+ operator _STD_MAP<uint64_t, size_t>() const;
};
class MediumLevelILVariableList
@@ -300,7 +312,7 @@ namespace BinaryNinja
size_t size() const;
const Variable operator[](size_t i) const;
- operator std::vector<Variable>() const;
+ operator _STD_VECTOR<Variable>() const;
};
class MediumLevelILSSAVariableList
@@ -327,7 +339,7 @@ namespace BinaryNinja
size_t size() const;
const SSAVariable operator[](size_t i) const;
- operator std::vector<SSAVariable>() const;
+ operator _STD_VECTOR<SSAVariable>() const;
};
class MediumLevelILInstructionList
@@ -357,7 +369,7 @@ namespace BinaryNinja
size_t size() const;
const MediumLevelILInstruction operator[](size_t i) const;
- operator std::vector<MediumLevelILInstruction>() const;
+ operator _STD_VECTOR<MediumLevelILInstruction>() const;
};
struct MediumLevelILInstructionBase: public BNMediumLevelILInstruction
@@ -369,11 +381,11 @@ namespace BinaryNinja
#endif
size_t exprIndex, instructionIndex;
- static std::unordered_map<MediumLevelILOperandUsage, MediumLevelILOperandType> operandTypeForUsage;
- static std::unordered_map<BNMediumLevelILOperation,
- std::vector<MediumLevelILOperandUsage>> operationOperandUsage;
- static std::unordered_map<BNMediumLevelILOperation,
- std::unordered_map<MediumLevelILOperandUsage, size_t>> operationOperandIndex;
+ static _STD_UNORDERED_MAP<MediumLevelILOperandUsage, MediumLevelILOperandType> operandTypeForUsage;
+ static _STD_UNORDERED_MAP<BNMediumLevelILOperation,
+ _STD_VECTOR<MediumLevelILOperandUsage>> operationOperandUsage;
+ static _STD_UNORDERED_MAP<BNMediumLevelILOperation,
+ _STD_UNORDERED_MAP<MediumLevelILOperandUsage, size_t>> operationOperandIndex;
MediumLevelILOperandList GetOperands() const;
@@ -390,13 +402,13 @@ namespace BinaryNinja
MediumLevelILInstructionList GetRawOperandAsExprList(size_t operand) const;
void UpdateRawOperand(size_t operandIndex, ExprId value);
- void UpdateRawOperandAsSSAVariableList(size_t operandIndex, const std::vector<SSAVariable>& vars);
- void UpdateRawOperandAsExprList(size_t operandIndex, const std::vector<MediumLevelILInstruction>& exprs);
- void UpdateRawOperandAsExprList(size_t operandIndex, const std::vector<size_t>& exprs);
+ void UpdateRawOperandAsSSAVariableList(size_t operandIndex, const _STD_VECTOR<SSAVariable>& vars);
+ void UpdateRawOperandAsExprList(size_t operandIndex, const _STD_VECTOR<MediumLevelILInstruction>& exprs);
+ void UpdateRawOperandAsExprList(size_t operandIndex, const _STD_VECTOR<size_t>& exprs);
RegisterValue GetValue() const;
- PossibleValueSet GetPossibleValues(const std::set<BNDataFlowQueryOption>& options =
- std::set<BNDataFlowQueryOption>()) const;
+ PossibleValueSet GetPossibleValues(const _STD_SET<BNDataFlowQueryOption>& options =
+ _STD_SET<BNDataFlowQueryOption>()) const;
Confidence<Ref<Type>> GetType() const;
size_t GetSSAVarVersion(const Variable& var);
@@ -421,7 +433,7 @@ namespace BinaryNinja
BNILBranchDependence GetBranchDependence(size_t branchInstr);
BNILBranchDependence GetBranchDependence(const MediumLevelILInstruction& branch);
- std::unordered_map<size_t, BNILBranchDependence> GetAllBranchDependence();
+ _STD_UNORDERED_MAP<size_t, BNILBranchDependence> GetAllBranchDependence();
size_t GetSSAInstructionIndex() const;
size_t GetNonSSAInstructionIndex() const;
@@ -539,12 +551,12 @@ namespace BinaryNinja
template <BNMediumLevelILOperation N> void SetLowSSAVersion(size_t version) { As<N>().SetLowSSAVersion(version); }
template <BNMediumLevelILOperation N> void SetDestMemoryVersion(size_t version) { As<N>().SetDestMemoryVersion(version); }
template <BNMediumLevelILOperation N> void SetSourceMemoryVersion(size_t version) { As<N>().SetSourceMemoryVersion(version); }
- template <BNMediumLevelILOperation N> void SetOutputSSAVariables(const std::vector<SSAVariable>& vars) { As<N>().SetOutputSSAVariables(vars); }
- template <BNMediumLevelILOperation N> void SetParameterSSAVariables(const std::vector<SSAVariable>& vars) { As<N>().SetParameterSSAVariables(vars); }
- template <BNMediumLevelILOperation N> void SetParameterExprs(const std::vector<MediumLevelILInstruction>& params) { As<N>().SetParameterExprs(params); }
- template <BNMediumLevelILOperation N> void SetParameterExprs(const std::vector<ExprId>& params) { As<N>().SetParameterExprs(params); }
- template <BNMediumLevelILOperation N> void SetSourceExprs(const std::vector<MediumLevelILInstruction>& params) { As<N>().SetSourceExprs(params); }
- template <BNMediumLevelILOperation N> void SetSourceExprs(const std::vector<ExprId>& params) { As<N>().SetSourceExprs(params); }
+ template <BNMediumLevelILOperation N> void SetOutputSSAVariables(const _STD_VECTOR<SSAVariable>& vars) { As<N>().SetOutputSSAVariables(vars); }
+ template <BNMediumLevelILOperation N> void SetParameterSSAVariables(const _STD_VECTOR<SSAVariable>& vars) { As<N>().SetParameterSSAVariables(vars); }
+ template <BNMediumLevelILOperation N> void SetParameterExprs(const _STD_VECTOR<MediumLevelILInstruction>& params) { As<N>().SetParameterExprs(params); }
+ template <BNMediumLevelILOperation N> void SetParameterExprs(const _STD_VECTOR<ExprId>& params) { As<N>().SetParameterExprs(params); }
+ template <BNMediumLevelILOperation N> void SetSourceExprs(const _STD_VECTOR<MediumLevelILInstruction>& params) { As<N>().SetSourceExprs(params); }
+ template <BNMediumLevelILOperation N> void SetSourceExprs(const _STD_VECTOR<ExprId>& params) { As<N>().SetSourceExprs(params); }
bool GetOperandIndexForUsage(MediumLevelILOperandUsage usage, size_t& operandIndex) const;
@@ -617,7 +629,7 @@ namespace BinaryNinja
struct ListIterator
{
const MediumLevelILOperandList* owner;
- std::vector<MediumLevelILOperandUsage>::const_iterator pos;
+ _STD_VECTOR<MediumLevelILOperandUsage>::const_iterator pos;
bool operator==(const ListIterator& a) const { return pos == a.pos; }
bool operator!=(const ListIterator& a) const { return pos != a.pos; }
bool operator<(const ListIterator& a) const { return pos < a.pos; }
@@ -626,22 +638,22 @@ namespace BinaryNinja
};
MediumLevelILInstruction m_instr;
- const std::vector<MediumLevelILOperandUsage>& m_usageList;
- const std::unordered_map<MediumLevelILOperandUsage, size_t>& m_operandIndexMap;
+ const _STD_VECTOR<MediumLevelILOperandUsage>& m_usageList;
+ const _STD_UNORDERED_MAP<MediumLevelILOperandUsage, size_t>& m_operandIndexMap;
public:
typedef ListIterator const_iterator;
MediumLevelILOperandList(const MediumLevelILInstruction& instr,
- const std::vector<MediumLevelILOperandUsage>& usageList,
- const std::unordered_map<MediumLevelILOperandUsage, size_t>& operandIndexMap);
+ const _STD_VECTOR<MediumLevelILOperandUsage>& usageList,
+ const _STD_UNORDERED_MAP<MediumLevelILOperandUsage, size_t>& operandIndexMap);
const_iterator begin() const;
const_iterator end() const;
size_t size() const;
const MediumLevelILOperand operator[](size_t i) const;
- operator std::vector<MediumLevelILOperand>() const;
+ operator _STD_VECTOR<MediumLevelILOperand>() const;
};
struct MediumLevelILConstantInstruction: public MediumLevelILInstructionBase
@@ -896,9 +908,9 @@ namespace BinaryNinja
size_t GetSourceMemoryVersion() const { return GetRawOperandAsIndex(4); }
void SetDestMemoryVersion(size_t version) { GetRawOperandAsExpr(0).UpdateRawOperand(0, version); }
void SetSourceMemoryVersion(size_t version) { UpdateRawOperand(4, version); }
- void SetOutputSSAVariables(const std::vector<SSAVariable>& vars) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); }
- void SetParameterExprs(const std::vector<MediumLevelILInstruction>& params) { UpdateRawOperandAsExprList(2, params); }
- void SetParameterExprs(const std::vector<ExprId>& params) { UpdateRawOperandAsExprList(2, params); }
+ void SetOutputSSAVariables(const _STD_VECTOR<SSAVariable>& vars) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); }
+ void SetParameterExprs(const _STD_VECTOR<MediumLevelILInstruction>& params) { UpdateRawOperandAsExprList(2, params); }
+ void SetParameterExprs(const _STD_VECTOR<ExprId>& params) { UpdateRawOperandAsExprList(2, params); }
};
template <> struct MediumLevelILInstructionAccessor<MLIL_CALL_UNTYPED_SSA>: public MediumLevelILInstructionBase
{
@@ -910,8 +922,8 @@ namespace BinaryNinja
MediumLevelILInstruction GetStackExpr() const { return GetRawOperandAsExpr(3); }
void SetDestMemoryVersion(size_t version) { GetRawOperandAsExpr(0).UpdateRawOperand(0, version); }
void SetSourceMemoryVersion(size_t version) { GetRawOperandAsExpr(2).UpdateRawOperand(0, version); }
- void SetOutputSSAVariables(const std::vector<SSAVariable>& vars) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); }
- void SetParameterSSAVariables(const std::vector<SSAVariable>& vars) { GetRawOperandAsExpr(2).UpdateRawOperandAsSSAVariableList(1, vars); }
+ void SetOutputSSAVariables(const _STD_VECTOR<SSAVariable>& vars) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); }
+ void SetParameterSSAVariables(const _STD_VECTOR<SSAVariable>& vars) { GetRawOperandAsExpr(2).UpdateRawOperandAsSSAVariableList(1, vars); }
};
template <> struct MediumLevelILInstructionAccessor<MLIL_SYSCALL_SSA>: public MediumLevelILInstructionBase
{
@@ -921,9 +933,9 @@ namespace BinaryNinja
size_t GetSourceMemoryVersion() const { return GetRawOperandAsIndex(3); }
void SetDestMemoryVersion(size_t version) { GetRawOperandAsExpr(0).UpdateRawOperand(0, version); }
void SetSourceMemoryVersion(size_t version) { UpdateRawOperand(3, version); }
- void SetOutputSSAVariables(const std::vector<SSAVariable>& vars) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); }
- void SetParameterExprs(const std::vector<MediumLevelILInstruction>& params) { UpdateRawOperandAsExprList(1, params); }
- void SetParameterExprs(const std::vector<ExprId>& params) { UpdateRawOperandAsExprList(1, params); }
+ void SetOutputSSAVariables(const _STD_VECTOR<SSAVariable>& vars) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); }
+ void SetParameterExprs(const _STD_VECTOR<MediumLevelILInstruction>& params) { UpdateRawOperandAsExprList(1, params); }
+ void SetParameterExprs(const _STD_VECTOR<ExprId>& params) { UpdateRawOperandAsExprList(1, params); }
};
template <> struct MediumLevelILInstructionAccessor<MLIL_SYSCALL_UNTYPED_SSA>: public MediumLevelILInstructionBase
{
@@ -934,8 +946,8 @@ namespace BinaryNinja
MediumLevelILInstruction GetStackExpr() const { return GetRawOperandAsExpr(2); }
void SetDestMemoryVersion(size_t version) { GetRawOperandAsExpr(0).UpdateRawOperand(0, version); }
void SetSourceMemoryVersion(size_t version) { GetRawOperandAsExpr(1).UpdateRawOperand(0, version); }
- void SetOutputSSAVariables(const std::vector<SSAVariable>& vars) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); }
- void SetParameterSSAVariables(const std::vector<SSAVariable>& vars) { GetRawOperandAsExpr(1).UpdateRawOperandAsSSAVariableList(1, vars); }
+ void SetOutputSSAVariables(const _STD_VECTOR<SSAVariable>& vars) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); }
+ void SetParameterSSAVariables(const _STD_VECTOR<SSAVariable>& vars) { GetRawOperandAsExpr(1).UpdateRawOperandAsSSAVariableList(1, vars); }
};
template <> struct MediumLevelILInstructionAccessor<MLIL_TAILCALL_SSA>: public MediumLevelILInstructionBase
{
@@ -946,9 +958,9 @@ namespace BinaryNinja
size_t GetSourceMemoryVersion() const { return GetRawOperandAsIndex(4); }
void SetDestMemoryVersion(size_t version) { GetRawOperandAsExpr(0).UpdateRawOperand(0, version); }
void SetSourceMemoryVersion(size_t version) { UpdateRawOperand(4, version); }
- void SetOutputSSAVariables(const std::vector<SSAVariable>& vars) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); }
- void SetParameterExprs(const std::vector<MediumLevelILInstruction>& params) { UpdateRawOperandAsExprList(2, params); }
- void SetParameterExprs(const std::vector<ExprId>& params) { UpdateRawOperandAsExprList(2, params); }
+ void SetOutputSSAVariables(const _STD_VECTOR<SSAVariable>& vars) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); }
+ void SetParameterExprs(const _STD_VECTOR<MediumLevelILInstruction>& params) { UpdateRawOperandAsExprList(2, params); }
+ void SetParameterExprs(const _STD_VECTOR<ExprId>& params) { UpdateRawOperandAsExprList(2, params); }
};
template <> struct MediumLevelILInstructionAccessor<MLIL_TAILCALL_UNTYPED_SSA>: public MediumLevelILInstructionBase
{
@@ -960,14 +972,14 @@ namespace BinaryNinja
MediumLevelILInstruction GetStackExpr() const { return GetRawOperandAsExpr(3); }
void SetDestMemoryVersion(size_t version) { GetRawOperandAsExpr(0).UpdateRawOperand(0, version); }
void SetSourceMemoryVersion(size_t version) { GetRawOperandAsExpr(2).UpdateRawOperand(0, version); }
- void SetOutputSSAVariables(const std::vector<SSAVariable>& vars) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); }
- void SetParameterSSAVariables(const std::vector<SSAVariable>& vars) { GetRawOperandAsExpr(2).UpdateRawOperandAsSSAVariableList(1, vars); }
+ void SetOutputSSAVariables(const _STD_VECTOR<SSAVariable>& vars) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); }
+ void SetParameterSSAVariables(const _STD_VECTOR<SSAVariable>& vars) { GetRawOperandAsExpr(2).UpdateRawOperandAsSSAVariableList(1, vars); }
};
template <> struct MediumLevelILInstructionAccessor<MLIL_RET>: public MediumLevelILInstructionBase
{
MediumLevelILInstructionList GetSourceExprs() const { return GetRawOperandAsExprList(0); }
- void SetSourceExprs(const std::vector<ExprId>& exprs) { UpdateRawOperandAsExprList(0, exprs); }
+ void SetSourceExprs(const _STD_VECTOR<ExprId>& exprs) { UpdateRawOperandAsExprList(0, exprs); }
};
template <> struct MediumLevelILInstructionAccessor<MLIL_IF>: public MediumLevelILInstructionBase
@@ -992,7 +1004,7 @@ namespace BinaryNinja
MediumLevelILSSAVariableList GetOutputSSAVariables() const { return GetRawOperandAsSSAVariableList(0); }
uint32_t GetIntrinsic() const { return (uint32_t)GetRawOperandAsInteger(2); }
MediumLevelILInstructionList GetParameterExprs() const { return GetRawOperandAsExprList(3); }
- void SetOutputSSAVariables(const std::vector<SSAVariable>& vars) { UpdateRawOperandAsSSAVariableList(0, vars); }
+ void SetOutputSSAVariables(const _STD_VECTOR<SSAVariable>& vars) { UpdateRawOperandAsSSAVariableList(0, vars); }
};
template <> struct MediumLevelILInstructionAccessor<MLIL_FREE_VAR_SLOT>: public MediumLevelILInstructionBase
@@ -1108,4 +1120,9 @@ namespace BinaryNinja
template <> struct MediumLevelILInstructionAccessor<MLIL_FLOOR>: public MediumLevelILOneOperandInstruction {};
template <> struct MediumLevelILInstructionAccessor<MLIL_CEIL>: public MediumLevelILOneOperandInstruction {};
template <> struct MediumLevelILInstructionAccessor<MLIL_FTRUNC>: public MediumLevelILOneOperandInstruction {};
+
+#undef _STD_VECTOR
+#undef _STD_SET
+#undef _STD_UNORDERED_MAP
+#undef _STD_MAP
}