diff --git a/.travis.yml b/.travis.yml index 25d1003..6bc7dd1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,9 +37,11 @@ install: - wget https://didierstevens.com/files/software/pdfid_v0_2_1.zip - unzip pdfid_v0_2_1.zip - python setup.py -q install - - pushd tests/src - - git clone https://github.com/ytisf/theZoo.git + - git clone https://github.com/Rafiot/theZoo.git + - pushd theZoo/malwares/Binaries + - python unpackall.py - popd + - mv theZoo/malwares/Binaries/out tests/src/ script: - coverage run setup.py test diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/bin/filecheck.py b/bin/filecheck.py index 711e0a8..2f53f04 100644 --- a/bin/filecheck.py +++ b/bin/filecheck.py @@ -52,14 +52,16 @@ class File(FileBase): super(File, self).__init__(src_path, dst_path) mimetype = magic.from_file(src_path, mime=True).decode("utf-8") - self.main_type, self.sub_type = mimetype.split('/') + try: + self.main_type, self.sub_type = mimetype.split('/') + except Exception as e: + # FIXME/TEMP: checking what happen, probably bad. + print(e, src_path, mimetype) + return a, self.extension = os.path.splitext(src_path) self.is_recursive = False self.log_details.update({'maintype': self.main_type, 'subtype': self.sub_type, 'extension': self.extension}) - # If the mimetype matches as text/*, it will be sent to LibreOffice, no need to cross check the mime/ext - if self.main_type == 'text': - return # Check correlation known extension => actual mime type if propertype.get(self.extension) is not None: