diff options
| author | Rusty Wagner <rusty@vector35.com> | 2016-04-10 03:36:44 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2016-04-10 03:41:54 -0400 |
| commit | d8408e56888de83a5befd74f3a43e614150f1edb (patch) | |
| tree | ee44ed93e68503071842406a84db51df700f1657 /binaryninjaapi.h | |
| parent | b505e0464383284e7ce8fefeffc18713488c2c48 (diff) | |
Show stack variables and implement naming, undo, and persistence
Diffstat (limited to 'binaryninjaapi.h')
| -rw-r--r-- | binaryninjaapi.h | 23 |
1 files changed, 22 insertions, 1 deletions
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> type; + std::string name; + int64_t offset; + bool autoDefined; + }; + + struct StackVariableReference + { + uint32_t sourceOperand; + Ref<Type> type; + std::string name; + int64_t startingOffset; + int64_t referencedOffset; + }; + class FunctionGraph; class Function: public CoreRefCountObject<BNFunction, BNNewFunctionReference, BNFreeFunction> @@ -1267,6 +1284,7 @@ namespace BinaryNinja BNRegisterValue GetRegisterValueAfterLowLevelILInstruction(size_t i, uint32_t reg); std::vector<uint32_t> GetRegistersReadByInstruction(Architecture* arch, uint64_t addr); std::vector<uint32_t> GetRegistersWrittenByInstruction(Architecture* arch, uint64_t addr); + std::vector<StackVariableReference> GetStackVariablesReferencedByInstruction(Architecture* arch, uint64_t addr); Ref<Type> GetType() const; void ApplyImportedTypes(Symbol* sym); @@ -1274,11 +1292,12 @@ namespace BinaryNinja Ref<FunctionGraph> CreateFunctionGraph(); - std::map<int64_t, NameAndType> GetStackLayout(); + std::map<int64_t, StackVariable> 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; |
