fix mypy
This commit is contained in:
@@ -11,8 +11,8 @@ from .base_analyzer import SubprocessAnalyzer
|
|||||||
class BinwalkAnalyzer(SubprocessAnalyzer):
|
class BinwalkAnalyzer(SubprocessAnalyzer):
|
||||||
"""Analyzer for binwalk."""
|
"""Analyzer for binwalk."""
|
||||||
|
|
||||||
def __init__(self, *args) -> None:
|
def __init__(self, input_img, output_dir) -> None:
|
||||||
super().__init__("binwalk", *args, has_archive=True)
|
super().__init__("binwalk", input_img, output_dir, has_archive=True)
|
||||||
self.cmd = ["binwalk", "--matryoshka", "-e", self.img, "--run-as=root"]
|
self.cmd = ["binwalk", "--matryoshka", "-e", self.img, "--run-as=root"]
|
||||||
self.make_folder = False # Binwalk already create its own folder
|
self.make_folder = False # Binwalk already create its own folder
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ from .base_analyzer import SubprocessAnalyzer
|
|||||||
class DecomposerAnalyzer(SubprocessAnalyzer):
|
class DecomposerAnalyzer(SubprocessAnalyzer):
|
||||||
"""Analyzer for bits decomposer."""
|
"""Analyzer for bits decomposer."""
|
||||||
|
|
||||||
def __init__(self, *args: Any) -> None:
|
def __init__(self, input_img, output_dir: Any) -> None:
|
||||||
super().__init__("decomposer", *args)
|
super().__init__("decomposer", input_img, output_dir)
|
||||||
|
|
||||||
def get_results(self, _: Optional[str] = None) -> dict[str, Any]:
|
def get_results(self, _: Optional[str] = None) -> dict[str, Any]:
|
||||||
"""Analyze an image submission using bits decomposition."""
|
"""Analyze an image submission using bits decomposition."""
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ from .base_analyzer import SubprocessAnalyzer
|
|||||||
class ExiftoolAnalyzer(SubprocessAnalyzer):
|
class ExiftoolAnalyzer(SubprocessAnalyzer):
|
||||||
"""Analyzer for exiftool."""
|
"""Analyzer for exiftool."""
|
||||||
|
|
||||||
def __init__(self, *args: Any) -> None:
|
def __init__(self, input_img, output_dir: Any) -> None:
|
||||||
super().__init__("exiftool", *args)
|
super().__init__("exiftool", input_img, output_dir)
|
||||||
self.cmd = ["exiftool", "-a", "-u", "-g1", self.img]
|
self.cmd = ["exiftool", "-a", "-u", "-g1", self.img]
|
||||||
|
|
||||||
def process_output(self, stdout: str, stderr: str) -> dict[str, str]:
|
def process_output(self, stdout: str, stderr: str) -> dict[str, str]:
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ from .base_analyzer import SubprocessAnalyzer
|
|||||||
class ForemostAnalyzer(SubprocessAnalyzer):
|
class ForemostAnalyzer(SubprocessAnalyzer):
|
||||||
"""Analyzer for foremost."""
|
"""Analyzer for foremost."""
|
||||||
|
|
||||||
def __init__(self, *args: Any) -> None:
|
def __init__(self, input_img, output_dir: Any) -> None:
|
||||||
super().__init__("foremost", *args, has_archive=True)
|
super().__init__("foremost", input_img, output_dir, has_archive=True)
|
||||||
self.cmd = ["foremost", "-o", str(self.get_extracted_dir()), "-i", self.img]
|
self.cmd = ["foremost", "-o", str(self.get_extracted_dir()), "-i", self.img]
|
||||||
|
|
||||||
def is_error(self, returncode: int, stdout: str, stderr: str, zip_exist: bool) -> bool:
|
def is_error(self, returncode: int, stdout: str, stderr: str, zip_exist: bool) -> bool:
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ class ResizeAnalyzer(SubprocessAnalyzer):
|
|||||||
|
|
||||||
png: PNG
|
png: PNG
|
||||||
|
|
||||||
def __init__(self, *args: Any) -> None:
|
def __init__(self, input_img, output_dir: Any) -> None:
|
||||||
super().__init__("image_resize", *args, has_archive=True)
|
super().__init__("image_resize", input_img, output_dir, has_archive=True)
|
||||||
|
|
||||||
def _lookup_crc(self) -> List[PNG]:
|
def _lookup_crc(self) -> List[PNG]:
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ from .base_analyzer import SubprocessAnalyzer
|
|||||||
class OpenStegoAnalyzer(SubprocessAnalyzer):
|
class OpenStegoAnalyzer(SubprocessAnalyzer):
|
||||||
"""Analyzer for openstego."""
|
"""Analyzer for openstego."""
|
||||||
|
|
||||||
def __init__(self, *args: Any) -> None:
|
def __init__(self, input_img, output_dir: Any) -> None:
|
||||||
super().__init__("openstego", *args, has_archive=True)
|
super().__init__("openstego", input_img, output_dir, has_archive=True)
|
||||||
self.algo = 0
|
self.algo = 0
|
||||||
|
|
||||||
def build_cmd(self, password: Optional[str] = None) -> list[str]:
|
def build_cmd(self, password: Optional[str] = None) -> list[str]:
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ from .base_analyzer import SubprocessAnalyzer
|
|||||||
class OutguessAnalyzer(SubprocessAnalyzer):
|
class OutguessAnalyzer(SubprocessAnalyzer):
|
||||||
"""Analyzer for outguess."""
|
"""Analyzer for outguess."""
|
||||||
|
|
||||||
def __init__(self, *args: Any) -> None:
|
def __init__(self, input_img, output_dir: Any) -> None:
|
||||||
super().__init__("outguess", *args, has_archive=True)
|
super().__init__("outguess", input_img, output_dir, has_archive=True)
|
||||||
|
|
||||||
def build_cmd(self, password: Optional[str] = None) -> list[str]:
|
def build_cmd(self, password: Optional[str] = None) -> list[str]:
|
||||||
extracted_dir = self.get_extracted_dir()
|
extracted_dir = self.get_extracted_dir()
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ from .base_analyzer import SubprocessAnalyzer
|
|||||||
class PngcheckAnalyzer(SubprocessAnalyzer):
|
class PngcheckAnalyzer(SubprocessAnalyzer):
|
||||||
"""Analyzer for pngcheck."""
|
"""Analyzer for pngcheck."""
|
||||||
|
|
||||||
def __init__(self, *args: Any) -> None:
|
def __init__(self, input_img, output_dir: Any) -> None:
|
||||||
super().__init__("pngcheck", *args)
|
super().__init__("pngcheck", input_img, output_dir)
|
||||||
self.cmd = ["pngcheck", "-v", self.img]
|
self.cmd = ["pngcheck", "-v", self.img]
|
||||||
|
|
||||||
def is_error(self, returncode: int, stdout: str, stderr: str, zip_exist: bool) -> bool:
|
def is_error(self, returncode: int, stdout: str, stderr: str, zip_exist: bool) -> bool:
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ from .base_analyzer import SubprocessAnalyzer
|
|||||||
class SteghideAnalyzer(SubprocessAnalyzer):
|
class SteghideAnalyzer(SubprocessAnalyzer):
|
||||||
"""Analyzer for steghide."""
|
"""Analyzer for steghide."""
|
||||||
|
|
||||||
def __init__(self, *args: Any) -> None:
|
def __init__(self, input_img, output_dir: Any) -> None:
|
||||||
super().__init__("steghide", *args, has_archive=True)
|
super().__init__("steghide", input_img, output_dir, has_archive=True)
|
||||||
|
|
||||||
def build_cmd(self, password: Optional[str] = None) -> list[str]:
|
def build_cmd(self, password: Optional[str] = None) -> list[str]:
|
||||||
if password is None:
|
if password is None:
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ from .base_analyzer import SubprocessAnalyzer
|
|||||||
class StringsAnalyzer(SubprocessAnalyzer):
|
class StringsAnalyzer(SubprocessAnalyzer):
|
||||||
"""Analyzer for strings."""
|
"""Analyzer for strings."""
|
||||||
|
|
||||||
def __init__(self, *args: Any) -> None:
|
def __init__(self, input_img, output_dir: Any) -> None:
|
||||||
super().__init__("strings", *args)
|
super().__init__("strings", input_img, output_dir)
|
||||||
self.cmd = ["strings", self.img]
|
self.cmd = ["strings", self.img]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ from .base_analyzer import SubprocessAnalyzer
|
|||||||
class TemplateAnalyze(SubprocessAnalyzer):
|
class TemplateAnalyze(SubprocessAnalyzer):
|
||||||
"""Analyzer for <toolname>."""
|
"""Analyzer for <toolname>."""
|
||||||
|
|
||||||
def __init__(self, *args: Any) -> None:
|
def __init__(self, input_img, output_dir: Any) -> None:
|
||||||
super().__init__("<toolname>", *args, has_archive=True)
|
super().__init__("<toolname>", input_img, output_dir, has_archive=True)
|
||||||
|
|
||||||
def build_cmd(self, password: Optional[str] = None) -> list[str]:
|
def build_cmd(self, password: Optional[str] = None) -> list[str]:
|
||||||
if password:
|
if password:
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ from .base_analyzer import SubprocessAnalyzer
|
|||||||
class ZstegAnalyzer(SubprocessAnalyzer):
|
class ZstegAnalyzer(SubprocessAnalyzer):
|
||||||
"""Analyzer for zsteg."""
|
"""Analyzer for zsteg."""
|
||||||
|
|
||||||
def __init__(self, *args: Any) -> None:
|
def __init__(self, input_img, output_dir: Any) -> None:
|
||||||
super().__init__("zsteg", *args)
|
super().__init__("zsteg", input_img, output_dir)
|
||||||
self.cmd = ["zsteg", self.img]
|
self.cmd = ["zsteg", self.img]
|
||||||
|
|
||||||
def is_error(self, returncode: int, stdout: str, stderr: str, zip_exist: bool) -> bool:
|
def is_error(self, returncode: int, stdout: str, stderr: str, zip_exist: bool) -> bool:
|
||||||
|
|||||||
Reference in New Issue
Block a user