(output_dir)
| 1247 | |
| 1248 | |
| 1249 | def binary(output_dir): |
| 1250 | bin_dir = os.path.join(output_dir, "bin") |
| 1251 | if os.path.isdir(bin_dir): |
| 1252 | for filename in tqdm(os.listdir(bin_dir), desc="Binary test: "): |
| 1253 | # print("IN BIN") |
| 1254 | f = os.path.join(bin_dir, filename) |
| 1255 | # checking if it is a file |
| 1256 | if os.path.isfile(f): |
| 1257 | # print(f) |
| 1258 | file_path = f |
| 1259 | """Run binwalk in WSL silently and capture output.""" |
| 1260 | # wsl_file_path = file_path.replace("C:\\", "/mnt/c/").replace("\\", "/").lower() |
| 1261 | result = run_silent_command(f"binwalk {file_path}") |
| 1262 | |
| 1263 | if result: |
| 1264 | binary_dir = os.path.join(results_folder, "binary") |
| 1265 | os.makedirs(binary_dir, exist_ok=True) |
| 1266 | |
| 1267 | shutil.copy(file_path, f"{binary_dir}/{filename}") |
| 1268 | prYellow(f"Binwalk Output:\n {result}") |
| 1269 | |
| 1270 | prGreen("BINARY TEST DONE") |
| 1271 | |
| 1272 | |
| 1273 | def elf_check(output_dir): |
no test coverage detected