Exploit database

GH-945bd5267b0d1b94c3f74faf5cda7e5a

blkph0x/cve-2026-83844_poc

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-83844

5 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files579
blkph0x/cve-2026-83844_pocRevision 193ed44859da
Next files →

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

lab/trace/export_bfdb_allocator_reuse.py

Python · 25,494 bytes
#!/usr/bin/env python3
"""Reduce three private old-Paint allocator trials to address-free evidence.

The raw CDB log is parsed locally. No address, PID, byte sample, heap row,
filename path, or unredacted memory is emitted into the public JSON.
"""

from __future__ import annotations

import argparse
import json
import re
from dataclasses import dataclass
from pathlib import Path
from typing import Any

from export_bfdb_normal_extent_trial import parse_segment_lfh_block
from export_bfdb_normal_record_trial import BYTE_LINE
from generate_cdb import ROOT, VERSION, sha256


LAB = ROOT / "lab"
HIT = re.compile(r"(?m)^PAINT_TRACE_HIT=([a-z0-9_]+)\s*$")
ADDR = re.compile(r"(?:0x)?(?:[0-9a-f]{8}`[0-9a-f]{8}|[0-9a-f]{1,16})\Z", re.I)
FIXTURE_SHA = {
    "primer_a": "3a04580fa605a244364864e113077ab3cf55d2f20209f4b4d2173223fc30efeb",
    "primer_b": "f38f5596e4653868c58303b1da306af2c97cd88f5ba9d93bfd3f7ffa1a37b5b9",
    "trigger": "82e1ad0b1be3183b0a6075ce53a44a888f149765f24cd2a681b0656b348a8f9a",
}
MARKER = {
    "primer_a": b"A1!\x00",
    "primer_b": b"B2?\x00",
}
MODULE_SHA = {
    "mspaint.exe": "d94d89377a2a78a73b95cff70fc7706df9ae2ae53175bd6d26abb8301e36ecd9",
    "ImageProcessing.dll": "27237ae49b25ed5db5978090f9df22ba8242efd95f7cd056a445fe50c5eb06de",
    "ProvenanceHelper.dll": "39d54d518204658bd858a18d747d7b39a009771bc1f68847409114014dff0cca",
    "provenancesdk.dll": "339d8f47ea7bcc08b0c1f122a1e94d5d31860f1ad1ccf7faea1625ffd6de3904",
}
EXPECTED_PREFIX = b"\x00image/jpeg\x01"
BYTE_LINE_14 = re.compile(
    r"(?mi)^([0-9a-f]{8})\x60([0-9a-f]{8})\s+"
    r"((?:[0-9a-f]{2} ){7}[0-9a-f]{2}-(?:[0-9a-f]{2} ){5}[0-9a-f]{2})"
    r"(?=\s{2}|$)"
)
REQUIRED_ROUTE = {
    "image_image_open", "image_decoder", "flow_handoff_success_route",
    "validation_helper_call", "validation_sdk_entry", "bfdb_selected_branch",
}


def require(condition: Any, message: str) -> None:
    if not condition:
        raise ValueError(message)


def one_selected_case(value: Any, selected: str) -> bool:
    """PowerShell serializes a one-case batch as a scalar on some hosts."""
    return (type(value) is str and value == selected) or (
        type(value) is list and value == [selected]
    )


def read_json(path: Path) -> dict[str, Any]:
    return json.loads(path.read_text(encoding="utf-8-sig"))


def scoped(block: str, begin: str, end: str) -> str | None:
    # CDB concatenates adjacent .printf fields on one line inside breakpoint
    # commands; .echo markers may therefore start after a preceding field.
    starts = list(re.finditer(
        rf"(?<![A-Za-z0-9_]){re.escape(begin)}(?=\s|$)", block))
    ends = list(re.finditer(
        rf"(?<![A-Za-z0-9_]){re.escape(end)}(?=\s|$)", block))
    if not starts and not ends:
        return None
    require(len(starts) == len(ends) == 1 and starts[0].end() < ends[0].start(),
            "Ambiguous private CDB sample/heap boundary")
    return block[starts[0].end():ends[0].start()]


