mirror of
https://github.com/vee1e/flare-floss.git
synced 2026-09-01 17:57:06 +00:00
parent
b60b6098c0
commit
73020a427b
7 changed files with 15 additions and 11 deletions
|
|
@ -8,6 +8,8 @@ from typing import Dict, List
|
|||
from pathlib import Path
|
||||
from dataclasses import field
|
||||
|
||||
from pydantic import TypeAdapter, ValidationError
|
||||
|
||||
# we use pydantic for dataclasses so that we can
|
||||
# easily load and validate JSON reports.
|
||||
#
|
||||
|
|
@ -16,7 +18,6 @@ from dataclasses import field
|
|||
#
|
||||
# really, you should just pretend we're using stock dataclasses.
|
||||
from pydantic.dataclasses import dataclass
|
||||
from pydantic.error_wrappers import ValidationError
|
||||
|
||||
import floss.logging_
|
||||
from floss.render import Verbosity
|
||||
|
|
@ -212,9 +213,8 @@ class ResultDocument:
|
|||
strings: Strings = field(default_factory=Strings)
|
||||
|
||||
@classmethod
|
||||
def parse_file(cls, path):
|
||||
# We're ignoring the following mypy error since this field is guaranteed by the Pydantic dataclass.
|
||||
return cls.__pydantic_model__.parse_file(path) # type: ignore
|
||||
def parse_file(cls, path: Path) -> "ResultDocument":
|
||||
return TypeAdapter(cls).validate_json(path.read_text(encoding="utf-8"))
|
||||
|
||||
|
||||
def log_result(decoded_string, verbosity):
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ dependencies = [
|
|||
"tabulate==0.9.0",
|
||||
"vivisect==1.1.1",
|
||||
"viv-utils[flirt]==0.7.9",
|
||||
"pydantic==1.10.9",
|
||||
"tqdm==4.65.0",
|
||||
"pydantic==2.6.0",
|
||||
"tqdm==4.66.2",
|
||||
"networkx==3.1",
|
||||
"halo==0.0.31",
|
||||
"rich==13.4.2",
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import sys
|
|||
import base64
|
||||
import logging
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
|
||||
from floss.results import AddressType, ResultDocument
|
||||
|
||||
|
|
@ -147,7 +148,7 @@ def main():
|
|||
logging.basicConfig(level=logging.INFO)
|
||||
logging.getLogger().setLevel(logging.INFO)
|
||||
|
||||
result_document = ResultDocument.parse_file(args.report_path)
|
||||
result_document = ResultDocument.parse_file(Path(args.report_path))
|
||||
|
||||
print(render_binja_script(result_document))
|
||||
return 0
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import sys
|
|||
import base64
|
||||
import logging
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
|
||||
from floss.results import AddressType, ResultDocument
|
||||
|
||||
|
|
@ -135,7 +136,7 @@ def main():
|
|||
logging.basicConfig(level=logging.INFO)
|
||||
logging.getLogger().setLevel(logging.INFO)
|
||||
|
||||
result_document = ResultDocument.parse_file(args.report_path)
|
||||
result_document = ResultDocument.parse_file(Path(args.report_path))
|
||||
|
||||
print(render_ghidra_script(result_document))
|
||||
return 0
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import sys
|
|||
import base64
|
||||
import logging
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
|
||||
from floss.results import AddressType, ResultDocument
|
||||
|
||||
|
|
@ -141,7 +142,7 @@ def main():
|
|||
logging.basicConfig(level=logging.INFO)
|
||||
logging.getLogger().setLevel(logging.INFO)
|
||||
|
||||
result_document = ResultDocument.parse_file(args.report_path)
|
||||
result_document = ResultDocument.parse_file(Path(args.report_path))
|
||||
|
||||
print(render_ida_script(result_document))
|
||||
return 0
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import sys
|
|||
import base64
|
||||
import logging
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
|
||||
from floss.results import AddressType, ResultDocument
|
||||
|
||||
|
|
@ -90,7 +91,7 @@ def main():
|
|||
logging.basicConfig(level=logging.INFO)
|
||||
logging.getLogger().setLevel(logging.INFO)
|
||||
|
||||
result_document = ResultDocument.parse_file(args.report_path)
|
||||
result_document = ResultDocument.parse_file(Path(args.report_path))
|
||||
|
||||
print(render_r2_script(result_document))
|
||||
return 0
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ def main():
|
|||
logging.basicConfig(level=logging.INFO)
|
||||
logging.getLogger().setLevel(logging.INFO)
|
||||
|
||||
result_document = ResultDocument.parse_file(args.report_path)
|
||||
result_document = ResultDocument.parse_file(Path(args.report_path))
|
||||
|
||||
print(render_x64dbg_database(result_document))
|
||||
return 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue