Skip to content

Commit

Permalink
Added size check for arcadyan decryptor
Browse files Browse the repository at this point in the history
  • Loading branch information
devttys0 committed Aug 11, 2020
1 parent c58d9e1 commit 5e0d7cf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/binwalk/plugins/arcadyan.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ def extractor(self, fname):
fname = os.path.abspath(fname)

infile = binwalk.core.common.BlockFile(fname, "rb")
obfuscated = infile.read()
obfuscated = infile.read(self.MIN_FILE_SIZE)
infile.close()

if os.path.getsize(fname) > self.MAX_IMAGE_SIZE:
raise Exception("Input file too large for Arcadyan obfuscated firmware")

if len(obfuscated) >= self.MIN_FILE_SIZE:
# Swap blocks 1 and 2
p1 = obfuscated[self.P1_START:self.P1_END]
Expand Down

0 comments on commit 5e0d7cf

Please sign in to comment.