def one_value(block: str, key: str, *, required: bool = True) -> int | None:
    values = re.findall(
        rf"(?<![A-Za-z0-9_]){re.escape(key)}=([^\s]+)", block)
    if not values and not required:
        return None
    require(len(values) == 1, f"Missing or ambiguous private {key}")
    value = values[0].strip()
    if key.endswith("POINTER") or key.endswith("DEST") or key.endswith("OBJECT"):
        require(bool(ADDR.fullmatch(value)), f"Private {key} address format differs")
        return int(value.replace("`", ""), 16)
    require(bool(re.fullmatch(r"[0-9]+", value)), f"Private {key} count format differs")
    return int(value, 10)


def private_sample(block: str, expected_size: int) -> tuple[int, bytes] | None:
    text = scoped(block, "PAINT_REUSE_SAMPLE_BEGIN", "PAINT_REUSE_SAMPLE_END")
    if text is None:
        return None
    require(expected_size in (14, 16), "Unsupported private sample extent")
    rows = (BYTE_LINE if expected_size == 16 else BYTE_LINE_14).findall(text)
    require(len(rows) == 1, "Private bounded sample row count differs")
    addresses = [int(hi + lo, 16) for hi, lo, _ in rows]
    data = b"".join(bytes.fromhex(zone.replace("-", " "))
                    for _, _, zone in rows)
    require(len(data) == expected_size, "Private sample length differs")
    return addresses[0], data


@dataclass(frozen=True)
class Event:
    label: str
    ordinal: int
    pointer: int
    request: int | None
    length: int | None
    dest: int | None
    sample: tuple[int, bytes] | None
    heap_text: str | None


def parse_events(log: str) -> tuple[list[str], list[Event]]:
    hits = list(HIT.finditer(log))
    labels = [hit.group(1) for hit in hits]
    events: list[Event] = []
    for index, hit in enumerate(hits):
        label = hit.group(1)
        if not label.startswith("reuse_"):
            continue
        end = hits[index + 1].start() if index + 1 < len(hits) else len(log)
        block = log[hit.end():end]
        require(len(re.findall(r"\bPAINT_REUSE_EVENT_END\b", block)) == 1,
                "Private allocator event boundary missing or ambiguous")
        pointer = one_value(block, "PAINT_REUSE_POINTER")
        assert pointer is not None
        events.append(Event(
            label=label.removeprefix("reuse_"), ordinal=index, pointer=pointer,
            request=one_value(block, "PAINT_REUSE_REQUEST", required=False),
            length=one_value(block, "PAINT_REUSE_LENGTH", required=False),
            dest=one_value(block, "PAINT_REUSE_DEST", required=False),
            sample=private_sample(block, 14 if label in
                                  ("reuse_media_memcpy", "reuse_memcpy_return") else 16),
            heap_text=scoped(block, "PAINT_REUSE_HEAP_BEGIN", "PAINT_REUSE_HEAP_END"),
        ))
    return labels, events


def exactly(events: list[Event], label: str, count: int) -> list[Event]:
    selected = [event for event in events if event.label == label]
    require(len(selected) == count, f"Expected {count} private {label} events")
    return selected


def allocated_block(event: Event, requested: int, *, offset: int = 0) -> tuple[int, int]:
    require(event.heap_text is not None and event.pointer > 0,
            "Private allocation heap report absent")
    block, requested_end, rounded_end = parse_segment_lfh_block(
        event.heap_text, event.pointer
    )
    rounded = rounded_end - block
    require(event.pointer == block + offset and
            requested_end - block == requested and rounded in (16, 32),
            "Private allocation request, offset or rounded block differs")
    return block, rounded


def free_report_category(event: Event, expected_block: int) -> str:
    if event.heap_text is None:
        return "unreported"
    status = re.findall(r"(?mi)^Allocation status\s*:\s*(LFH (?:Free|Allocated))\s*$",
                        event.heap_text)
    block = re.findall(r"(?mi)^Block Address\s*:\s*(0x(?:[0-9a-f]{8}`[0-9a-f]{8}|[0-9a-f]{1,16}))\s*$",
                       event.heap_text)
    if len(status) != 1 or len(block) != 1 or int(block[0].replace("`", ""), 16) != expected_block:
        return "unrecognized"
    return "reported_free" if status[0].lower() == "lfh free" else "still_allocated"


