From 05b8dae707da62437abf262fe8d1dd2b74a5f98f Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Wed, 6 Jul 2016 22:58:22 -0400 Subject: Add API to get disassembly text for a basic block outside of a graph --- binaryninjaapi.h | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) (limited to 'binaryninjaapi.h') diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 3f0b1f4b..9e8f516c 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -1380,6 +1380,28 @@ namespace BinaryNinja void AddMemberWithValue(const std::string& name, uint64_t value); }; + class DisassemblySettings: public CoreRefCountObject + { + public: + DisassemblySettings(); + DisassemblySettings(BNDisassemblySettings* settings); + + bool IsOptionSet(BNDisassemblyOption option) const; + void SetOption(BNDisassemblyOption option, bool state = true); + + size_t GetWidth() const; + void SetWidth(size_t width); + size_t GetMaximumSymbolWidth() const; + void SetMaximumSymbolWidth(size_t width); + }; + + struct DisassemblyTextLine + { + uint64_t addr; + std::vector tokens; + }; + class Function; struct BasicBlockEdge @@ -1407,6 +1429,8 @@ namespace BinaryNinja void MarkRecentUse(); std::vector> GetAnnotations(); + + std::vector GetDisassemblyText(DisassemblySettings* settings); }; struct StackVariable @@ -1527,12 +1551,6 @@ namespace BinaryNinja std::vector> GetBlockAnnotations(Architecture* arch, uint64_t addr); }; - struct FunctionGraphTextLine - { - uint64_t addr; - std::vector tokens; - }; - struct FunctionGraphEdge { BNBranchType type; @@ -1555,7 +1573,7 @@ namespace BinaryNinja int GetWidth() const; int GetHeight() const; - std::vector GetLines() const; + std::vector GetLines() const; std::vector GetOutgoingEdges() const; }; @@ -1578,8 +1596,7 @@ namespace BinaryNinja int GetVerticalBlockMargin() const; void SetBlockMargins(int horiz, int vert); - size_t GetMaximumSymbolWidth() const; - void SetMaximumSymbolWidth(size_t width); + Ref GetSettings(); void StartLayout(BNFunctionGraphType = NormalFunctionGraph); bool IsLayoutComplete(); @@ -1592,8 +1609,8 @@ namespace BinaryNinja int GetHeight() const; std::vector> GetBlocksInRegion(int left, int top, int right, int bottom); - bool IsOptionSet(BNFunctionGraphOption option) const; - void SetOption(BNFunctionGraphOption option, bool state = true); + bool IsOptionSet(BNDisassemblyOption option) const; + void SetOption(BNDisassemblyOption option, bool state = true); }; struct LowLevelILLabel: public BNLowLevelILLabel -- cgit v1.3.1