From 5cff3bf3cc5aa11875569a6aeddf88ef867411f1 Mon Sep 17 00:00:00 2001 From: KyleMiles Date: Wed, 30 May 2018 15:41:10 -0400 Subject: Various Python 3 support changes --- python/binaryview.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'python/binaryview.py') diff --git a/python/binaryview.py b/python/binaryview.py index ac08ad76..b1bc4822 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -372,12 +372,12 @@ class BinaryViewType(with_metaclass(_BinaryViewTypeMetaclass, object)): @property def name(self): """BinaryView name (read-only)""" - return core.BNGetBinaryViewTypeName(self.handle).decode('utf8') + return core.BNGetBinaryViewTypeName(self.handle) @property def long_name(self): """BinaryView long name (read-only)""" - return core.BNGetBinaryViewTypeLongName(self.handle).decode('utf8') + return core.BNGetBinaryViewTypeLongName(self.handle) def __repr__(self): return "" % self.name @@ -423,6 +423,9 @@ class BinaryViewType(with_metaclass(_BinaryViewTypeMetaclass, object)): else: bv = cls[available.name].open(filename) + if bv is None: + raise Exception("Unknown Architecture/Architecture Not Found (check plugins folder)") + if update_analysis: bv.update_analysis_and_wait() return bv @@ -1740,7 +1743,7 @@ class BinaryView(object): \'\\xcf\\xfa\\xed\\xfe\' """ buf = databuffer.DataBuffer(handle=core.BNReadViewBuffer(self.handle, addr, length)) - return str(buf) + return bytes(buf) def write(self, addr, data): """ -- cgit v1.3.1