summaryrefslogtreecommitdiff
path: root/python/examples
diff options
context:
space:
mode:
authorXusheng <xusheng@vector35.com>2023-03-06 19:37:50 +0800
committerXusheng <xusheng@vector35.com>2023-03-06 19:37:50 +0800
commit3679217a17675ca326edc91e2aee658168351d55 (patch)
tree66ba670c52c8d949194ecec24c4abe26c02f96a5 /python/examples
parentb62dd911b325e637d48bcb2098766510955c1599 (diff)
Print the content of the strings in a more straightforward way
Diffstat (limited to 'python/examples')
-rw-r--r--python/examples/bin_info.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/python/examples/bin_info.py b/python/examples/bin_info.py
index e1b61dab..8d43a999 100644
--- a/python/examples/bin_info.py
+++ b/python/examples/bin_info.py
@@ -61,11 +61,7 @@ def get_bininfo(bv):
for i in range(min(10, len(bv.strings))):
start = bv.strings[i].start
length = bv.strings[i].length
- string = bv.read(start, length)
- try:
- string = string.decode('utf8')
- except UnicodeDecodeError:
- pass
+ string = bv.strings[i].value
contents += "| 0x%x |%d | %s |\n" % (start, length, string)
return contents