예제 #1
0
파일: ui_history.py 프로젝트: jonnary/crmsh
 def _pe2shadow(self, f, argl):
     try:
         name = argl[0]
     except:
         name = os.path.basename(f).replace(".bz2", "")
     common_info("transition %s saved to shadow %s" % (f, name))
     return xmlutil.pe2shadow(f, name)
예제 #2
0
 def _pe2shadow(self, f, argl):
     try:
         name = argl[0]
     except:
         name = os.path.basename(f).replace(".bz2", "")
     common_info("transition %s saved to shadow %s" % (f, name))
     return xmlutil.pe2shadow(f, name)
예제 #3
0
파일: ui_cib.py 프로젝트: lge/crmsh
 def do_import(self, context, infile, name=None):
     "usage: import {<file>|<number>} [<shadow>]"
     if name and not utils.is_filename_sane(name):
         context.fatal_error("Bad filename: " + name)
     # where's the input?
     if not os.access(infile, os.F_OK):
         if "/" in infile:
             context.fatal_error(str(infile) + ": no such file")
         infile = self._find_pe(context, infile)
     if not name:
         name = os.path.basename(infile).replace(".bz2", "")
     if not xmlutil.pe2shadow(infile, name):
         context.fatal_error("Error copying PE file to shadow: %s -> %s" % (infile, name))
     # use the shadow and load the status from there
     return self.do_use(context, name, "withstatus")
예제 #4
0
 def do_import(self, context, infile, name=None):
     "usage: import {<file>|<number>} [<shadow>]"
     if name and not utils.is_filename_sane(name):
         context.fatal_error("Bad filename: " + name)
     # where's the input?
     if not os.access(infile, os.F_OK):
         if "/" in infile:
             context.fatal_error(str(infile) + ": no such file")
         infile = self._find_pe(context, infile)
     if not name:
         name = os.path.basename(infile).replace(".bz2", "")
     if not xmlutil.pe2shadow(infile, name):
         context.fatal_error("Error copying PE file to shadow: %s -> %s" % (infile, name))
     # use the shadow and load the status from there
     return self.do_use(context, name, "withstatus")