modules.packages.exe

Package modules :: Package packages :: Module exe |
[hide private]
[frames] | no frames]

# Source Code for Module modules.packages.exe

     1  # Copyright (C) 2010-2013 Claudio Guarnieri.
     2  # Copyright (C) 2014-2016 Cuckoo Foundation.
     3  # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
     4  # See the file 'docs/LICENSE' for copying permission.
     5
     6  import os
     7  import shlex
     8
     9  from lib.common.abstracts import Package
    10
    11 -class Exe(Package):
    12      """EXE analysis package."""
    13
    14 -    def start(self, path):
    15          args = self.options.get("arguments", "")
    16
    17          name, ext = os.path.splitext(path)
    18          if not ext:
    19              new_path = name + ".exe"
    20              os.rename(path, new_path)
    21              path = new_path
    22
    23          return self.execute(path, args=shlex.split(args))
    24