Files
lief-project-LIEF/api/python/examples/json_dump.py
T
Romain Thomas 9da2466609 Improve the LIEF Python build system by using pyproject.toml
- It also provides typing info (close #650)
- Enhance the test suite
- Remove deprecated PE functions
2023-02-19 20:19:03 +01:00

15 lines
260 B
Python

import lief
import json
import sys
if len(sys.argv) != 2:
print("Usage: {} <file>".format(sys.argv[0]))
sys.exit(1)
obj = lief.parse(sys.argv[1])
json_data = json.loads(lief.to_json(obj))
print(json.dumps(json_data, sort_keys = True, indent = 4))