def reduce_memory(case_id: str, events: list[Event]) -> dict[str, Any]:
    require(case_id in ("primer_a", "primer_b", "baseline"), "Unknown allocator row")
    strlen = exactly(events, "strlen_call", 1)[0]
    strlen_return = exactly(events, "strlen_return", 1)[0]
    ctor = exactly(events, "string_ctor", 1)[0]
    media_copy = exactly(events, "media_memcpy", 1)[0]
    media_return = exactly(events, "memcpy_return", 1)[0]
    target_block, target_rounded = allocated_block(strlen, 12, offset=1)
    require(strlen.sample is not None and
            strlen.sample[0] == target_block and
            strlen.sample[1][:12] == EXPECTED_PREFIX,
            "Selected short source does not match the signed fixture prefix")
    require(strlen.ordinal < strlen_return.ordinal <
            ctor.ordinal < media_copy.ordinal < media_return.ordinal,
            "Target strlen/constructor/copy order differs")
    require(strlen_return.pointer == ctor.pointer == strlen.pointer and
            strlen_return.length == ctor.length == media_copy.length and
            strlen_return.length is not None and strlen_return.length >= 11 and
            media_copy.pointer != strlen.pointer and
            media_copy.dest == media_return.pointer,
            "Target source/length/internal-copy relation differs")
    terminator = strlen.pointer + strlen_return.length
    require(terminator < target_block + target_rounded,
            "Target strlen terminator is outside reported rounded block")
    sampled_source = strlen.sample[1]
    start = strlen.pointer - target_block
    sampled_terminator = start + strlen_return.length < len(sampled_source)
    if sampled_terminator:
        require(b"\x00" not in sampled_source[start:start + strlen_return.length] and
                sampled_source[start + strlen_return.length] == 0,
                "Target strlen result differs from the bounded source bytes")
    else:
        require(b"\x00" not in sampled_source[start:],
                "Target strlen result differs from the bounded source prefix")
    baseline = {
        "target_requested_bytes": 12,
        "target_rounded_block_bytes": target_rounded,
        "target_strlen_beyond_request": terminator >= target_block + 12,
        "target_terminator_in_bounded_sample": sampled_terminator,
        "target_copy_beyond_declared_media_field": strlen_return.length > 11,
        "target_internal_copy_reached": True,
    }
    if case_id == "baseline":
        require(not [e for e in events if e.label in
                     ("primer_copied", "matching_free", "free_return")],
                "Baseline has a primer or primer-free event")
        return baseline | {
            "outcome": "unprimed_overread_baseline",
            "input_control": "not_tested_in_baseline",
        }
    primer_copied = exactly(events, "primer_copied", 1)[0]
    require(primer_copied.request == 16 and
            primer_copied.ordinal < strlen.ordinal,
            "Primer 16-byte selected copy order differs")
    primer_block, primer_rounded = allocated_block(primer_copied, 16)
    marker = MARKER[case_id]
    require(primer_copied.sample is not None and
            primer_copied.sample[0] == primer_block and
            primer_copied.sample[1][:16] == b"\x00image/jpeg\x00" + marker,
            "Primer copy did not contain the selected file marker")
    frees = [e for e in events if e.label == "matching_free"]
    returns = [e for e in events if e.label == "free_return"]
    free_call_returned = (
        len(frees) == len(returns) == 1 and
        primer_copied.ordinal < frees[0].ordinal < returns[0].ordinal <
        strlen.ordinal and
        frees[0].pointer == returns[0].pointer == primer_block
    )
    same_class = target_rounded == primer_rounded
    same_block = target_block == primer_block
    require(not same_block or same_class,
            "Address reuse contradicted the reported LFH size class")
    marker_at_target = strlen.sample[1][12:16] == marker
    free_category = (free_report_category(returns[0], primer_block)
                     if free_call_returned else "not_verified")
    if not free_call_returned:
        outcome = "free_call_or_return_not_verified"
    elif free_category != "reported_free":
        outcome = "post_delete_free_state_not_verified"
    elif not same_class:
        outcome = "different_lfh_class"
    elif not same_block:
        outcome = "no_reuse_observed"
    elif not marker_at_target:
        outcome = "reuse_without_marker"
    else:
        suffix = b"image/jpeg\x01" + marker[:3]
        copied_suffix = (
            sampled_terminator and strlen_return.length == 14 and
            media_copy.sample is not None and media_return.sample is not None and
            media_copy.sample[0] == media_copy.pointer and
            media_return.sample[0] == media_return.pointer and
            media_copy.sample[1][:14] == suffix and
            media_return.sample[1][:14] == suffix
        )
        outcome = ("controlled_slack_internal_copy_observed" if copied_suffix
                   else "marker_at_reused_source_copy_unverified")
    return baseline | {
        "primer_requested_bytes": 16,
        "primer_rounded_block_bytes": primer_rounded,
        "same_lfh_size_class": same_class,
        "matching_delete_call_returned_before_target": free_call_returned,
        "post_delete_heap_category": free_category,
        "same_block_reused": same_block,
        "marker_at_target_slack": marker_at_target,
        "outcome": outcome,
        "input_control": ("shown_for_internal_copy" if outcome ==
                          "controlled_slack_internal_copy_observed" else
                          "not_established"),
    }


