From 584e4d244a9124f6ec403162994434ff085e9c5d Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Thu, 19 Feb 2015 01:32:45 -0500 Subject: Add APIs for accessing function information --- binaryninjaapi.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'binaryninjaapi.h') 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 GetFunction() const; + Ref GetArchitecture() const; + + uint64_t GetStart() const; + uint64_t GetEnd() const; + uint64_t GetLength() const; + + std::vector GetInstructionSizes() const; + std::vector GetOutgoingEdges() const; + }; + + class Function: public RefCountObject + { + BNFunction* m_func; + + public: + Function(BNFunction* func); + ~Function(); + + BNFunction* GetFunctionObject() const { return m_func; } + + Ref GetArchitecture() const; + uint64_t GetStart() const; + + std::vector> GetBasicBlocks() const; + }; } -- cgit v1.3.1