summaryrefslogtreecommitdiff
path: root/python/binaryview.py
diff options
context:
space:
mode:
authorKyleMiles <krm504@nyu.edu>2018-05-30 15:41:10 -0400
committerRyan Snyder <ryan@vector35.com>2018-07-10 18:11:09 -0400
commit5cff3bf3cc5aa11875569a6aeddf88ef867411f1 (patch)
tree95d57658dae88fef66196cf8c8ac52e771d73f3d /python/binaryview.py
parent1c03ac08aa94f5bedf21ec8f48ee1ec998e0e50c (diff)
Various Python 3 support changes
Diffstat (limited to 'python/binaryview.py')
-rw-r--r--python/binaryview.py9
1 files changed, 6 insertions, 3 deletions
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 "<view type: '%s'>" % 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):
"""