Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

Commit

Permalink
replace cuckoo.compat.magic by sflock.magic
Browse files Browse the repository at this point in the history
Since version 0.3.4 sflock features 64-bit Windows support for magic(5).
Now that we no longer need this compatibility layer (which was
equivalent to the one in sflock) we simply get rid of it.
It was required earlier because Cuckoo wasn't capable of requiring
updated libraries in the pre-Python package era.
  • Loading branch information
jbremer committed Jun 3, 2018
1 parent 1ff75d4 commit b843d14
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 15,112 deletions.
10 changes: 7 additions & 3 deletions cuckoo/common/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
import os
import pefile
import re
import sflock
import shutil
import tempfile
import zipfile

from cuckoo.common.whitelist import is_whitelisted_domain
from cuckoo.compat import magic

try:
import pydeep
Expand Down Expand Up @@ -224,13 +224,17 @@ def get_type(self):
"""Get MIME file type.
@return: file type.
"""
return magic.from_file(os.path.realpath(self.file_path))
return sflock.magic.from_file(
os.path.realpath(self.file_path)
)

def get_content_type(self):
"""Get MIME content file type (example: image/jpeg).
@return: file content type.
"""
return magic.from_file(os.path.realpath(self.file_path), mime=True)
return sflock.magic.from_file(
os.path.realpath(self.file_path), mime=True
)

def get_exported_functions(self):
"""Get the exported function names of this PE file."""
Expand Down
62 changes: 0 additions & 62 deletions cuckoo/compat/magic.py

This file was deleted.

Loading

0 comments on commit b843d14

Please sign in to comment.