Formatting

This commit is contained in:
Giulio De Pasquale 2023-02-15 12:50:28 -08:00
parent d0036e0a44
commit 9a171fadab

View File

@ -12,23 +12,25 @@ from typing import List, Dict
parser = argparse.ArgumentParser()
parser.add_argument("file", help="File to analyze")
parser.add_argument("-d", "--debug", help="Enable debug mode", action = "store_true", default = False)
parser.add_argument(
"-d", "--debug", help="Enable debug mode", action="store_true", default=False
)
args = parser.parse_args()
class WrappedBin:
def __init__(self, filename: str):
self.angr: angr.Project = angr.Project(filename)
"""
Interface
"""
class Analysis:
def __init__(self, target: WrappedBin):
self.target = target
def name(self) -> str:
pass
def execute(self):
pass
@ -36,11 +38,16 @@ class Analysis:
# get all attributes of the instance
instance_vars = vars(self)
# filter out attributes that belong to the parent class
return {k: str(v) for k, v in instance_vars.items() if not k.startswith("__") and k != "target"}
return {
k: str(v)
for k, v in instance_vars.items()
if not k.startswith("__") and k != "target"
}
def __json_dumps__(self) -> str:
return json.dumps(self.__get_relevant_vars__())
class AnalysisManager:
def __init__(self, target: WrappedBin, tasks: List[Analysis] = []):
self.target: WrappedBin = target
@ -95,5 +102,6 @@ def main():
return
if __name__ == "__main__":
main()