def review_one(stage_path: Path, *, profile_path: Path | None = None) -> dict[str, Any]:
    stage_path = stage_path.resolve()
    stage = read_json(stage_path)
    case_id = stage.get("case_id")
    require(case_id in ("primer_a", "primer_b", "baseline") and
            stage.get("schema") == "paint-bfdb-allocator-reuse-stage-v1" and
            stage.get("build") == "old" and
            stage.get("version") == VERSION["old"] and
            stage.get("trial_label") == stage_path.name.removesuffix(
                ".bfdb-allocator-stage.json") and
            stage.get("selected_fixture_id") == (
                "trigger" if case_id == "baseline" else case_id),
            "Allocator stage identity differs")
    label = stage["trial_label"]
    selected = stage["selected_fixture_id"]
    expected_pair = None if case_id == "baseline" else f"{case_id}:trigger"
    require(stage.get("sequence_pairs") == expected_pair and
            stage.get("selected_cases") == [selected] and
            stage.get("second_case_id") == (
                None if case_id == "baseline" else "trigger") and
            stage.get("per_case_timeout_seconds") == 260 and
            stage.get("fixture_sha256") == {
                "selected": FIXTURE_SHA[selected], "trigger": FIXTURE_SHA["trigger"]
            }, "Allocator stage fixture or sequence differs")
    if profile_path is None:
        profile_path = LAB / "output/bfdb-allocator-reuse/old.auto.cdb.txt"
    profile_meta = Path(str(profile_path) + ".json")
    profile = read_json(profile_meta)
    require(profile.get("schema") == "paint-bfdb-allocator-reuse-profile-v1" and
            profile.get("profile") == "old" and
            profile.get("version") == VERSION["old"] and
            profile.get("heap_mode") == "Normal" and
            profile.get("repeat_for_sequence") is True and
            profile.get("fixture_sha256") == FIXTURE_SHA and
            sha256(profile_path) == stage.get("profile_sha256") and
            sha256(profile_meta) == stage.get("profile_manifest_sha256") and
            {name: row.get("sha256") for name, row in profile.get("modules", {}).items()}
            == MODULE_SHA, "Allocator signed profile differs")
    for name, row in profile["modules"].items():
        require(sha256(ROOT / row["package_path"]) == MODULE_SHA[name],
                f"Signed module changed: {name}")
    require(sha256(LAB / "isolation/generated" / f"{label}.wsb") ==
            stage.get("wsb_sha256"), "Allocator guest configuration changed")
    trial = LAB / "results" / label
    batch_paths = list(trial.glob("focus-batch-old-*.json"))
    shutdown_paths = list(trial.glob("focus-shutdown-old-*.json"))
    require(len(batch_paths) == len(shutdown_paths) == 1,
            "Allocator batch/shutdown receipt missing or ambiguous")
    batch, shutdown = read_json(batch_paths[0]), read_json(shutdown_paths[0])
    teardown = read_json(trial / "teardown-result.json")
    require(batch.get("schema") == "paint-ab-focus-batch-v1" and
            batch.get("build") == "old" and batch.get("status") == "complete" and
            one_selected_case(batch.get("selected_cases"), selected) and
            batch.get("sequence_pairs") == expected_pair and
            batch.get("error") is None and len(batch.get("cases", [])) == 1 and
            shutdown.get("exit_code") == 0 and
            teardown.get("schema") == "paint-ab-guest-shutdown-cleanup-v1" and
            teardown.get("trial_label") == label and
            teardown.get("state") == "closed" and
            teardown.get("guest_host_exited") is True and
            teardown.get("sandbox_process_count_after") == 0,
            "Allocator guest did not finish and close cleanly")
    preflight_path = trial / "bfdb-allocator-reuse/heap-preflight.json"
    preflight = read_json(preflight_path)
    gflags_listing = preflight_path.with_name("gflags-list.txt")
    require(preflight.get("schema") == "paint-bfdb-allocator-guest-preflight-v1" and
            preflight.get("status") == "normal_heap_verified" and
            preflight.get("case_id") == case_id and
            preflight.get("gflags_sha256") == stage.get("gflags_sha256") and
            preflight.get("profile_sha256") == stage.get("profile_sha256") and
            preflight.get("profile_manifest_sha256") == stage.get("profile_manifest_sha256") and
            preflight.get("selected_fixture_sha256") == FIXTURE_SHA[selected] and
            preflight.get("trigger_sha256") == FIXTURE_SHA["trigger"] and
            sha256(gflags_listing) == preflight.get("gflags_listing_sha256") and
            not re.search(r"(?i)\bmspaint\.exe\b", gflags_listing.read_text(errors="replace")),
            "Allocator normal-heap preflight differs")
    summary = batch["cases"][0]
    require(summary.get("case_id") == selected and
            summary.get("second_case_id") == (
                None if case_id == "baseline" else "trigger") and
            summary.get("status") == "complete" and
            summary.get("child_exited_verified") is True and
            summary.get("timed_out") is False and
            summary.get("process_exit_code") == 0 and
            summary.get("error") is None,
            "Allocator focused run incomplete")
    result_paths = list((trial / "focus/old" / selected).glob("*/result.json"))
    require(len(result_paths) == 1, "Allocator focused result missing or ambiguous")
    result_path = result_paths[0]
    log_path = result_path.with_name("cdb.log")
    require(log_path.is_file() and sha256(result_path) == summary.get("result_sha256"),
            "Allocator result/log identity differs")
    result = read_json(result_path)
    require(result.get("schema") == "paint-ab-focused-cdb-v1" and
            result.get("build") == "old" and result.get("status") == "complete" and
            result.get("case_id") == selected and
            result.get("second_case_id") == (
                None if case_id == "baseline" else "trigger") and
            result.get("trace_script_sha256") == stage["profile_sha256"] and
            result.get("trace_manifest_sha256") == stage["profile_manifest_sha256"] and
            result.get("installed_package", {}).get("version") == VERSION["old"] and
            result.get("installed_exe_sha256") == MODULE_SHA["mspaint.exe"] and
            result.get("fixture", {}).get("sha256") == FIXTURE_SHA[selected] and
            result.get("file_open_filename_value_verified") is True and
            result.get("error") is None,
            "Allocator signed guest result identity differs")
    installed = result.get("installed_module_checks", [])
    loaded = result.get("loaded_module_checks", [])
    require({row.get("module"): row.get("sha256") for row in installed} == MODULE_SHA and
            {row.get("module"): row.get("sha256") for row in loaded} == MODULE_SHA and
            all(row.get("matches_signed_package") is True for row in loaded),
            "Allocator installed/loaded signed modules differ")
    pid = result.get("blank_pid")
    marker_pids = result.get("marker_pid_records", [])
    before = result.get("markers_before_open", [])
    after = result.get("markers_after_open", [])
    require(type(pid) is int and pid > 0 and
            result.get("cdb_initial_pid") == pid and
            result.get("file_open_launch_pid") == pid and
            summary.get("blank_pid") == pid and
            summary.get("file_open_launch_pid") == pid and
            [row.get("marker") for row in marker_pids] == before + after and
            all(row.get("pid") == pid for row in marker_pids) and
            summary.get("post_open_markers") == after,
            "Allocator breakpoint/PID identity differs")
    if case_id == "baseline":
        require(result.get("sequence") is None and REQUIRED_ROUTE <= set(after) and
                after.count("image_image_open") == 1,
                "Allocator baseline route differs")
    else:
        sequence = result.get("sequence", {})
        first, second = sequence.get("first", {}), sequence.get("second", {})
        require(first.get("case_id") == selected and
                first.get("fixture_sha256") == FIXTURE_SHA[selected] and
                first.get("paint_pid") == pid and
                first.get("exact_filename_verified") is True and
                second.get("case_id") == "trigger" and
                second.get("fixture_sha256") == FIXTURE_SHA["trigger"] and
                second.get("paint_pid") == pid and
                second.get("exact_filename_verified") is True and
                after == first.get("markers", []) + second.get("markers", []) and
                REQUIRED_ROUTE <= set(first.get("markers", [])) and
                REQUIRED_ROUTE <= set(second.get("markers", [])) and
                after.count("image_image_open") == 2,
                "Allocator two-open route or filename identity differs")
    cleanup, health = result.get("cleanup", {}), result.get("post_close_health", {})
    require(cleanup.get("initial_pids") == [pid] and
            pid in cleanup.get("close_requested_pids", []) and
            not cleanup.get("forced_pids") and
            not cleanup.get("remaining_pids") and
            not health.get("remaining_pids") and
            not health.get("wer_events") and
            health.get("new_dump_count") == 0 and health.get("error") is None,
            "Allocator Paint close or post-close health differs")
    log = log_path.read_text(encoding="utf-8-sig", errors="replace")
    labels, events = parse_events(log)
    require(labels == before + after and
            not re.search(r"PAINT_REUSE_OVERHIT=|PAINT_REUSE_CAP=", log) and
            "Breakpoint condition did not evaluate to a boolean:" not in log and
            not re.search(r"(?i)first chance.*access violation", log),
            "Allocator private log marker count, cap, or AV differs")
    reduced = reduce_memory(case_id, events)
    return {
        "case_id": case_id,
        "fixture_sha256": FIXTURE_SHA[selected],
        "trigger_sha256": FIXTURE_SHA["trigger"],
        "profile_sha256": stage["profile_sha256"],
        "module_sha256": MODULE_SHA,
        "artifact_sha256": {
            "stage": sha256(stage_path), "batch": sha256(batch_paths[0]),
            "result": sha256(result_path), "debugger_log": sha256(log_path),
            "preflight": sha256(preflight_path), "teardown": sha256(trial / "teardown-result.json"),
        },
        "signed_same_pid_route": True,
        "normal_heap_verified": True,
        "normal_close_and_zero_wer_dump": True,
        "memory_relation": reduced,
    }


