From 49f6de04c7106e6ab8ce31fac6299f372a665698 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Tue, 26 Feb 2019 23:09:38 -0500 Subject: Fix some flow graph and disassembly API issues --- python/flowgraph.py | 9 ++++++++- python/function.py | 5 +++-- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'python') diff --git a/python/flowgraph.py b/python/flowgraph.py index 103eed69..4d2bd3ba 100644 --- a/python/flowgraph.py +++ b/python/flowgraph.py @@ -78,7 +78,7 @@ class FlowGraphNode(object): @property def basic_block(self): - """Basic block associated with this part of the flow graph (read-only)""" + """Basic block associated with this part of the flow graph""" block = core.BNGetFlowGraphBasicBlock(self.handle) if not block: return None @@ -100,6 +100,13 @@ class FlowGraphNode(object): block = basicblock.BasicBlock(block, view) return block + @basic_block.setter + def basic_block(self, block): + if block is None: + core.BNSetFlowGraphBasicBlock(self.handle, None) + else: + core.BNSetFlowGraphBasicBlock(self.handle, block.handle) + @property def x(self): """Flow graph block X (read-only)""" diff --git a/python/function.py b/python/function.py index 7471d639..065211c9 100644 --- a/python/function.py +++ b/python/function.py @@ -1905,11 +1905,12 @@ class DisassemblyTextRenderer(object): def basic_block(self, block): if block is not None: core.BNSetDisassemblyTextRendererBasicBlock(self.handle, block.handle) - core.BNSetDisassemblyTextRendererBasicBlock(self.handle, None) + else: + core.BNSetDisassemblyTextRendererBasicBlock(self.handle, None) @property def arch(self): - return binaryninja.architecture.Architecture(handle = core.BNSetDisassemblyTextRendererArchitecture(self.handle)) + return binaryninja.architecture.CoreArchitecture(handle = core.BNGetDisassemblyTextRendererArchitecture(self.handle)) @arch.setter def arch(self, arch): -- cgit v1.3.1