Skip to content

Commit

Permalink
#470 fix hash computation for files
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromeleonard committed May 10, 2019
1 parent 83d7754 commit 41eaa84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion analyzers/Malwares/malwares.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def run(self):
None)
if hashes is None:
filepath = self.get_param('file', None, 'File is missing')
hash = hashlib.sha256(open(filepath, 'r').read()).hexdigest();
hash = hashlib.sha256(open(filepath, 'rb').read()).hexdigest();
else:
# find SHA256 hash
hash = next(h for h in hashes if len(h) == 64)
Expand Down

0 comments on commit 41eaa84

Please sign in to comment.