def review_three(stage_a: Path, stage_b: Path, stage_baseline: Path) -> dict[str, Any]:
    rows = [review_one(path) for path in (stage_a, stage_b, stage_baseline)]
    require([row["case_id"] for row in rows] ==
            ["primer_a", "primer_b", "baseline"],
            "Allocator A/B/baseline order differs")
    outcomes = [row["memory_relation"]["outcome"] for row in rows]
    established = (outcomes[:2] == [
        "controlled_slack_internal_copy_observed",
        "controlled_slack_internal_copy_observed",
    ] and rows[2]["memory_relation"]["outcome"] == "unprimed_overread_baseline")
    return {
        "schema": "paint-bfdb-allocator-reuse-address-free-v1",
        "build": "11.2605.81.0 x64",
        "rows": rows,
        "paired_result": ("input_dependent_internal_copy_observed" if established
                          else "input_control_not_established"),
        "limits": [
            "One Paint PID is required within each row; each row uses a fresh guest.",
            "A copied marker remains internal until a Paint-visible output is separately proven.",
            "No CVE attribution or command execution follows from this relation.",
            "Raw process addresses, PIDs, heap reports, memory bytes and paths stay in ignored local results.",
        ],
    }


def main() -> None:
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument("--stage-a", type=Path, required=True)
    parser.add_argument("--stage-b", type=Path, required=True)
    parser.add_argument("--stage-baseline", type=Path, required=True)
    parser.add_argument("--output", type=Path, required=True)
    args = parser.parse_args()
    reviewed = review_three(args.stage_a, args.stage_b, args.stage_baseline)
    args.output.parent.mkdir(parents=True, exist_ok=True)
    args.output.write_text(json.dumps(reviewed, indent=2) + "\n", encoding="utf-8")
    print(reviewed["paired_result"])


if __name__ == "__main__":
    main()