本文整理汇总了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()