about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <serpilliere@users.noreply.github.com>2019-02-13 21:56:47 +0100
committerGitHub <noreply@github.com>2019-02-13 21:56:47 +0100
commit787817bd0428b6be475cea3e90b4413981579a5a (patch)
tree116f13d8eab28d5b07afd4dcba030000c28116a6
parenta4d9c5c598bb03215dc77ac7433934ed2e21b7fe (diff)
parent92cbd7774678749895b2bc8b5fd0214fa3c66ebc (diff)
downloadmiasm-787817bd0428b6be475cea3e90b4413981579a5a.tar.gz
miasm-787817bd0428b6be475cea3e90b4413981579a5a.zip
Merge pull request #973 from su-vikas/master
Fix for bin_stream_ida after change in shift_offset API
-rw-r--r--miasm2/core/bin_stream_ida.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/miasm2/core/bin_stream_ida.py b/miasm2/core/bin_stream_ida.py
index f63077bf..fcd89f9f 100644
--- a/miasm2/core/bin_stream_ida.py
+++ b/miasm2/core/bin_stream_ida.py
@@ -15,7 +15,7 @@ class bin_stream_ida(bin_stream_str):
     def _getbytes(self, start, l=1):
         o = ""
         for ad in xrange(l):
-            offset = ad + start - self.shift
+            offset = ad + start + self.base_address
             if not is_mapped(offset):
                 raise IOError("not enough bytes")
             o += chr(Byte(offset))
@@ -38,6 +38,6 @@ class bin_stream_ida(bin_stream_str):
         # Lazy version
         if hasattr(self, "_getlen"):
             return self._getlen
-        max_addr = SegEnd(list(Segments())[-1]  - (self.offset + self.shift))
+        max_addr = SegEnd(list(Segments())[-1]  - (self.offset - self.base_address))
         self._getlen = max_addr
         return max_addr