Skip to content

Commit

Permalink
Fixed error logging for no magic
Browse files Browse the repository at this point in the history
  • Loading branch information
nex committed Mar 15, 2012
1 parent 71039a6 commit 73a68d7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cuckoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from cuckoo.common.constants import *
from cuckoo.core.db import CuckooDatabase
from cuckoo.core.getpackage import get_package
from cuckoo.common.getfiletype import get_file_type, IS_MAGIC
from cuckoo.common.getfiletype import get_file_type
from cuckoo.common.crash import crash

# Check the virtualization engine from the config fle and tries to retrieve
Expand Down Expand Up @@ -341,6 +341,15 @@ def run(self):
# the correct one depending on the file type of the target.
if self.task["package"] is None:
file_type = get_file_type(self.task["target"])

if not file_type:
log.error("You didn't specify an analysis package and I was " \
"not able to automatically detect it, therefore the " \
"analysis cannot be initiated. Abort.")
self.db.complete(self.task["id"], False)
self._processing(None, CUCKOO_ERROR_NO_MAGIC)
return False

package = get_package(file_type)
current_extension = os.path.splitext(self.dst_filename)[1].lower()

Expand Down

0 comments on commit 73a68d7

Please sign in to comment.