diff options
| author | Rusty Wagner <rusty@vector35.com> | 2015-02-19 01:32:45 -0500 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2015-02-19 01:32:45 -0500 |
| commit | 584e4d244a9124f6ec403162994434ff085e9c5d (patch) | |
| tree | 1df2fd7d9f6f38f3217b596772c2866b2e12d606 /binaryninjaapi.h | |
| parent | 3f36f01667138e248d030701b9c0c047c1c7f5d7 (diff) | |
Add APIs for accessing function information
Diffstat (limited to 'binaryninjaapi.h')
| -rw-r--r-- | binaryninjaapi.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 331fa1fb..891dcda0 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -611,4 +611,41 @@ namespace BinaryNinja CoreArchitecture(BNArchitecture* arch); virtual bool GetInstructionInfo(BinaryView* view, uint64_t addr, InstructionInfo& result) override; }; + + class Function; + + class BasicBlock: public RefCountObject + { + BNBasicBlock* m_block; + + public: + BasicBlock(BNBasicBlock* block); + ~BasicBlock(); + + Ref<Function> GetFunction() const; + Ref<Architecture> GetArchitecture() const; + + uint64_t GetStart() const; + uint64_t GetEnd() const; + uint64_t GetLength() const; + + std::vector<uint8_t> GetInstructionSizes() const; + std::vector<BNBasicBlockEdge> GetOutgoingEdges() const; + }; + + class Function: public RefCountObject + { + BNFunction* m_func; + + public: + Function(BNFunction* func); + ~Function(); + + BNFunction* GetFunctionObject() const { return m_func; } + + Ref<Architecture> GetArchitecture() const; + uint64_t GetStart() const; + + std::vector<Ref<BasicBlock>> GetBasicBlocks() const; + }; } |
