本文整理匯總了Python中utilities.Logger.Logger.busy方法的典型用法代碼示例。如果您正苦於以下問題:Python Logger.busy方法的具體用法?Python Logger.busy怎麽用?Python Logger.busy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類utilities.Logger.Logger
的用法示例。
在下文中一共展示了Logger.busy方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: divide_by_signal
# 需要導入模塊: from utilities.Logger import Logger [as 別名]
# 或者: from utilities.Logger.Logger import busy [as 別名]
def divide_by_signal(self, confirmation_loops=0, function=shutil.copyfile):
if self.output_dir is not None and not os.path.exists(self.output_dir):
os.mkdir(self.output_dir)
ex = Executer(self.config)
for path, _, files in os.walk(self.search_dir):
for filename in files:
if filename.endswith(self.config.run_extension):
continue
filepath = os.path.join( path, filename )
command = self.config.get_command_line(self.binary_to_use, filepath)
Logger.debug("Executing:", command, debug_level=4)
Logger.busy()
signal = ex.get_signal_for_run(command, env=self.config.env)
while confirmation_loops > 0:
Logger.busy()
new_signal = ex.get_signal_for_run(command, env=self.config.env)
if new_signal == signal:
signal = new_signal
confirmation_loops -= 1
else:
Logger.info("Detected varying return codes for exactly the same run")
signal = SignalFinder.VARYING_SIGNAL
break
Logger.debug("We consider signal %i for input file %s" % (signal, filename), debug_level=5)
destination_dir = self.get_folder_path_for_signal(signal)
if not os.path.exists(destination_dir):
os.mkdir(destination_dir)
function(filepath, os.path.join(destination_dir, filename))
示例2: get_crash_eip
# 需要導入模塊: from utilities.Logger import Logger [as 別名]
# 或者: from utilities.Logger.Logger import busy [as 別名]
def get_crash_eip(self, cmd):
eip = None
Logger.busy()
gdb_output = self.executer.get_output_for_run(cmd, self.executer.pipe, self.config.run_timeout_tmin, env=self.config.env, stderr=self.executer.pipe)
#Logger.debug("GDB output:", gdb_output)
m = self.regular_expr.search(gdb_output)
if m:
eip = m.group(1)
eip = int(eip, 16)
#if not signal == SignalFinder.TIMEOUT_SIGNAL:
# Logger.error("Minimizing this file took too long, aborted")
return eip
示例3: minimize_testcases
# 需要導入模塊: from utilities.Logger import Logger [as 別名]
# 或者: from utilities.Logger.Logger import busy [as 別名]
def minimize_testcases(self):
if self.output_dir is not None and not os.path.exists(self.output_dir):
os.mkdir(self.output_dir)
executer = Executer(self.config)
for path, _, files in os.walk(self.search_dir):
for filename in files:
if filename.endswith(self.config.run_extension):
continue
Logger.info("Minimizing", filename)
filepath = os.path.join(path, filename)
cmd = self.config.get_afl_tmin_command_line(filepath, os.path.join(self.output_dir, filename))
Logger.debug("Executing:", cmd)
Logger.busy()
signal = executer.run_command(cmd, timeout=self.config.run_timeout_tmin, env=self.config.env)
if signal == SignalFinder.TIMEOUT_SIGNAL:
Logger.error("Minimizing this file took too long, aborted")
示例4: _combined_stdout_stderr
# 需要導入模塊: from utilities.Logger import Logger [as 別名]
# 或者: from utilities.Logger.Logger import busy [as 別名]
def _combined_stdout_stderr(self, binary, gdb_run, hint):
executer = Executer(self.config)
for path, _, files in os.walk(self.search_dir):
for filename in files:
if filename.endswith(self.config.run_extension):
continue
filepath = os.path.join(path, filename)
if gdb_run:
command = self.config.get_gdb_command_line(binary, filepath)
new_filename = filename+"-"+os.path.basename(binary)+hint+self.config.gdb_prefix
else:
command = self.config.get_command_line(binary, filepath)
new_filename = filename+"-"+os.path.basename(binary)+hint
Logger.debug("Looking for stdout/stderr output:", command, debug_level=4)
if self.output_dir:
output_file_name = get_new_output_file_name(self.output_dir, new_filename, self.config.run_extension, self.config.max_digets)
new_filepath = os.path.join(self.output_dir, output_file_name)
else:
output_file_name = get_new_output_file_name(path, new_filename, self.config.run_extension, self.config.max_digets)
new_filepath = os.path.join(path, output_file_name)
fp = file(new_filepath, "w")
Logger.busy()
executer.run_command(command, env=self.config.env, stdout=fp, stderr=fp)
fp.close()