From d8408e56888de83a5befd74f3a43e614150f1edb Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Sun, 10 Apr 2016 03:36:44 -0400 Subject: Show stack variables and implement naming, undo, and persistence --- binaryninjaapi.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'binaryninjaapi.h') diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 6ddeaa17..705235fc 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -1235,6 +1235,23 @@ namespace BinaryNinja void MarkRecentUse(); }; + struct StackVariable + { + Ref type; + std::string name; + int64_t offset; + bool autoDefined; + }; + + struct StackVariableReference + { + uint32_t sourceOperand; + Ref type; + std::string name; + int64_t startingOffset; + int64_t referencedOffset; + }; + class FunctionGraph; class Function: public CoreRefCountObject @@ -1267,6 +1284,7 @@ namespace BinaryNinja BNRegisterValue GetRegisterValueAfterLowLevelILInstruction(size_t i, uint32_t reg); std::vector GetRegistersReadByInstruction(Architecture* arch, uint64_t addr); std::vector GetRegistersWrittenByInstruction(Architecture* arch, uint64_t addr); + std::vector GetStackVariablesReferencedByInstruction(Architecture* arch, uint64_t addr); Ref GetType() const; void ApplyImportedTypes(Symbol* sym); @@ -1274,11 +1292,12 @@ namespace BinaryNinja Ref CreateFunctionGraph(); - std::map GetStackLayout(); + std::map GetStackLayout(); void CreateAutoStackVariable(int64_t offset, Type* type, const std::string& name); void CreateUserStackVariable(int64_t offset, Type* type, const std::string& name); void DeleteAutoStackVariable(int64_t offset); void DeleteUserStackVariable(int64_t offset); + bool GetStackVariableAtFrameOffset(int64_t offset, StackVariable& var); }; struct FunctionGraphTextLine @@ -1437,6 +1456,8 @@ namespace BinaryNinja ExprId If(ExprId operand, BNLowLevelILLabel& t, BNLowLevelILLabel& f); void MarkLabel(BNLowLevelILLabel& label); + ExprId Operand(uint32_t n, ExprId expr); + BNLowLevelILInstruction operator[](size_t i) const; size_t GetIndexForInstruction(size_t i) const; size_t GetInstructionCount() const; -- cgit v1.3.1