Skip to content

Commit

Permalink
Load .json.gz files directly
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohit1123 committed Feb 17, 2024
1 parent 0f9dd90 commit bc49fe4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion capa/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ def assert_never(value) -> NoReturn:


def get_format_from_report(sample: Path) -> str:
report = json.load(sample.open(encoding="utf-8"))
import gzip

with gzip.open(sample, "r") as compressed_report:
report_json = compressed_report.read()
report = json.loads(report_json)

if "CAPE" in report:
return FORMAT_CAPE
Expand Down

0 comments on commit bc49fe4

Please sign in to comment.