summaryrefslogtreecommitdiff
path: root/binaryninjaapi.h
diff options
context:
space:
mode:
authorRyan Snyder <ryan@vector35.com>2025-01-24 17:57:26 -0500
committerRyan Snyder <ryan@vector35.com>2025-02-14 15:58:56 -0500
commitbcdc0d9b89605936a1cb6cf3ffaaece60d3c5777 (patch)
tree7286bd0963a49d9b90ddccf3a4b70b71c08e6ce5 /binaryninjaapi.h
parent071811547bded7cf570125a03bb12d0b7c56a5ac (diff)
uidf refactor
Diffstat (limited to 'binaryninjaapi.h')
-rw-r--r--binaryninjaapi.h40
1 files changed, 36 insertions, 4 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h
index 5ee30625..81c0c4a8 100644
--- a/binaryninjaapi.h
+++ b/binaryninjaapi.h
@@ -10632,7 +10632,7 @@ namespace BinaryNinja {
size_t count;
static PossibleValueSet FromAPIObject(BNPossibleValueSet& value);
- BNPossibleValueSet ToAPIObject();
+ BNPossibleValueSet ToAPIObject() const;
static void FreeAPIObject(BNPossibleValueSet* value);
};
@@ -11189,11 +11189,14 @@ namespace BinaryNinja {
Ref<FlowGraph> GetUnresolvedStackAdjustmentGraph();
- void SetUserVariableValue(const Variable& var, uint64_t defAddr, PossibleValueSet& value);
- void ClearUserVariableValue(const Variable& var, uint64_t defAddr);
- std::map<Variable, std::map<ArchAndAddr, PossibleValueSet>> GetAllUserVariableValues();
+ void SetUserVariableValue(const Variable& var, const ArchAndAddr& defAddr, PossibleValueSet& value, bool after = true);
+ void ClearUserVariableValue(const Variable& var, const ArchAndAddr& defAddr, bool after = true);
+ std::map<Variable, std::map<std::pair<ArchAndAddr, bool>, PossibleValueSet>> GetAllUserVariableValues();
void ClearAllUserVariableValues();
+ void CreateForcedVariableVersion(const Variable& var, const ArchAndAddr& location);
+ void ClearForcedVariableVersion(const Variable& var, const ArchAndAddr& location);
+
void RequestDebugReport(const std::string& name);
/*! Get the name for a given label ID
@@ -11803,6 +11806,9 @@ namespace BinaryNinja {
std::vector<SSARegisterStack> GetSSARegisterStacks();
std::vector<SSAFlag> GetSSAFlags();
+ size_t CachePossibleValueSet(const PossibleValueSet& pvs);
+ PossibleValueSet GetCachedPossibleValueSet(size_t idx);
+
ExprId AddExpr(BNLowLevelILOperation operation, size_t size, uint32_t flags, ExprId a = 0, ExprId b = 0,
ExprId c = 0, ExprId d = 0);
ExprId AddExprWithLocation(BNLowLevelILOperation operation, uint64_t addr, uint32_t sourceOperand, size_t size,
@@ -11891,6 +11897,12 @@ namespace BinaryNinja {
ExprId SetFlag(uint32_t flag, ExprId val, const ILSourceLocation& loc = ILSourceLocation());
ExprId SetFlagSSA(const SSAFlag& flag, ExprId val, const ILSourceLocation& loc = ILSourceLocation());
+ ExprId ForceVer(size_t size, uint32_t reg, const ILSourceLocation& loc = ILSourceLocation());
+ ExprId ForceVerSSA(size_t size, SSARegister dst, SSARegister src, const ILSourceLocation& loc = ILSourceLocation());
+
+ ExprId Assert(size_t size, uint32_t reg, const PossibleValueSet& pvs, const ILSourceLocation& loc = ILSourceLocation());
+ ExprId AssertSSA(size_t size, SSARegister reg, const PossibleValueSet& pvs, const ILSourceLocation& loc = ILSourceLocation());
+
/*! Reads \c size bytes from the expression \c addr
\param size Number of bytes to read
@@ -13187,6 +13199,9 @@ namespace BinaryNinja {
*/
BNMediumLevelILLabel* GetLabelForSourceInstruction(size_t i);
+ size_t CachePossibleValueSet(const PossibleValueSet& pvs);
+ PossibleValueSet GetCachedPossibleValueSet(size_t idx);
+
ExprId AddExpr(BNMediumLevelILOperation operation, size_t size, ExprId a = 0, ExprId b = 0, ExprId c = 0,
ExprId d = 0, ExprId e = 0);
ExprId AddExprWithLocation(BNMediumLevelILOperation operation, uint64_t addr, uint32_t sourceOperand,
@@ -13210,6 +13225,13 @@ namespace BinaryNinja {
const ILSourceLocation& loc = ILSourceLocation());
ExprId SetVarAliasedField(size_t size, const Variable& dest, size_t newMemVersion, size_t prevMemVersion,
uint64_t offset, ExprId src, const ILSourceLocation& loc = ILSourceLocation());
+
+ ExprId ForceVer(size_t size, const Variable& dest, const Variable& src, const ILSourceLocation& loc = ILSourceLocation());
+ ExprId ForceVerSSA(size_t size, const SSAVariable& dest, const SSAVariable& src, const ILSourceLocation& loc = ILSourceLocation());
+
+ ExprId Assert(size_t size, const Variable& src, const PossibleValueSet& pvs, const ILSourceLocation& loc = ILSourceLocation());
+ ExprId AssertSSA(size_t size, const SSAVariable& src, const PossibleValueSet& pvs, const ILSourceLocation& loc = ILSourceLocation());
+
ExprId Load(size_t size, ExprId src, const ILSourceLocation& loc = ILSourceLocation());
ExprId LoadStruct(size_t size, ExprId src, uint64_t offset, const ILSourceLocation& loc = ILSourceLocation());
ExprId LoadSSA(size_t size, ExprId src, size_t memVersion, const ILSourceLocation& loc = ILSourceLocation());
@@ -13557,6 +13579,9 @@ namespace BinaryNinja {
void SetRootExpr(ExprId expr);
void SetRootExpr(const HighLevelILInstruction& expr);
+ size_t CachePossibleValueSet(const PossibleValueSet& pvs);
+ PossibleValueSet GetCachedPossibleValueSet(size_t idx);
+
ExprId AddExpr(BNHighLevelILOperation operation, size_t size, ExprId a = 0, ExprId b = 0, ExprId c = 0,
ExprId d = 0, ExprId e = 0);
ExprId AddExprWithLocation(BNHighLevelILOperation operation, uint64_t addr, uint32_t sourceOperand, size_t size,
@@ -13601,6 +13626,13 @@ namespace BinaryNinja {
const ILSourceLocation& loc = ILSourceLocation());
ExprId AssignUnpackMemSSA(const std::vector<ExprId>& output, size_t destMemVersion, ExprId src,
size_t srcMemVersion, const ILSourceLocation& loc = ILSourceLocation());
+
+ ExprId ForceVer(size_t size, const Variable& dest, const Variable& src, const ILSourceLocation& loc = ILSourceLocation());
+ ExprId ForceVerSSA(size_t size, const SSAVariable& dest, const SSAVariable& src, const ILSourceLocation& loc = ILSourceLocation());
+
+ ExprId Assert(size_t size, const Variable& src, const PossibleValueSet& pvs, const ILSourceLocation& loc = ILSourceLocation());
+ ExprId AssertSSA(size_t size, const SSAVariable& src, const PossibleValueSet& pvs, const ILSourceLocation& loc = ILSourceLocation());
+
ExprId Var(size_t size, const Variable& src, const ILSourceLocation& loc = ILSourceLocation());
ExprId VarSSA(size_t size, const SSAVariable& src, const ILSourceLocation& loc = ILSourceLocation());
ExprId VarPhi(const SSAVariable& dest, const std::vector<SSAVariable>& sources,