about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <serpilliere@users.noreply.github.com>2019-10-18 06:48:11 +0200
committerGitHub <noreply@github.com>2019-10-18 06:48:11 +0200
commit6f64398196203ce0bc835585d1514545b0106323 (patch)
treeb34b27f5a5cd15189f22f1dfd9740701c7325cc4
parent9a3e1694c579961f4b102b03d1d17ab2cabb6505 (diff)
parent0fdfb66da47b905b07bdf1787e410ae94f76a2e8 (diff)
downloadmiasm-6f64398196203ce0bc835585d1514545b0106323.tar.gz
miasm-6f64398196203ce0bc835585d1514545b0106323.zip
Merge pull request #1078 from serpilliere/fix_bytes_handling
Fix python2/python3 bytes manipulation
-rw-r--r--miasm/loader/pe_init.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/miasm/loader/pe_init.py b/miasm/loader/pe_init.py
index 2d7e3fa1..74192849 100644
--- a/miasm/loader/pe_init.py
+++ b/miasm/loader/pe_init.py
@@ -161,7 +161,7 @@ def compute_crc(raw, olds):
     out = 0
     data = raw[:]
     if len(raw) % 2:
-        end = struct.unpack('B', data[-1])[0]
+        end = struct.unpack('B', data[-1:])[0]
         data = data[:-1]
     if (len(raw) & ~0x1) % 4:
         out += struct.unpack('H', data[:2])[0]