about summary refs log tree commit diff stats
path: root/example/test_ida.py
diff options
context:
space:
mode:
authorserpilliere <devnull@localhost>2014-06-26 12:02:51 +0200
committerserpilliere <devnull@localhost>2014-06-26 12:02:51 +0200
commit737b983e39f2924c7736536e4060a92f88d7c7de (patch)
tree28eadae280ce6161a653253dba60e794765ee7d8 /example/test_ida.py
parentb22dcfbca8ee132d5a9fe46d7050330afe68af16 (diff)
downloadmiasm-737b983e39f2924c7736536e4060a92f88d7c7de.tar.gz
miasm-737b983e39f2924c7736536e4060a92f88d7c7de.zip
test_ida: fix getbytes with databases using address > 7FFFFFFF
Diffstat (limited to 'example/test_ida.py')
-rw-r--r--example/test_ida.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/example/test_ida.py b/example/test_ida.py
index 2873827c..af5727d0 100644
--- a/example/test_ida.py
+++ b/example/test_ida.py
@@ -19,10 +19,12 @@ import idautils
 class bin_stream_ida(bin_stream_str):
     # ida should provide Byte function
 
+    # dont generate xrange using address computation:
+    # it can raise error on overflow 7FFFFFFF with 32 bit python
     def getbytes(self, start, l=1):
         o = ""
-        for ad in xrange(start - self.shift, start - self.shift + l):
-            o += chr(Byte(ad))
+        for ad in xrange(l):
+            o += chr(Byte(ad + start - self.shift))
         return o
 
     def readbs(self, l=1):