summaryrefslogtreecommitdiff
path: root/python/binaryview.py
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2021-10-06 10:46:04 -0400
committerPeter LaFosse <peter@vector35.com>2021-10-07 09:34:39 -0400
commit22b182fe9b91a8df273ab67d4d65270607595ffa (patch)
tree8dfe8dcc03ae9a7f39427db99dc5291c6c3a0be0 /python/binaryview.py
parentaf271c2ee7893cadb31a80715f1b35898b09b40c (diff)
Make TypedDataReader value return byte array for arrays of integers of size 1
Diffstat (limited to 'python/binaryview.py')
-rw-r--r--python/binaryview.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/python/binaryview.py b/python/binaryview.py
index 5104c4f2..da463655 100644
--- a/python/binaryview.py
+++ b/python/binaryview.py
@@ -40,7 +40,7 @@ import binaryninja
from . import _binaryninjacore as core
from .enums import (AnalysisState, SymbolType,
Endianness, ModificationStatus, StringType, SegmentFlag, SectionSemantics, FindFlag,
- TypeClass, BinaryViewEventType, FunctionGraphType, TagReferenceType, TagTypeType, StructureVariant,
+ TypeClass, BinaryViewEventType, FunctionGraphType, TagReferenceType, TagTypeType,
RegisterValueType)
from . import associateddatastore # required for _BinaryViewAssociatedDataStore
from .log import log_error, log_warn
@@ -8054,6 +8054,8 @@ class TypedDataReader:
result = []
if _type.element_type is None:
raise ValueError("Can not get value for Array type with no element type")
+ if _type.element_type.width == 1 and _type.element_type.type_class == TypeClass.IntegerTypeClass:
+ return bytes(self)
for offset in range(0, len(_type), _type.element_type.width):
result.append(TypedDataReader(_type.element_type, self.address + offset, self.view, self.endian).value)
return result