import json, sys
vuln_exit = int(sys.argv[1])
vuln_link = sys.argv[2] == "true"
vuln_out = sys.argv[3] == "true"
fix_exit = int(sys.argv[4])
fix_link = sys.argv[5] == "true"
vuln_log = open(sys.argv[7]).read().strip()
fix_log = open(sys.argv[8]).read().strip()
out_path = sys.argv[6]
manifest = {
    "vulnerable_version": "4.6.36",
    "fixed_version": "4.6.37",
    "vulnerable": {
        "exit_code": vuln_exit,
        "symlink_extracted": vuln_link,
        "points_outside": vuln_out,
        "log": vuln_log
    },
    "fixed": {
        "exit_code": fix_exit,
        "symlink_extracted": fix_link,
        "log": fix_log
    },
    "verdict": "confirmed" if (vuln_link and not fix_link) else "not_confirmed"
}
with open(out_path, "w") as f:
    json.dump(manifest, f, indent=2)
