This commit is contained in:
Zeecka
2025-12-28 10:33:46 +01:00
parent 35bb0a5aea
commit d0c2f24800
3 changed files with 56 additions and 59 deletions
+5 -3
View File
@@ -3,6 +3,7 @@
import shutil
import subprocess
from pathlib import Path
from typing import Any
from .utils import MAX_PENDING_TIME, update_data
@@ -17,7 +18,7 @@ def analyze_binwalk(input_img: Path, output_dir: Path) -> None:
stderr = ""
# Run binwalk
data = subprocess.run(
["binwalk", "-e", "../" + str(image_name), "--run-as=root"],
["binwalk", "--matryoshka", "-e", "../" + str(image_name), "--run-as=root"],
cwd=output_dir,
capture_output=True,
text=True,
@@ -45,16 +46,17 @@ def analyze_binwalk(input_img: Path, output_dir: Path) -> None:
shutil.rmtree(extracted_dir)
if len(stderr) > 0:
err = {
err: dict[str, dict[str, Any]] = {
"binwalk": {
"status": "error",
"output": data.stdout.split("\n") if data else [],
"error": stderr,
}
}
update_data(output_dir, err)
return None
output_data = {
output_data: dict[str, dict[str, Any]] = {
"binwalk": {
"status": "ok",
"output": data.stdout.split("\n") if data else [],