From 4f1a9bafa9e1db8c7962a2c59321bd22964715b9 Mon Sep 17 00:00:00 2001 From: devttys0 <heffnercj@gmail.com> Date: Sun, 5 Apr 2015 01:45:51 -0400 Subject: [PATCH] Fixed jffs2valid.py Python3 bugs --- src/binwalk/plugins/jffs2valid.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/binwalk/plugins/jffs2valid.py b/src/binwalk/plugins/jffs2valid.py index 10374d1..e37cd58 100644 --- a/src/binwalk/plugins/jffs2valid.py +++ b/src/binwalk/plugins/jffs2valid.py @@ -13,8 +13,11 @@ class JFFS2ValidPlugin(binwalk.core.plugin.Plugin): MODULES = ['Signature'] def _check_crc(self, node_header): + # struct and binascii want a bytes object in Python3 + node_header = binwalk.core.compat.str2bytes(node_header) + # Get the header's reported CRC value - if node_header[0:2] == "\x19\x85": + if node_header[0:2] == b"\x19\x85": header_crc = struct.unpack(">I", node_header[8:12])[0] else: header_crc = struct.unpack("<I", node_header[8:12])[0] -- libgit2 0.26.0