Commit e4a5254d by heffnercj

Extraction now works in python3

parent e3d190b1
...@@ -441,7 +441,7 @@ class Extractor: ...@@ -441,7 +441,7 @@ class Extractor:
while total_size < size: while total_size < size:
(data, dlen) = fdin.read_block() (data, dlen) = fdin.read_block()
fdout.write(data[:dlen]) fdout.write(str2bytes(data[:dlen]))
total_size += dlen total_size += dlen
# Cleanup # Cleanup
......
import os import os
import shutil import shutil
from binwalk.compat import *
from binwalk.common import BlockFile from binwalk.common import BlockFile
class Plugin: class Plugin:
...@@ -39,9 +40,11 @@ class Plugin: ...@@ -39,9 +40,11 @@ class Plugin:
(data, dlen) = fp_in.read_block() (data, dlen) = fp_in.read_block()
if i == 0: if i == 0:
fp_out.write(data[0:5] + self.FAKE_LZMA_SIZE + data[5:]) out_data = data[0:5] + self.FAKE_LZMA_SIZE + data[5:]
else: else:
fp_out.write(data) out_data = data
fp_out.write(str2bytes(out_data))
i += dlen i += dlen
......
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