Commit 4e7d4aa7 by devttys0

Added python3 compatibility string conversion to ubivalid.py plugin

parent e3d1a55c
import struct import struct
import binascii import binascii
import binwalk.core.plugin import binwalk.core.plugin
import binwalk.core.compat
class UBIValidPlugin(binwalk.core.plugin.Plugin): class UBIValidPlugin(binwalk.core.plugin.Plugin):
''' '''
...@@ -56,7 +56,7 @@ class UBIValidPlugin(binwalk.core.plugin.Plugin): ...@@ -56,7 +56,7 @@ class UBIValidPlugin(binwalk.core.plugin.Plugin):
# Seek to and read the suspected UBI erase count header # Seek to and read the suspected UBI erase count header
fd = self.module.config.open_file(result.file.name, offset=result.offset) fd = self.module.config.open_file(result.file.name, offset=result.offset)
ec_header = fd.read(1024) ec_header = binwalk.core.compat.str2bytes(fd.read(1024))
fd.close() fd.close()
result.valid = self._check_crc(ec_header[0:64]) result.valid = self._check_crc(ec_header[0:64])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment