MCPcopy Create free account
hub / github.com/Tokeii0/VolatilityPro / run_command

Function run_command

volpro.py:23–41  ·  view source on GitHub ↗
(command, task_name, output_path, tasks)

Source from the content-addressed store, hash-verified

21 return remaining_tasks
22
23def run_command(command, task_name, output_path, tasks):
24 try:
25 result = subprocess.run(command, stdout=subprocess.PIPE, shell=True, timeout=60)
26 try:
27 output = result.stdout.decode("UTF-8", errors="ignore")
28 except:
29 output = result.stdout.decode("ISO-8859-1", errors="ignore")
30 if output is not None:
31 with open(os.path.join(output_path, f"{task_name}.txt"), "w") as f:
32 f.write(output)
33 else:
34 print("[-] No output for task {}".format(task_name))
35 remaining_tasks = get_remaining_tasks(output_path, tasks)
36 if len(remaining_tasks) > 0:
37 print(f"[*] {random_emoji()}尚未执行的任务:{','.join(remaining_tasks)}")
38 except subprocess.TimeoutExpired:
39 print(f"[-] {task_name} timed out after 60 seconds.")
40 except Exception as e:
41 print("[-] {} \n[-] Error while running command: {}".format(command, str(e)))
42
43def generate_markdown(tasks, output_path, tasklist, tasklist_help, task_filescanlist, task_filescanlist_help):
44 markdown = ""

Callers

nothing calls this directly

Calls 3

get_remaining_tasksFunction · 0.85
random_emojiFunction · 0.85
runMethod · 0.80

Tested by

no test coverage detected