Commit 0b9f0d5b34cc15b4e2d4df6a4b05d324eef3f24d
1 parent
c2732388
Fixed bug in detecting MHT files.
Showing
1 changed file
with
5 additions
and
2 deletions
oletools/olevba.py
| ... | ... | @@ -2627,8 +2627,11 @@ class VBA_Parser(object): |
| 2627 | 2627 | # and even whitespaces in between "MIME", "-", "Version" and ":". The version number is ignored. |
| 2628 | 2628 | # And the line is case insensitive. |
| 2629 | 2629 | # so we'll just check the presence of mime, version and multipart anywhere: |
| 2630 | - if self.type is None and b'mime' in data_lowercase and b'version' in data_lowercase \ | |
| 2631 | - and b'multipart' in data_lowercase: | |
| 2630 | + if (self.type is None and | |
| 2631 | + b'mime' in data_lowercase and | |
| 2632 | + b'version' in data_lowercase and | |
| 2633 | + b'multipart' in data_lowercase and | |
| 2634 | + abs(data_lowercase.index(b'version') - data_lowercase.index(b'mime')) < 20): | |
| 2632 | 2635 | self.open_mht(data) |
| 2633 | 2636 | #TODO: handle exceptions |
| 2634 | 2637 | #TODO: Excel 2003 XML | ... | ... |