diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..4661d0896e2bd4ad62f59eb92103eababbc35c75 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,11 @@ +** +!Dockerfile +!README.md +!requirements-runtime.txt +!core-revision.json +!demo/ +!demo/** +!examples/ +!examples/** +!bootstrap.py +**/__pycache__/ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..982bbd19388b93a4f409a312284f955088614e83 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +__pycache__/ +.pytest_cache/ +.venv/ +build/ +dist/ +*.egg-info/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000000000000000000000000000000000..b69aa5b20492db6fa0fa597aa06a0d61ef331782 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "core"] + path = core + url = https://github.com/edmcman/decompile-verify.git diff --git a/.python-version b/.python-version new file mode 100644 index 0000000000000000000000000000000000000000..c70edfad8e9e3b6a063b96c401726ec2b40c2978 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.11.13 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ee87067ecd21def405bba8eeafb64e3d60fa81b5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM ghcr.io/astral-sh/uv:0.12.19@sha256:04d046b13e60d6bcec73cbc5e1cad25d680dea90c8573340950a0ac2d1aef424 AS uv +FROM ubuntu:24.04@sha256:a853f94d226358a79c740cfc7bce0c289748f3fe3488d921d038ccd752c61b60 + +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ + ca-certificates git gcc g++ clang binutils make && \ + dpkg-query -W > /opt/apt-packages.txt && rm -rf /var/lib/apt/lists/* +COPY --from=uv /uv /uvx /usr/local/bin/ +ENV UV_PYTHON_INSTALL_DIR=/opt/python UV_LINK_MODE=copy +RUN useradd -o -m -u 1000 user && \ + uv python install 3.11.13 && uv venv --python 3.11.13 /opt/venv && \ + chown -R user:user /opt/venv +COPY requirements-runtime.txt /opt/requirements-runtime.txt +USER user +ENV HOME=/home/user UV_CACHE_DIR=/home/user/.cache/uv +RUN --mount=type=cache,id=decompile-verify-gradio-uv,target=/home/user/.cache/uv,uid=1000,gid=1000 \ + uv pip sync --python /opt/venv/bin/python --require-hashes /opt/requirements-runtime.txt +ENV PATH="/opt/venv/bin:$PATH" PYTHONHASHSEED=0 PYTHONUNBUFFERED=1 GRADIO_ANALYTICS_ENABLED=False +WORKDIR /home/user/app +# Do not COPY the build context as a whole: it may have an initialized private submodule. +COPY --chown=user:user demo/ ./demo/ +COPY --chown=user:user examples/ ./examples/ +COPY --chown=user:user bootstrap.py core-revision.json ./ +EXPOSE 7860 +CMD ["python", "bootstrap.py"] diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9fdcbbbf785cf10f5afd807f373c5040339e5696 --- /dev/null +++ b/README.md @@ -0,0 +1,102 @@ +--- +title: Decompiler verifier +emoji: 🔍 +colorFrom: indigo +colorTo: blue +sdk: docker +app_port: 7860 +fullWidth: true +--- + +# Decompiler verifier workbench + +Public Gradio frontend for comparing a binary function with candidate C. Select +an example or upload an ELF x86-64 binary, supply its function address and candidate +source, and stream verification results with assembly previews and a JSON download. +The application includes all 45 synthetic, saved Ghidra, and real-binary examples. + +The verification library is a private GitHub repository referenced by the `core/` +Git submodule. This repository publishes the UI and demo assets. Running verification +locally requires access to the private core; cloning the public frontend alone does +not grant that access. + +## Local development + +Use Linux/amd64, Python 3.11.13, GCC, Clang, and binutils. On macOS or Windows, +use the Docker workflow below. With authorized GitHub credentials: + +```sh +git submodule update --init core +uv sync --locked +uv run python -m demo.app +uv run python -m pytest -q +``` + +Open . The library is installed as an editable dependency +from the submodule. UI tests operate on public assets and the installed library; +they do not import the private engine tests. Core regression tests run separately +in the core project. + +## Docker and Hugging Face + +```sh +docker build --platform linux/amd64 -t decompile-verify:gradio . +docker run --rm --platform linux/amd64 --publish 127.0.0.1:7860:7860 \ + --env CORE_GITHUB_TOKEN decompile-verify:gradio +``` + +Set `CORE_GITHUB_TOKEN` in your local environment using your credential manager +before running the command; do not write its value into shell history. In the +Space Settings, configure the same name as a secret. Use a GitHub token scoped +to the private core repository with read-only Contents permission. + +The public image contains third-party dependencies, UI code, and example assets. +It excludes the private submodule even when initialized locally. At startup, +`bootstrap.py` fetches the pinned core commit, verifies it, installs the library, +deletes the temporary checkout, removes the token from the application environment, +and launches Gradio on port 7860. Startup fails clearly if credentials or the pinned +revision are unavailable. This requires network access to GitHub at startup. +The installed core exists only in the running container, outside the published image. +uv uses a BuildKit cache mount for dependency downloads and builds; that cache is +reused across builds and does not become part of the published image. + +Uploads and downloaded reports are ephemeral. Gradio blocks file serving from +the private library, development submodule, and Git metadata. The workbench preserves +queued streaming, cancellation, editable settings, and deterministic JSON reports. + +## Update the core revision + +Commit and push library changes in the private core repository first. Update the +submodule to that committed revision, then regenerate pin metadata and dependencies: + +```sh +git -C core fetch origin +git -C core checkout CORE_COMMIT +uv run --no-sync python scripts/pin_core.py +``` + +Commit `core`, `core-revision.json`, `uv.lock`, and `requirements-runtime.txt` +together. The private core stays on GitHub; only its gitlink is published here. +The Docker build installs the hashed requirements without authenticating to GitHub. + +Examples are prepared in the private core's Linux container with +`python -m scripts.export_demo_examples --out build/public-examples` and copied +into `examples/`. Startup does not compile original example sources or require +the core's test tree. Reference C is a display aid; uploaded binaries have none. +The bundled `factor` executable retains its redistribution notices in `examples/`. + +## Publish under the existing Space name + +The old private `ejschwartz/decompile-verify` Space contains core source and history. +Do not make it public directly. Back it up privately, then create a clean replacement +at the same name and push only this repository's fresh history. Configure secrets, +validate the app and all image layers while private, and verify old core-containing +commits and images are inaccessible before publishing. Replacing the Space requires +separate approval because it interrupts the current app and removes its history/settings. + +See [Docker Space secrets](https://huggingface.co/docs/hub/spaces-sdks-docker#secrets-and-variables-management) +and [downloadable Space images](https://huggingface.co/docs/hub/spaces-run-with-docker). + +To inspect every image layer for private core files and repository metadata, run +`python scripts/audit_image.py decompile-verify:gradio`. The audit recognizes uv's +empty cache sentinel as installer metadata rather than a project Git repository. diff --git a/bootstrap.py b/bootstrap.py new file mode 100644 index 0000000000000000000000000000000000000000..6f12ded988b93bb55f6b94b74e9c8a201fce0cea --- /dev/null +++ b/bootstrap.py @@ -0,0 +1,88 @@ +"""Install the pinned private submodule at runtime, before importing Gradio.""" + +import argparse +import json +import os +from pathlib import Path +import re +import subprocess +import sys +import tempfile + +ROOT = Path(__file__).resolve().parent +REPOSITORY = "https://github.com/edmcman/decompile-verify.git" + + +def revision(): + data = json.loads((ROOT / "core-revision.json").read_text()) + if data["repository"] != REPOSITORY or not re.fullmatch(r"[0-9a-f]{40}", data["commit"]): + raise ValueError("invalid pinned core repository or commit") + return data + + +def command(args, *, env=None, cwd=None, timeout=300): + try: + return subprocess.run(args, cwd=cwd, env=env, check=True, capture_output=True, + text=True, timeout=timeout).stdout.strip() + except (subprocess.CalledProcessError, subprocess.TimeoutExpired, OSError) as error: + # Never emit raw Git output or the authentication environment into Space logs. + raise RuntimeError(f"private core setup failed during {Path(args[0]).name}; " + "check repository access, pinned commit, and network availability") from error + + +def install_core(): + pinned = revision() + token = os.environ.pop("CORE_GITHUB_TOKEN", None) + if not token: + raise RuntimeError("set the CORE_GITHUB_TOKEN Space secret to a read-only GitHub token") + clean_env = {key: value for key, value in os.environ.items() + if not key.startswith("GIT_")} + clean_env["GIT_TERMINAL_PROMPT"] = "0" + clean_env["GIT_CONFIG_GLOBAL"] = os.devnull + clean_env["GIT_CONFIG_NOSYSTEM"] = "1" + # An ephemeral askpass helper supplies the credential without storing it in + # a URL, git config, command line, or the environment of the running app. + with tempfile.TemporaryDirectory(prefix="private-core-") as temporary: + directory = Path(temporary) + askpass = directory / "askpass.py" + askpass.write_text(f"#!{sys.executable}\nimport os, sys\n" + "print('x-access-token' if 'username' in sys.argv[1].lower() " + "else os.environ['CORE_GITHUB_TOKEN'])\n") + askpass.chmod(0o700) + git_env = {**clean_env, "GIT_ASKPASS": str(askpass), "CORE_GITHUB_TOKEN": token} + # Disable credential helpers so no persistent credential is read or saved. + git_env.update(GIT_CONFIG_COUNT="1", GIT_CONFIG_KEY_0="credential.helper", GIT_CONFIG_VALUE_0="") + source = directory / "source" + source.mkdir() + command(["git", "init", "--quiet", str(source)], env=clean_env) + command(["git", "remote", "add", "origin", REPOSITORY], env=clean_env, cwd=source) + command(["git", "fetch", "--quiet", "--depth=1", "origin", pinned["commit"]], env=git_env, cwd=source) + fetched = command(["git", "rev-parse", "FETCH_HEAD"], env=clean_env, cwd=source) + if fetched != pinned["commit"]: + raise RuntimeError("fetched core revision differs from the pinned submodule") + command(["git", "checkout", "--quiet", "--detach", "FETCH_HEAD"], env=clean_env, cwd=source) + git_env.clear() + token = None + command(["uv", "pip", "install", "--python", sys.executable, + "--no-deps", "--no-build-isolation", str(source)], env=clean_env) + from importlib.metadata import version + if version("decompile-verify") != pinned["version"]: + raise RuntimeError("installed core version differs from the pinned metadata") + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--install-only", action="store_true") + args = parser.parse_args() + try: + install_core() + except (RuntimeError, ValueError, KeyError, OSError) as error: + print(str(error), file=sys.stderr) + return 1 + if not args.install_only: + os.execv(sys.executable, [sys.executable, "-m", "demo.app", "--host", "0.0.0.0", "--port", "7860"]) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/core b/core new file mode 160000 index 0000000000000000000000000000000000000000..bdc8d4af1f3a26294cbca5bb094b7308b98859bd --- /dev/null +++ b/core @@ -0,0 +1 @@ +Subproject commit bdc8d4af1f3a26294cbca5bb094b7308b98859bd diff --git a/core-revision.json b/core-revision.json new file mode 100644 index 0000000000000000000000000000000000000000..9f306cbb9d46810162646b31776cb144db155e6a --- /dev/null +++ b/core-revision.json @@ -0,0 +1,5 @@ +{ + "repository": "https://github.com/edmcman/decompile-verify.git", + "commit": "bdc8d4af1f3a26294cbca5bb094b7308b98859bd", + "version": "0.0.0" +} diff --git a/demo/__init__.py b/demo/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8be60f1e34a648eab4196d762423a3c1e9956d0b --- /dev/null +++ b/demo/__init__.py @@ -0,0 +1 @@ +"""Gradio front end; verification is owned by verifier.api.""" diff --git a/demo/app.py b/demo/app.py new file mode 100644 index 0000000000000000000000000000000000000000..930d03f7b9191bb49435dd40ecd1088bd37ccb38 --- /dev/null +++ b/demo/app.py @@ -0,0 +1,277 @@ +"""Local Gradio demo. Run inside the Linux x86-64 Docker environment.""" + +import argparse +from contextlib import closing +from dataclasses import asdict +from hashlib import sha256 +from decimal import Decimal +import re +from pathlib import Path +import verifier +import shlex +import tempfile + +import gradio as gr + +from demo.examples import EXAMPLE_LABELS, ROOT, prepare_examples, reference_sources +from demo.presentation import banner, format_bit_ranges, json_detail, mismatch_summary, status +from demo.session import (UISession, begin_ui, cancel_session, controls, edit_inputs, idle_controls, + reset_session, stream_ui) +import verifier as api +from verifier import Task, integer_text, parse_bindings, parse_function, yaml_mapping + +HEADERS = ["Seed", "Verdict", "Location", "Differing bits", "Original", "Candidate", "Reason"] + + +def integer(value, label): + if type(value) is int: + return value + if isinstance(value, float) and value.is_integer(): + return int(value) + if isinstance(value, str): + try: + if value.strip().lower().startswith("0x"): + return int(value.strip(), 16) + if re.fullmatch(r"[+-]?[0-9]+", value.strip()): + return int(Decimal(value.strip())) + except ValueError: + pass + raise ValueError(f"{label} must be an integer") + + +def result_row(result): + diff = result.difference + bits = format_bit_ranges((span.first, span.last) for span in getattr(diff, "bit_ranges", ())) + original, candidate = getattr(diff, "original", ""), getattr(diff, "candidate", "") + if isinstance(original, int): + original, candidate = hex(original), hex(candidate) + return [integer_text(result.seed), result.verdict, getattr(diff, "location", ""), bits, + original, candidate, result.reason or result.original.reason or result.candidate.reason or ""] + + +def task_from_inputs(binary, function, candidate, bindings, candidate_symbol, + seed_count, seed_start, instruction_budget, compiler, flags, interfaces=""): + if not binary: + raise ValueError("upload a binary or select an example") + options = yaml_mapping(interfaces or "") + allowed = {"original_prototype", "original_cc", "candidate_cc", "variadic_types", "callee_interfaces", "memory_ranges", "original_base"} + if set(options) - allowed: + raise ValueError("unknown interface settings: " + ", ".join(sorted(set(options) - allowed))) + return Task(binary=Path(binary), function=parse_function(function), candidate=candidate, + bindings=parse_bindings(bindings), candidate_symbol=candidate_symbol.strip(), + seed_count=integer(seed_count, "seed count"), seed_start=integer(seed_start, "seed start"), + instruction_budget=integer(instruction_budget, "instruction budget"), + compiler=compiler, flags=tuple(shlex.split(flags)), **options) + + +def clear_outputs(): + return "", [], None, None, "", "" + + +def show_assembly(binary, function, candidate, bindings, candidate_symbol, + seed_count, seed_start, instruction_budget, compiler, flags, interfaces=""): + try: + report = api.inspect(task_from_inputs(binary, function, candidate, bindings, candidate_symbol, + seed_count, seed_start, instruction_budget, compiler, flags, interfaces)) + yield banner(report, preview=True), [], None, None, report.original_assembly, report.candidate_assembly + except (ValueError, OSError) as error: + raise gr.Error(str(error)) from error + + +def run_verification(binary, function, candidate, bindings, candidate_symbol, + seed_count, seed_start, instruction_budget, compiler, flags, interfaces="", *, report_directory=None): + """Translate UI inputs, stream engine results, then supply the JSON download.""" + try: + task = task_from_inputs(binary, function, candidate, bindings, candidate_symbol, + seed_count, seed_start, instruction_budget, compiler, flags, interfaces) + rows, detail = [], None + with closing(api.verify(task, stream=True)) as iterator: + for report in iterator: + rows.append(result_row(report.results[-1])) + if detail is None and report.first_mismatch is not None: + detail = asdict(report.first_mismatch) + yield banner(report), list(rows), detail, None, report.original_assembly, report.candidate_assembly + output = report.to_json() + directory = Path(report_directory) if report_directory else Path(tempfile.gettempdir()) / "decompile-verify-reports" + directory.mkdir(parents=True, exist_ok=True) + path = directory / (sha256(output.encode()).hexdigest() + ".json") + # Atomic writes allow concurrent requests for the same deterministic report. + with tempfile.NamedTemporaryFile(mode="w", dir=directory, delete=False) as stream: + stream.write(output) + temporary = Path(stream.name) + temporary.replace(path) + yield banner(report, complete=True), rows, detail, str(path), report.original_assembly, report.candidate_assembly + except (ValueError, OSError) as error: + raise gr.Error(str(error)) from error + + +class Workbench(gr.Blocks): + """Apply the workbench theme even when a caller launches create_app() directly.""" + + def launch(self, **kwargs): + kwargs.setdefault("theme", gr.themes.Base( + primary_hue="teal", secondary_hue="teal", neutral_hue="slate", + font=["system-ui", "sans-serif"], font_mono=["ui-monospace", "monospace"], + )) + kwargs.setdefault("css_paths", Path(__file__).with_name("workbench.css")) + kwargs.setdefault("js", Path(__file__).with_name("workbench.js").read_text()) + blocked = list(kwargs.pop("blocked_paths", ()) or ()) + blocked.extend([str(Path(verifier.__file__).resolve().parent), + str(ROOT / "core"), str(ROOT / ".git")]) + kwargs["blocked_paths"] = blocked + return super().launch(**kwargs) + + +def create_app(examples_directory=None): + examples = prepare_examples(examples_directory or ROOT / "build" / "demo-examples") + references = reference_sources() + with Workbench(title="Decompiler verifier", analytics_enabled=False, + fill_width=True, delete_cache=(3600, 86400)) as app: + session = gr.State(UISession()) + ticket = gr.State(None) + reference_function = gr.State(None) + gr.Markdown("# Decompiler verifier\nCompare a C candidate with a binary function across shared random seeds.", + elem_id="intro") + # Render inputs later so the example picker can sit above setup. + binary = gr.File(label="Binary", type="filepath", file_count="single", render=False, elem_id="binary") + function = gr.Textbox(label="Function start address", placeholder="0x401000", + info="angr recovers the function's blocks using available symbols and control flow.", render=False) + candidate_symbol = gr.Textbox(label="Candidate function name", value="target", render=False) + candidate = gr.Code(label="Candidate C", language="c", lines=20, wrap_lines=False, + buttons=["copy"], render=False, elem_id="candidate-source") + bindings = gr.Code(label="Bindings (YAML)", language="yaml", lines=4, + value="globals: {}\ncallees: {}\n", render=False) + seed_count = gr.Number(label="Seed count", value=100, precision=0, minimum=1, render=False) + seed_start = gr.Textbox(label="First seed", value="0", info="Nonnegative decimal or hex integer", render=False) + instruction_budget = gr.Number(label="Instruction budget per run", value=100000, precision=0, + minimum=1, render=False) + compiler = gr.Dropdown(label="Candidate compiler", choices=["gcc", "clang"], value="gcc", render=False) + flags = gr.Textbox(label="Candidate flags", value="-O2", + info="Optimization/debug flags and selected C options; see docs/demo.md.", render=False) + interfaces = gr.Code(label="Function interfaces and explicit memory ranges (YAML)", language="yaml", + value="", lines=5, render=False) + inputs = [binary, function, candidate, bindings, candidate_symbol, + seed_count, seed_start, instruction_budget, compiler, flags, interfaces] + example_picker = gr.Examples(examples=examples, inputs=inputs, label="Examples", + example_labels=list(EXAMPLE_LABELS), + examples_per_page=20, + cache_examples=False, elem_id="examples") + with gr.Row(elem_id="setup"): + binary.render() + function.render() + candidate_symbol.render() + with gr.Accordion("Bindings", open=False): + bindings.render() + interfaces.render() + with gr.Accordion("Run settings", open=False): + with gr.Row(): + seed_count.render() + seed_start.render() + instruction_budget.render() + compiler.render() + flags.render() + with gr.Row(elem_id="actions"): + run = gr.Button("Verify", variant="primary") + cancel = gr.Button("Cancel", interactive=False) + verdict = gr.HTML(status("Ready · Choose an example or upload a binary"), elem_id="verdict", + apply_default_css=False) + with gr.Row(elem_id="workspace") as workspace: + candidate.render() + reference = gr.Code(label="Reference C", language="c", lines=20, + interactive=False, wrap_lines=False, buttons=["copy"], + visible=False, elem_id="reference-source") + original_assembly = gr.Code(label="Original assembly", language=None, lines=20, + interactive=False, wrap_lines=False, buttons=["copy"], + show_line_numbers=False, elem_id="original-assembly") + candidate_assembly = gr.Code(label="Candidate assembly", language=None, lines=20, + interactive=False, wrap_lines=False, buttons=["copy"], + show_line_numbers=False, elem_id="candidate-assembly") + gr.Markdown("Compares ordered calls, non-frame memory at calls and return, typed returns, " + "and termination. Bound callees use declared signatures and deterministic " + "synthetic returns without memory effects. Frame-observing and unsupported " + "calls are inconclusive.", elem_id="scope") + with gr.Row(elem_id="results"): + table = gr.Dataframe(headers=HEADERS, datatype=["str"] * len(HEADERS), + interactive=False, label="Per-seed results", scale=2, + min_width=320, elem_id="seed-table", max_height=340, + column_widths=[90, 100, 100, 140, 120, 120, 240]) + with gr.Column(scale=1, min_width=280): + gr.Markdown("### First mismatch") + summary = gr.HTML(mismatch_summary(None), apply_default_css=False, elem_id="mismatch-summary") + with gr.Accordion("Full mismatch JSON", open=False): + detail = gr.JSON(label="First mismatch") + download = gr.DownloadButton(label="Download JSON report") + outputs = [verdict, table, detail, download, original_assembly, candidate_assembly] + buttons = [run, cancel] + + def verify_ui(binary, function, candidate, bindings, candidate_symbol, + seed_count, seed_start, instruction_budget, compiler, flags, interfaces, session, ticket): + for update in stream_ui(run_verification, (binary, function, candidate, bindings, candidate_symbol, + seed_count, seed_start, instruction_budget, compiler, flags, interfaces), session, ticket): + yield update[0], update[1], json_detail(update[2]), *update[3:] + + def reset_ui(session): + reset_session(session) + return clear_outputs() + + def load_reference(example): + index, values = example + source = references[index] + return (gr.update(value=source, visible=bool(source)), + gr.update(elem_classes=["has-reference"] if source else []), values[1]) + + def clear_reference(): + return gr.update(value="", visible=False), gr.update(elem_classes=[]), None + + def clear_changed_reference(function, reference_function): + if reference_function is not None and function != reference_function: + return clear_reference() + return (gr.skip(),) * 3 + + reference_outputs = [reference, workspace, reference_function] + + # State inputs are private to Gradio and omitted from the public API signature. + verify_start = run.click(begin_ui, [session, *inputs], [verdict, *buttons, ticket], + queue=False, api_visibility="private", show_progress="hidden") + preview_event = gr.on(triggers=[], fn=show_assembly, inputs=inputs, outputs=outputs, + api_name="assembly", concurrency_limit=1, + concurrency_id="workbench", show_progress="hidden") + event = verify_start.then(verify_ui, [*inputs, session, ticket], outputs, api_name="verify", concurrency_limit=1, + concurrency_id="workbench", show_progress="hidden") + event.then(idle_controls, session, buttons, queue=False, + api_visibility="private", show_progress="hidden") + gr.on([binary.upload, binary.delete, binary.clear, *[component.input for component in inputs[1:]]], + edit_inputs, [session, *inputs], verdict, + queue=False, api_visibility="private", show_progress="hidden") + detail.change(mismatch_summary, detail, summary, queue=False, + api_visibility="private", show_progress="hidden") + example_picker.dataset.click(reset_ui, session, outputs, queue=False, + cancels=[event, preview_event], api_name="reset_outputs", + api_visibility="undocumented", show_progress="hidden") + example_picker.dataset.click(lambda: controls(False), outputs=buttons, queue=False, + api_visibility="private", show_progress="hidden") + example_picker.dataset.click(load_reference, example_picker.dataset, reference_outputs, + queue=False, api_visibility="private", show_progress="hidden") + gr.on([binary.upload, binary.delete, binary.clear, function.input], + clear_reference, outputs=reference_outputs, queue=False, + api_visibility="private", show_progress="hidden") + # Gradio 6.9 Textbox.input fires on keypress; blur also catches paste/deletion. + function.blur(clear_changed_reference, [function, reference_function], reference_outputs, + queue=False, api_visibility="private", show_progress="hidden") + cancel.click(cancel_session, session, verdict, cancels=[event, preview_event], queue=False, + api_visibility="private", show_progress="hidden").then( + idle_controls, session, buttons, queue=False, + api_visibility="private", show_progress="hidden") + return app.queue(max_size=16) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--host", default="127.0.0.1") + parser.add_argument("--port", type=int, default=7860) + args = parser.parse_args() + create_app().launch(server_name=args.host, server_port=args.port, share=False) + + +if __name__ == "__main__": + main() diff --git a/demo/examples.py b/demo/examples.py new file mode 100644 index 0000000000000000000000000000000000000000..fa06e89b519fd2a6294fe013314d16c734c7a4da --- /dev/null +++ b/demo/examples.py @@ -0,0 +1,47 @@ +"""Load public, prepared examples without access to the private test suite.""" + +from hashlib import sha256 +import json +from pathlib import Path +import shutil + +ROOT = Path(__file__).resolve().parents[1] +ASSETS = ROOT / "examples" +CATALOG = json.loads((ASSETS / "catalog.json").read_text()) +EXAMPLE_NAMES = tuple(item["name"] for item in CATALOG) +EXAMPLE_LABELS = tuple(item["label"] for item in CATALOG) +ORIGINAL_EXAMPLE_NAMES = tuple(name for name in EXAMPLE_NAMES if not name.startswith("ghidra-")) +GHIDRA_EXAMPLE_NAMES = tuple(name for name in EXAMPLE_NAMES if name.startswith("ghidra-")) +ORIGINAL_EXAMPLE_LABELS = tuple(item["label"] for item in CATALOG if not item["name"].startswith("ghidra-")) + + +def example_metadata(name): + return next(item for item in CATALOG if item["name"] == name) + + +def ghidra_metadata(name): + return example_metadata(name).get("ghidra") + + +def reference_sources(): + return tuple(example_metadata(name)["reference"] for name in EXAMPLE_NAMES) + + +def prepare_examples(directory, *, include_ghidra=True): + directory = Path(directory).resolve() + directory.mkdir(parents=True, exist_ok=True) + rows = [] + names = EXAMPLE_NAMES if include_ghidra else ORIGINAL_EXAMPLE_NAMES + for name in names: + item = example_metadata(name) + source = (ASSETS / item["binary"]).resolve() + if not source.is_relative_to(ASSETS.resolve()): + raise ValueError("example binary must be inside the public assets directory") + if sha256(source.read_bytes()).hexdigest() != item["binary_sha256"]: + raise ValueError(f"example binary checksum mismatch: {name}") + binary = directory / source.name + if source != binary: + shutil.copyfile(source, binary) + rows.append([str(binary), *item["inputs"]]) + (directory / "examples.json").write_text(json.dumps(rows, indent=2) + "\n") + return rows diff --git a/demo/presentation.py b/demo/presentation.py new file mode 100644 index 0000000000000000000000000000000000000000..c2b8f452adf1663a5734c40cbe7dde5e80bde388 --- /dev/null +++ b/demo/presentation.py @@ -0,0 +1,118 @@ +"""Presentation of existing reports; no verification decisions live here.""" + +from html import escape +from decimal import Decimal +from verifier import integer_text + + +STALE_SLOT = "" +ABI_SLOT = "" + + +def json_detail(value): + """Display integers as exact text through JSON serialization and the browser.""" + if isinstance(value, dict): + return {key: json_detail(item) for key, item in value.items()} + if isinstance(value, (list, tuple)): + return [json_detail(item) for item in value] + if type(value) is int: + return integer_text(value) + return value + + +def code(value): + return f"{escape(str(value))}" + + +def status(label, tone="amber", progress=""): + return (f'
' + f'{escape(label)}{STALE_SLOT}' + f'{escape(progress)}
') + + +def with_stale(value, stale): + marker = 'Out of date' if stale else "" + return value.replace(STALE_SLOT, marker) + + +def format_bit_ranges(ranges): + return ", ".join(str(first) if first == last else f"{first}–{last}" + for first, last in ranges) + + +def abi_details(task): + rows = [] + for arg in task["inputs"]: + location = code(arg["location"]) + if arg["randomized"] is False: + location += ' (not randomized)' + rows.append(f'{code(arg["name"])}{code(arg["type_name"])}' + f'{location}') + arguments = ('' + f'{"".join(rows)}
NameTypeLocation
' if rows else '

No arguments.

') + variadic = '

Includes explicitly typed variadic inputs.

' if task["variadic"] else "" + original = task.get("original_interface") + provenance = (f'

Original interface: {code(original["signature"])} · {code(original["calling_convention"])} · ' + f'{code(original["source"])}' + (' (inferred)' if original["inferred"] else '') + '

') if original else "" + output = task["output"] + return (f'{ABI_SLOT}
' + f'{code(task["prototype"])}{provenance}
' + f'{arguments}{variadic}
' + f'

{code(output["type_name"])} → {code(output["location"])} ' + f'({output["width"]} bits)

') + + +def literal_details(task): + bindings = task.get("literal_bindings", ()) + if not bindings: + return "" + rows = [] + for binding in bindings: + address = binding["address"] + detail = hex(address) if address is not None else { + "ambiguous": "Several original addresses match; kept local", + "unmatched": "No original match; kept local", + "skipped": "Unsupported type or source range; kept local", + }.get(binding["status"], "") + if binding.get("reason") == "binding_introduces_imports": + detail = "Binding would introduce library calls; kept local" + rows.append(f'{code(binding["literal"])}{escape(binding["status"])}' + f'{escape(detail)}') + return ('
String literal bindings' + '' + f'{"".join(rows)}
LiteralStatusAddress / diagnostic
') + + +def banner(report, complete=False, preview=False): + count = len(report.results) + label = ("Completed · Assembly preview" if preview else + f"Completed · {report.verdict.upper()}" if complete else + f"Running {count}/{report.task['seed_count']}") + tone = {"agree": "green", "mismatch": "red"}.get(report.verdict, "amber") if complete else "amber" + counts = report.counts + progress = "" if preview else (f"{counts['agree']} agree · {counts['mismatch']} mismatch · " + f"{counts['inconclusive']} inconclusive") + return status(label, tone, progress) + abi_details(report.task) + literal_details(report.task) + + +def mismatch_summary(detail): + if not detail: + return '

No mismatch to display.

' + diff = detail.get("difference") or {} + bits = format_bit_ranges((span["first"], span["last"]) for span in diff.get("bit_ranges", ())) + values = [("Seed", detail["seed"]), ("Location", diff.get("location", "—")), + ("Original value", diff.get("original", "—")), + ("Candidate value", diff.get("candidate", "—")), ("Differing bits", bits or "—")] + rows = [] + for label, value in values: + if (label.endswith("value") and isinstance(value, str) and "width" in diff + and ("xor" not in diff or diff["xor"] is not None)): + value = int(Decimal(value)) + if label.endswith("value") and isinstance(value, int): + value = hex(value) + elif isinstance(value, int): + value = integer_text(value) + rows.append(f'
{escape(label)}
{code(value)}
') + reason = detail.get("reason") + return (f'
{"".join(rows)}
' + + (f'

{escape(reason)}

' if reason else "")) diff --git a/demo/session.py b/demo/session.py new file mode 100644 index 0000000000000000000000000000000000000000..874756dd9e2f33918aa89c3f6410335dc40a4dda --- /dev/null +++ b/demo/session.py @@ -0,0 +1,104 @@ +"""Private, per-browser state for displayed inputs and cancellable result streams.""" + +from contextlib import closing +from threading import RLock + +from demo.presentation import ABI_SLOT, status, with_stale + + +class UISession: + def __init__(self): + self.snapshot = self.current = None + self.generation = 0 + self.busy = False + self.display = "" + self.lock = RLock() + + def __deepcopy__(self, memo): + # Each Gradio session gets its own state and synchronization primitive. + session = UISession() + session.snapshot, session.current = self.snapshot, self.current + session.generation, session.busy, session.display = self.generation, self.busy, self.display + return session + + def rendered(self): + return with_stale(self.display, self.snapshot is not None and self.snapshot != self.current) + + +def edit_inputs(session, *values): + with session.lock: + session.current = tuple(values) + return session.rendered() + + +def reset_session(session): + with session.lock: + session.generation += 1 + session.snapshot = session.current = None + session.busy = False + session.display = "" + + +def cancel_session(session): + with session.lock: + session.generation += 1 + session.busy = False + _, separator, abi = session.display.partition(ABI_SLOT) + session.display = status("Cancelled") + separator + abi + return session.rendered() + + +def controls(busy): + import gradio as gr + + return gr.update(interactive=not busy), gr.update(interactive=busy) + + +def idle_controls(session): + with session.lock: + return controls(session.busy) + + +def begin_ui(session, *values): + with session.lock: + session.generation += 1 + session.snapshot = session.current = tuple(values) + session.busy = True + session.display = status("Building") + return session.rendered(), *controls(True), session.generation + + +def stream_ui(handler, values, session, ticket=None): + """Keep the six API outputs while protecting this session from obsolete streams.""" + with session.lock: + if ticket is not None: + if ticket != session.generation or not session.busy: + return + values = session.snapshot + else: + begin_ui(session, *values) + generation = session.generation + initial = session.rendered() + try: + yield initial, [], None, None, "", "" + with closing(handler(*values)) as iterator: + for update in iterator: + with session.lock: + if session.generation != generation: + return + session.display = update[0] + rendered = session.rendered() + yield (rendered, *update[1:]) + except Exception: + with session.lock: + if session.generation == generation: + session.display = status("Failed · Check inputs and try again", "red") + rendered = session.rendered() + else: + return + yield rendered, [], None, None, "", "" + raise + finally: + with session.lock: + if session.generation == generation: + session.busy = False diff --git a/demo/workbench.css b/demo/workbench.css new file mode 100644 index 0000000000000000000000000000000000000000..e8010fbc866fab5daab4670822fde740823af40e --- /dev/null +++ b/demo/workbench.css @@ -0,0 +1,62 @@ +.gradio-container { width: 100%; min-width: 0 !important; max-width: 1800px !important; margin: auto; } +#intro { margin-bottom: 0; } +#intro h1 { font-size: 1.65rem; letter-spacing: -.025em; } +#scope { font-size: .85rem; color: var(--body-text-color-subdued); } +#setup { align-items: stretch; } +#binary { min-height: 110px; } +#binary .wrap { min-height: 72px; } +#actions { gap: 8px; } +#actions button { flex: 0 1 160px; min-width: 160px; white-space: nowrap; } +#workspace { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } +#workspace.has-reference { grid-template-columns: repeat(4, minmax(0, 1fr)); } +#workspace > * { min-width: 0 !important; width: 100%; } +#workspace > .block { min-height: 418px; } +#workspace .cm-editor { height: 390px; } +#workspace .cm-scroller { overflow: auto !important; } +#workspace .cm-content { white-space: pre !important; } +#workspace .cm-line { line-height: 1.45; } +#workspace .cm-gutters { line-height: 1.45; } +#workspace .cm-editor, #workspace .cm-scroller { font-size: 12px; } +#workspace .cm-scroller:focus-visible, #workspace button:focus-visible { + outline: 2px solid var(--color-accent); outline-offset: -2px; +} +.run-status { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-height: 44px; + padding: 10px 12px; border: 1px solid var(--border-color-primary); border-radius: 8px; + background: var(--block-background-fill); } +.indicator { display: inline-flex; align-items: center; gap: 7px; padding: 4px 9px; + border-radius: 5px; font-size: .9rem; font-weight: 600; } +.indicator::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; } +.green { color: #166534; background: #dcfce7; } +.red { color: #991b1b; background: #fee2e2; } +.amber { color: #854d0e; background: #fef3c7; } +.dark .green { color: #86efac; background: #143b2b; } +.dark .red { color: #fca5a5; background: #451d26; } +.dark .amber { color: #fde68a; background: #423519; } +.counts, .muted { color: var(--body-text-color-subdued); font-size: .85rem; } +.abi-details { display: grid; grid-template-columns: 1fr 1.4fr .7fr; gap: 24px; padding: 16px 2px 4px; + font-size: .85rem; color: var(--body-text-color); } +.abi-details > div { min-width: 0; overflow-x: auto; } +.section-label { font-weight: 600; margin: 0 0 6px; } +.abi-details table, .literal-details table { border-collapse: collapse; width: 100%; text-align: left; } +.abi-details th, .abi-details td, .literal-details th, .literal-details td { padding: 4px 12px 4px 0; vertical-align: top; } +.abi-details th, .literal-details th { font-weight: 500; color: var(--body-text-color-subdued); } +.abi-details code, .mismatch-summary code, .literal-details code { font-family: var(--font-mono); } +.literal-details { margin-top: 12px; overflow-x: auto; font-size: .85rem; } +.literal-details summary { cursor: pointer; color: var(--body-text-color-subdued); } +.abi-details p { margin-top: 0; } +#results { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: stretch; } +#results > * { min-width: 0 !important; } +#seed-table { overflow-x: auto !important; } +.mismatch-summary { margin: 0; color: var(--body-text-color); } +.mismatch-summary > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; + padding: 9px 0; border-bottom: 1px solid var(--border-color-primary); } +.mismatch-summary dt { color: var(--body-text-color-subdued); font-size: .85rem; } +.mismatch-summary dd { margin: 0; overflow-wrap: anywhere; } +@media (max-width: 1099px) { + #workspace, #workspace.has-reference { grid-template-columns: minmax(0, 1fr); } + #workspace > .block { min-height: 328px; } + #workspace .cm-editor { height: 300px; } + .abi-details { grid-template-columns: minmax(0, 1fr); gap: 12px; } +} +@media (max-width: 800px) { #results { grid-template-columns: minmax(0, 1fr); } } +@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } } diff --git a/demo/workbench.js b/demo/workbench.js new file mode 100644 index 0000000000000000000000000000000000000000..cc81bd29be7a6dfa5c288992a9067a3ce2d551a4 --- /dev/null +++ b/demo/workbench.js @@ -0,0 +1,32 @@ +(() => { + // Gradio's built-in Code copy controls have empty accessible names. + const labelPanes = () => { + for (const [id, label] of [ + ["candidate-source", "Candidate C"], + ["reference-source", "Reference C"], + ["original-assembly", "Original assembly"], + ["candidate-assembly", "Candidate assembly"], + ]) { + const pane = document.getElementById(id); + if (!pane) continue; + const copy = pane.querySelector("button.icon-button"); + if (copy && copy.getAttribute("aria-label") !== `Copy ${label}`) { + copy.setAttribute("aria-label", `Copy ${label}`); + copy.setAttribute("title", `Copy ${label}`); + } + const content = pane.querySelector(".cm-content"); + if (content && content.getAttribute("aria-label") !== label) { + content.setAttribute("aria-label", label); + } + const scroller = pane.querySelector(".cm-scroller"); + if (id !== "candidate-source" && scroller && scroller.tabIndex !== 0) { + scroller.tabIndex = 0; + scroller.setAttribute("aria-label", `${label} scroll area`); + } + } + }; + labelPanes(); + new MutationObserver(labelPanes).observe(document.body, { + childList: true, subtree: true, + }); +})(); diff --git a/examples/COPYING b/examples/COPYING new file mode 100644 index 0000000000000000000000000000000000000000..f288702d2fa16d3cdf0035b15a9fcbc552cd88e7 --- /dev/null +++ b/examples/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/examples/binaries/byte-swap.elf b/examples/binaries/byte-swap.elf new file mode 100644 index 0000000000000000000000000000000000000000..dd518fcfd92791d7dd2a37f0f3748bea5f2cdfd9 Binary files /dev/null and b/examples/binaries/byte-swap.elf differ diff --git a/examples/binaries/factor b/examples/binaries/factor new file mode 100644 index 0000000000000000000000000000000000000000..1bf9077eaf01134644e0cd0c2e78b062537bb8ef Binary files /dev/null and b/examples/binaries/factor differ diff --git a/examples/binaries/float-identity.elf b/examples/binaries/float-identity.elf new file mode 100644 index 0000000000000000000000000000000000000000..3f0a7703600e0c364f3aa2dd902ade041d8f6065 Binary files /dev/null and b/examples/binaries/float-identity.elf differ diff --git a/examples/binaries/format-string.elf b/examples/binaries/format-string.elf new file mode 100644 index 0000000000000000000000000000000000000000..0c1aeab6c00a59071c78d968bd96a3eb4a5140ed Binary files /dev/null and b/examples/binaries/format-string.elf differ diff --git a/examples/binaries/ghidra-byte-swap.elf b/examples/binaries/ghidra-byte-swap.elf new file mode 100644 index 0000000000000000000000000000000000000000..dd518fcfd92791d7dd2a37f0f3748bea5f2cdfd9 Binary files /dev/null and b/examples/binaries/ghidra-byte-swap.elf differ diff --git a/examples/binaries/ghidra-float-identity.elf b/examples/binaries/ghidra-float-identity.elf new file mode 100644 index 0000000000000000000000000000000000000000..3f0a7703600e0c364f3aa2dd902ade041d8f6065 Binary files /dev/null and b/examples/binaries/ghidra-float-identity.elf differ diff --git a/examples/binaries/ghidra-format-string.elf b/examples/binaries/ghidra-format-string.elf new file mode 100644 index 0000000000000000000000000000000000000000..0c1aeab6c00a59071c78d968bd96a3eb4a5140ed Binary files /dev/null and b/examples/binaries/ghidra-format-string.elf differ diff --git a/examples/binaries/ghidra-hello-goodbye.elf b/examples/binaries/ghidra-hello-goodbye.elf new file mode 100644 index 0000000000000000000000000000000000000000..130aa1e65c5551f872c6dd99a7eb3f593cdd241a Binary files /dev/null and b/examples/binaries/ghidra-hello-goodbye.elf differ diff --git a/examples/binaries/ghidra-hello-world.elf b/examples/binaries/ghidra-hello-world.elf new file mode 100644 index 0000000000000000000000000000000000000000..099e58c2db5e3d001d846af43ea63ca4c529382e Binary files /dev/null and b/examples/binaries/ghidra-hello-world.elf differ diff --git a/examples/binaries/ghidra-identical.elf b/examples/binaries/ghidra-identical.elf new file mode 100644 index 0000000000000000000000000000000000000000..7f2bce44a7fe9861845a3faeed2385dc8101c129 Binary files /dev/null and b/examples/binaries/ghidra-identical.elf differ diff --git a/examples/binaries/ghidra-malloc.elf b/examples/binaries/ghidra-malloc.elf new file mode 100644 index 0000000000000000000000000000000000000000..015dc02e2fb40de0b18a65e918c062fa9951effb Binary files /dev/null and b/examples/binaries/ghidra-malloc.elf differ diff --git a/examples/binaries/ghidra-nan-payload.elf b/examples/binaries/ghidra-nan-payload.elf new file mode 100644 index 0000000000000000000000000000000000000000..9efba750aa78853bc28468f0cdc990aceff46dcc Binary files /dev/null and b/examples/binaries/ghidra-nan-payload.elf differ diff --git a/examples/binaries/ghidra-pointer-identity.elf b/examples/binaries/ghidra-pointer-identity.elf new file mode 100644 index 0000000000000000000000000000000000000000..712c2f4c3974e97f435b0cad0236980b96c92d95 Binary files /dev/null and b/examples/binaries/ghidra-pointer-identity.elf differ diff --git a/examples/binaries/ghidra-population-count.elf b/examples/binaries/ghidra-population-count.elf new file mode 100644 index 0000000000000000000000000000000000000000..081ecd6cd0cd144ac4fa5fc30885a927567392b4 Binary files /dev/null and b/examples/binaries/ghidra-population-count.elf differ diff --git a/examples/binaries/ghidra-sign-extension.elf b/examples/binaries/ghidra-sign-extension.elf new file mode 100644 index 0000000000000000000000000000000000000000..189dc973c43c95e1c88aaadeef7095c4822fbc80 Binary files /dev/null and b/examples/binaries/ghidra-sign-extension.elf differ diff --git a/examples/binaries/ghidra-signed-zero.elf b/examples/binaries/ghidra-signed-zero.elf new file mode 100644 index 0000000000000000000000000000000000000000..3b7794bafb45d5766acbe2ee1d4dd69cf74b30eb Binary files /dev/null and b/examples/binaries/ghidra-signed-zero.elf differ diff --git a/examples/binaries/ghidra-struct-fields.elf b/examples/binaries/ghidra-struct-fields.elf new file mode 100644 index 0000000000000000000000000000000000000000..5ca71fd6bb16713308f4558df9ac36167ec1becf Binary files /dev/null and b/examples/binaries/ghidra-struct-fields.elf differ diff --git a/examples/binaries/ghidra-struct-indirect.elf b/examples/binaries/ghidra-struct-indirect.elf new file mode 100644 index 0000000000000000000000000000000000000000..c9506e4d717d4350ad8a0a04a31cd64c840e2ae0 Binary files /dev/null and b/examples/binaries/ghidra-struct-indirect.elf differ diff --git a/examples/binaries/ghidra-struct-padding.elf b/examples/binaries/ghidra-struct-padding.elf new file mode 100644 index 0000000000000000000000000000000000000000..2604d69b888e8e23b99efd313b7da921dd8cc07e Binary files /dev/null and b/examples/binaries/ghidra-struct-padding.elf differ diff --git a/examples/binaries/ghidra-tail-call.elf b/examples/binaries/ghidra-tail-call.elf new file mode 100644 index 0000000000000000000000000000000000000000..6477f103ae6539920d128cad5978eeb914057e7d Binary files /dev/null and b/examples/binaries/ghidra-tail-call.elf differ diff --git a/examples/binaries/ghidra-transient-global.elf b/examples/binaries/ghidra-transient-global.elf new file mode 100644 index 0000000000000000000000000000000000000000..eeef6373736de7666d4c5d3020e4298a6f3bdb9c Binary files /dev/null and b/examples/binaries/ghidra-transient-global.elf differ diff --git a/examples/binaries/ghidra-unsigned-maximum.elf b/examples/binaries/ghidra-unsigned-maximum.elf new file mode 100644 index 0000000000000000000000000000000000000000..4e6d1f40a830b63be65e686a34fa4e5301d0d794 Binary files /dev/null and b/examples/binaries/ghidra-unsigned-maximum.elf differ diff --git a/examples/binaries/ghidra-void-memory.elf b/examples/binaries/ghidra-void-memory.elf new file mode 100644 index 0000000000000000000000000000000000000000..0b8312e3f52fd5df03eae8efb75e44169310285c Binary files /dev/null and b/examples/binaries/ghidra-void-memory.elf differ diff --git a/examples/binaries/ghidra-wide-integer.elf b/examples/binaries/ghidra-wide-integer.elf new file mode 100644 index 0000000000000000000000000000000000000000..11426b01da3ecdcbd5bac027a230ce561d4ebf9a Binary files /dev/null and b/examples/binaries/ghidra-wide-integer.elf differ diff --git a/examples/binaries/hello-goodbye.elf b/examples/binaries/hello-goodbye.elf new file mode 100644 index 0000000000000000000000000000000000000000..130aa1e65c5551f872c6dd99a7eb3f593cdd241a Binary files /dev/null and b/examples/binaries/hello-goodbye.elf differ diff --git a/examples/binaries/hello-world.elf b/examples/binaries/hello-world.elf new file mode 100644 index 0000000000000000000000000000000000000000..099e58c2db5e3d001d846af43ea63ca4c529382e Binary files /dev/null and b/examples/binaries/hello-world.elf differ diff --git a/examples/binaries/identical.elf b/examples/binaries/identical.elf new file mode 100644 index 0000000000000000000000000000000000000000..7f2bce44a7fe9861845a3faeed2385dc8101c129 Binary files /dev/null and b/examples/binaries/identical.elf differ diff --git a/examples/binaries/malloc.elf b/examples/binaries/malloc.elf new file mode 100644 index 0000000000000000000000000000000000000000..015dc02e2fb40de0b18a65e918c062fa9951effb Binary files /dev/null and b/examples/binaries/malloc.elf differ diff --git a/examples/binaries/nan-payload.elf b/examples/binaries/nan-payload.elf new file mode 100644 index 0000000000000000000000000000000000000000..9efba750aa78853bc28468f0cdc990aceff46dcc Binary files /dev/null and b/examples/binaries/nan-payload.elf differ diff --git a/examples/binaries/pointer-identity.elf b/examples/binaries/pointer-identity.elf new file mode 100644 index 0000000000000000000000000000000000000000..712c2f4c3974e97f435b0cad0236980b96c92d95 Binary files /dev/null and b/examples/binaries/pointer-identity.elf differ diff --git a/examples/binaries/population-count.elf b/examples/binaries/population-count.elf new file mode 100644 index 0000000000000000000000000000000000000000..081ecd6cd0cd144ac4fa5fc30885a927567392b4 Binary files /dev/null and b/examples/binaries/population-count.elf differ diff --git a/examples/binaries/rotate-vs-shift.elf b/examples/binaries/rotate-vs-shift.elf new file mode 100644 index 0000000000000000000000000000000000000000..7f2bce44a7fe9861845a3faeed2385dc8101c129 Binary files /dev/null and b/examples/binaries/rotate-vs-shift.elf differ diff --git a/examples/binaries/sign-extension.elf b/examples/binaries/sign-extension.elf new file mode 100644 index 0000000000000000000000000000000000000000..189dc973c43c95e1c88aaadeef7095c4822fbc80 Binary files /dev/null and b/examples/binaries/sign-extension.elf differ diff --git a/examples/binaries/signed-zero.elf b/examples/binaries/signed-zero.elf new file mode 100644 index 0000000000000000000000000000000000000000..3b7794bafb45d5766acbe2ee1d4dd69cf74b30eb Binary files /dev/null and b/examples/binaries/signed-zero.elf differ diff --git a/examples/binaries/struct-fields.elf b/examples/binaries/struct-fields.elf new file mode 100644 index 0000000000000000000000000000000000000000..5ca71fd6bb16713308f4558df9ac36167ec1becf Binary files /dev/null and b/examples/binaries/struct-fields.elf differ diff --git a/examples/binaries/struct-indirect.elf b/examples/binaries/struct-indirect.elf new file mode 100644 index 0000000000000000000000000000000000000000..c9506e4d717d4350ad8a0a04a31cd64c840e2ae0 Binary files /dev/null and b/examples/binaries/struct-indirect.elf differ diff --git a/examples/binaries/struct-padding.elf b/examples/binaries/struct-padding.elf new file mode 100644 index 0000000000000000000000000000000000000000..2604d69b888e8e23b99efd313b7da921dd8cc07e Binary files /dev/null and b/examples/binaries/struct-padding.elf differ diff --git a/examples/binaries/tail-call.elf b/examples/binaries/tail-call.elf new file mode 100644 index 0000000000000000000000000000000000000000..6477f103ae6539920d128cad5978eeb914057e7d Binary files /dev/null and b/examples/binaries/tail-call.elf differ diff --git a/examples/binaries/transient-global.elf b/examples/binaries/transient-global.elf new file mode 100644 index 0000000000000000000000000000000000000000..eeef6373736de7666d4c5d3020e4298a6f3bdb9c Binary files /dev/null and b/examples/binaries/transient-global.elf differ diff --git a/examples/binaries/unsigned-maximum.elf b/examples/binaries/unsigned-maximum.elf new file mode 100644 index 0000000000000000000000000000000000000000..4e6d1f40a830b63be65e686a34fa4e5301d0d794 Binary files /dev/null and b/examples/binaries/unsigned-maximum.elf differ diff --git a/examples/binaries/void-memory.elf b/examples/binaries/void-memory.elf new file mode 100644 index 0000000000000000000000000000000000000000..0b8312e3f52fd5df03eae8efb75e44169310285c Binary files /dev/null and b/examples/binaries/void-memory.elf differ diff --git a/examples/binaries/wide-integer.elf b/examples/binaries/wide-integer.elf new file mode 100644 index 0000000000000000000000000000000000000000..11426b01da3ecdcbd5bac027a230ce561d4ebf9a Binary files /dev/null and b/examples/binaries/wide-integer.elf differ diff --git a/examples/catalog.json b/examples/catalog.json new file mode 100644 index 0000000000000000000000000000000000000000..5d9e4fe1bd300528139403c1f2722eca7b93998f --- /dev/null +++ b/examples/catalog.json @@ -0,0 +1,1706 @@ +[ + { + "name": "identical", + "label": "Identical rotate", + "binary": "binaries/identical.elf", + "binary_sha256": "ed266f4b86e24a0dee0bb51537c72ca36a4969dbf71dd8d2e41ab26636b086d3", + "inputs": [ + "0x401000", + "#include \n\nuint32_t target(uint32_t b) {\n return (b << 13) | (b >> 19);\n}\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_prototype: unsigned int target(unsigned int b);\n" + ], + "reference": "#include \n\nuint32_t target(uint32_t b) {\n return (b << 13) | (b >> 19);\n}\n", + "expected_verdict": "agree" + }, + { + "name": "rotate-vs-shift", + "label": "Rotate versus shift", + "binary": "binaries/rotate-vs-shift.elf", + "binary_sha256": "ed266f4b86e24a0dee0bb51537c72ca36a4969dbf71dd8d2e41ab26636b086d3", + "inputs": [ + "0x401000", + "#include \n\nuint32_t target(uint32_t b) {\n return b << 13;\n}\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_prototype: unsigned int target(unsigned int b);\n" + ], + "reference": "#include \n\nuint32_t target(uint32_t b) {\n return (b << 13) | (b >> 19);\n}\n", + "expected_verdict": "mismatch" + }, + { + "name": "population-count", + "label": "Population count", + "binary": "binaries/population-count.elf", + "binary_sha256": "a67746d75fce366b0c9127d7868a715c188bb546ad1178f21e8b0fd432b6ea8d", + "inputs": [ + "0x401000", + "#include \n\n// Clear the lowest set bit on each iteration.\n// This loop should match the original's parallel bit-counting arithmetic.\nuint32_t target(uint32_t x) {\n uint32_t count = 0;\n while (x) {\n x &= x - 1;\n ++count;\n }\n return count;\n}\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_prototype: unsigned int target(unsigned int x);\n" + ], + "reference": "#include \n\nuint32_t target(uint32_t x) {\n x -= (x >> 1) & 0x55555555u;\n x = (x & 0x33333333u) + ((x >> 2) & 0x33333333u);\n x = (x + (x >> 4)) & 0x0f0f0f0fu;\n return (x * 0x01010101u) >> 24;\n}\n", + "expected_verdict": "agree" + }, + { + "name": "unsigned-maximum", + "label": "Unsigned maximum", + "binary": "binaries/unsigned-maximum.elf", + "binary_sha256": "8134647f27086ce0afe1c9b34b667b2ed0ab362562e2aaeeaa5120b26b093e7c", + "inputs": [ + "0x401000", + "#include \n\n// A signed comparison changes which value wins when bit 31 differs.\nuint32_t target(uint32_t a, uint32_t b) {\n return (int32_t)a > (int32_t)b ? a : b;\n}\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_prototype: unsigned int target(unsigned int a, unsigned int b);\n" + ], + "reference": "#include \n\nuint32_t target(uint32_t a, uint32_t b) {\n return a > b ? a : b;\n}\n", + "expected_verdict": "mismatch" + }, + { + "name": "byte-swap", + "label": "Byte swap versus rotate", + "binary": "binaries/byte-swap.elf", + "binary_sha256": "6ce33f58d80b63a69164aead5ce15fdb6391aca39f0cc4cd7ac3c382ccb530fe", + "inputs": [ + "0x401000", + "#include \n\n// Swapping the two halfwords leaves the bytes within each halfword unchanged.\nuint32_t target(uint32_t x) {\n return (x << 16) | (x >> 16);\n}\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_prototype: unsigned int target(unsigned int x);\n" + ], + "reference": "#include \n\nuint32_t target(uint32_t x) {\n return __builtin_bswap32(x);\n}\n", + "expected_verdict": "mismatch" + }, + { + "name": "sign-extension", + "label": "Sign extension", + "binary": "binaries/sign-extension.elf", + "binary_sha256": "f14c44b97f79bbef5f1ec653f6dc029f5e97451bc17db2934c4dce851b609c6d", + "inputs": [ + "0x401000", + "#include \n\n// Zero extension loses the sign of a negative low byte.\nint32_t target(uint32_t x) {\n return (uint8_t)x;\n}\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_prototype: int target(unsigned int x);\n" + ], + "reference": "#include \n\nint32_t target(uint32_t x) {\n return (int8_t)x;\n}\n", + "expected_verdict": "mismatch" + }, + { + "name": "hello-goodbye", + "label": "Hello versus goodbye", + "binary": "binaries/hello-goodbye.elf", + "binary_sha256": "ab00d3407494aaba2993945265484e1fc85e3be779081ca75bdcce12093cadce", + "inputs": [ + "0x401000", + "extern char out[16];\nextern void observe(const void *);\nunsigned target(unsigned x) {\n __builtin_strcpy(out, \"goodbye\");\n observe(out);\n return x;\n}\n", + "callees:\n observe: '0x401030'\nglobals:\n out: '0x403000'\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_prototype: unsigned int target(unsigned int x);\n" + ], + "reference": "char out[16];\nvoid observe(const void *);\nunsigned target(unsigned x) {\n __builtin_strcpy(out, \"hello\");\n observe(out);\n return x;\n}\n", + "expected_verdict": "mismatch" + }, + { + "name": "hello-world", + "label": "Hello world printf", + "binary": "binaries/hello-world.elf", + "binary_sha256": "b431776c7eae9f4539764ffb17302371d322c07fb0368ce5e8b9cfbc7635adc4", + "inputs": [ + "0x401000", + "extern int printf(const char *, ...);\n\nint target(void) {\n printf(\"hello world\\n\");\n return 0;\n}\n", + "callees:\n printf: '0x401020'\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2 -fno-builtin", + "callee_interfaces:\n printf:\n variadic_types: []\nmemory_ranges:\n printf:\n 0: 13\noriginal_prototype: int target(void);\n" + ], + "reference": "int printf(const char *, ...);\n\nint target(void) {\n printf(\"hello world\\n\");\n return 0;\n}\n", + "expected_verdict": "agree" + }, + { + "name": "malloc", + "label": "Malloc pointer return", + "binary": "binaries/malloc.elf", + "binary_sha256": "25c4bf043f04e90cd1e7d54b90d61c9dfc24c41b65ffd87e0496b91c1467c3f2", + "inputs": [ + "0x401000", + "extern void *malloc(unsigned long);\n\nvoid *target(unsigned long size) {\n return malloc(size);\n}\n", + "callees:\n malloc: '0x401010'\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2 -fno-builtin", + "original_prototype: void * target(unsigned long size);\n" + ], + "reference": "void *malloc(unsigned long);\n\nvoid *target(unsigned long size) {\n return malloc(size);\n}\n", + "expected_verdict": "agree" + }, + { + "name": "format-string", + "label": "Shared format string", + "binary": "binaries/format-string.elf", + "binary_sha256": "34939255714fccbe44aeed7be5e3743d405b755ae405a2cacc5e12055b3f3080", + "inputs": [ + "0x401000", + "extern unsigned format(const char *);\nunsigned target(unsigned x) {\n return (format(\"value: %u\") & 1) ? x + 11 : x + 29;\n}\n", + "callees:\n format: '0x401030'\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "memory_ranges:\n format:\n 0: 10\noriginal_prototype: unsigned int target(unsigned int x);\n" + ], + "reference": "unsigned format(const char *);\nunsigned target(unsigned x) {\n return (format(\"value: %u\") & 1) ? x + 11 : x + 29;\n}\n", + "expected_verdict": "agree" + }, + { + "name": "transient-global", + "label": "Transient global write", + "binary": "binaries/transient-global.elf", + "binary_sha256": "ae3efe79e92a97b196a13e405820c4bfebf1365e3ef6d04161916d85b311c297", + "inputs": [ + "0x401000", + "extern volatile unsigned g;\nextern unsigned foo(unsigned);\nunsigned target(unsigned x) {\n g = 2;\n foo(x);\n g = 3;\n return x;\n}\n", + "callees:\n foo: '0x401030'\nglobals:\n g: '0x403000'\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_prototype: unsigned int target(unsigned int x);\n" + ], + "reference": "volatile unsigned g;\nunsigned foo(unsigned);\nunsigned target(unsigned x) {\n g = 1;\n foo(x);\n g = 3;\n return x;\n}\n", + "expected_verdict": "mismatch" + }, + { + "name": "tail-call", + "label": "Tail call", + "binary": "binaries/tail-call.elf", + "binary_sha256": "f43e9cba13b6f8df9d7215a6757b8a8bb731457bef1a28ddd1855c4892c0f612", + "inputs": [ + "0x401000", + "extern unsigned foo(unsigned);\nunsigned target(unsigned x) {\n /* The volatile local keeps this a normal call at -O2. */\n volatile unsigned result = foo(x);\n return result;\n}\n", + "callees:\n foo: '0x401010'\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_prototype: unsigned int target(unsigned int x);\n" + ], + "reference": "unsigned foo(unsigned);\nunsigned target(unsigned x) { return foo(x); }\n", + "expected_verdict": "agree" + }, + { + "name": "wide-integer", + "label": "128-bit integer truncation", + "binary": "binaries/wide-integer.elf", + "binary_sha256": "9c65a2af785fb889e890664298de3fb5b915a5eeb19a89bee46360a5b73a5905", + "inputs": [ + "0x401000", + "#include \n\nunsigned __int128 target(unsigned __int128 x) {\n /* A decompiler loses the upper half of the input. */\n return (uint64_t)x + (unsigned __int128)7;\n}\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_prototype: unsigned __int128 target(unsigned __int128 x);\n" + ], + "reference": "unsigned __int128 target(unsigned __int128 x) {\n return x + 7;\n}\n", + "expected_verdict": "mismatch" + }, + { + "name": "float-identity", + "label": "Float identity", + "binary": "binaries/float-identity.elf", + "binary_sha256": "31210459dda670d87cd7911a06d12862dc1c6f40384a876be65f09aeb43e5a7d", + "inputs": [ + "0x401000", + "float target(float x) {\n return x;\n}\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_prototype: float target(float x);\n" + ], + "reference": "float target(float x) {\n return x;\n}\n", + "expected_verdict": "agree" + }, + { + "name": "signed-zero", + "label": "Double signed zero", + "binary": "binaries/signed-zero.elf", + "binary_sha256": "7e22e5995a6a10efe68502f4b8420199c0d4097b4a9b2a933cc137f0dcbd3d9d", + "inputs": [ + "0x401000", + "double target(void) {\n /* Numerically equal, but the sign bit differs. */\n return -0.0;\n}\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_prototype: double target(void);\n" + ], + "reference": "double target(void) {\n return 0.0;\n}\n", + "expected_verdict": "mismatch" + }, + { + "name": "nan-payload", + "label": "Double NaN payload", + "binary": "binaries/nan-payload.elf", + "binary_sha256": "253009e2afa992db2a2b5ce621e45b8009ad85ee5faf04b35b695239c83ebfb7", + "inputs": [ + "0x401000", + "#include \n\ndouble target(void) {\n /* Both results are quiet NaNs, but their payload bits differ. */\n union { uint64_t bits; double value; } nan = { .bits = UINT64_C(0x7ff8000000000002) };\n return nan.value;\n}\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_prototype: double target(void);\n" + ], + "reference": "#include \n\ndouble target(void) {\n union { uint64_t bits; double value; } nan = { .bits = UINT64_C(0x7ff8000000000001) };\n return nan.value;\n}\n", + "expected_verdict": "mismatch" + }, + { + "name": "struct-fields", + "label": "Struct field difference", + "binary": "binaries/struct-fields.elf", + "binary_sha256": "2b1504a5f36ab87d389be925fb6afaf19b7e7a53678a933ce5336652c51fca50", + "inputs": [ + "0x401000", + "#include \n\nstruct Pair { uint64_t first, second; };\n\nstruct Pair target(struct Pair x) {\n /* Only the first returned field differs. */\n x.first += 4;\n return x;\n}\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_prototype: '#include \n\n struct Pair { uint64_t first, second; };\n\n struct Pair target(struct Pair x);\n\n '\n" + ], + "reference": "#include \n\nstruct Pair { uint64_t first, second; };\n\nstruct Pair target(struct Pair x) {\n x.first += 3;\n return x;\n}\n", + "expected_verdict": "mismatch" + }, + { + "name": "struct-indirect", + "label": "Large struct return", + "binary": "binaries/struct-indirect.elf", + "binary_sha256": "2b5d94eeea99772bc228d54c66ebd03b3beca9060ed12cb4286f94330bb04318", + "inputs": [ + "0x401000", + "#include \n\nstruct Triple { uint64_t first, second, third; };\n\nstruct Triple target(struct Triple x) {\n /* Reconstructing every field preserves the returned value. */\n return (struct Triple){ x.first + 3, x.second, x.third };\n}\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_prototype: '#include \n\n struct Triple { uint64_t first, second, third; };\n\n struct Triple target(struct Triple x);\n\n '\n" + ], + "reference": "#include \n\nstruct Triple { uint64_t first, second, third; };\n\nstruct Triple target(struct Triple x) {\n x.first += 3;\n return x;\n}\n", + "expected_verdict": "agree" + }, + { + "name": "struct-padding", + "label": "Struct padding", + "binary": "binaries/struct-padding.elf", + "binary_sha256": "f2f978dfd8f491547d9d7ae586f7b6c536ed7291760a30b61319931a69e34ef5", + "inputs": [ + "0x401000", + "#include \n\nstruct Record { uint8_t tag; uint64_t value; };\n\nstruct Record target(void) {\n struct Record result;\n /* Padding changes; the returned fields still match. */\n __builtin_memset(&result, 0xbb, sizeof result);\n result.tag = 1;\n result.value = 2;\n return result;\n}\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_prototype: '#include \n\n struct Record { uint8_t tag; uint64_t value; };\n\n struct Record target(void);\n\n '\n" + ], + "reference": "#include \n\nstruct Record { uint8_t tag; uint64_t value; };\n\nstruct Record target(void) {\n struct Record result;\n __builtin_memset(&result, 0xaa, sizeof result);\n result.tag = 1;\n result.value = 2;\n return result;\n}\n", + "expected_verdict": "agree" + }, + { + "name": "pointer-identity", + "label": "Pointer identity", + "binary": "binaries/pointer-identity.elf", + "binary_sha256": "5c3cc2e9fc9af5915812dd54613e4b5716442fcc178eb63c5c2402fc73c88886", + "inputs": [ + "0x401000", + "const void *target(const void *p) {\n /* The pointer is a value; its contents are not read. */\n return p;\n}\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_prototype: void * target(void * p);\n" + ], + "reference": "const void *target(const void *p) {\n return p;\n}\n", + "expected_verdict": "agree" + }, + { + "name": "void-memory", + "label": "Void return with memory write", + "binary": "binaries/void-memory.elf", + "binary_sha256": "067e6f54cff95e14978d44c952a3cb546071412fe2e4d7744599090938a99649", + "inputs": [ + "0x401000", + "extern unsigned output;\n\nvoid target(unsigned x) {\n /* A void return still permits observable differences in memory. */\n output = x ^ 1;\n}\n", + "callees: {}\nglobals:\n output: '0x403000'\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_prototype: void target(unsigned int x);\n" + ], + "reference": "unsigned output;\n\nvoid target(unsigned x) {\n output = x;\n}\n", + "expected_verdict": "mismatch" + }, + { + "name": "factor-gcd", + "label": "factor: binary GCD", + "binary": "binaries/factor", + "binary_sha256": "c87caacbd2a40fb4e16398e8cf1d7aceca214af64b09e9635ebdbb449898478b", + "inputs": [ + "0x403300", + "/* Reconstructed from /usr/bin/factor's shift/subtract gcd_odd helper. */\nunsigned long target(unsigned long a, unsigned long b) {\n if (b & 1) {\n unsigned long swap = a;\n a = b;\n b = swap;\n }\n if (!b) return a;\n a >>= 1;\n for (;;) {\n while (!(b & 1)) b >>= 1;\n unsigned long half = b >> 1;\n if (half == a) return b;\n if (half < a) {\n b = a - half;\n a = half;\n } else {\n b = half - a;\n }\n }\n}\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_base: 4194304\noriginal_prototype: unsigned long gcd_odd(unsigned long a, unsigned long b);\n" + ], + "reference": "", + "expected_verdict": "agree" + }, + { + "name": "factor-gcd-euclidean", + "label": "factor: Euclidean GCD", + "binary": "binaries/factor", + "binary_sha256": "c87caacbd2a40fb4e16398e8cf1d7aceca214af64b09e9635ebdbb449898478b", + "inputs": [ + "0x403300", + "/* Euclid's algorithm, preserving the binary's behavior for even inputs too. */\nunsigned long target(unsigned long a, unsigned long b) {\n if (!b) return a;\n if (!(b & 1)) a |= 1;\n while (b) {\n unsigned long remainder = a % b;\n a = b;\n b = remainder;\n }\n return a;\n}\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_base: 4194304\noriginal_prototype: unsigned long gcd_odd(unsigned long a, unsigned long b);\n" + ], + "reference": "", + "expected_verdict": "agree" + }, + { + "name": "factor-gcd-even", + "label": "factor: even-input assumption", + "binary": "binaries/factor", + "binary_sha256": "c87caacbd2a40fb4e16398e8cf1d7aceca214af64b09e9635ebdbb449898478b", + "inputs": [ + "0x403300", + "/* A plausible rewrite loses the original helper's odd-operand assumption. */\nunsigned long target(unsigned long a, unsigned long b) {\n while (b) {\n unsigned long remainder = a % b;\n a = b;\n b = remainder;\n }\n return a;\n}\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_base: 4194304\noriginal_prototype: unsigned long gcd_odd(unsigned long a, unsigned long b);\n" + ], + "reference": "", + "expected_verdict": "mismatch" + }, + { + "name": "ghidra-identical", + "label": "Ghidra: identical", + "binary": "binaries/ghidra-identical.elf", + "binary_sha256": "ed266f4b86e24a0dee0bb51537c72ca36a4969dbf71dd8d2e41ab26636b086d3", + "inputs": [ + "0x401000", + "\n//==============================================================================\n// DATA TYPES \n// These types were decompiled from the binary and may not match original source\n//==============================================================================\n\ntypedef unsigned char undefined;\n\ntypedef unsigned char byte;\ntypedef unsigned char dwfenc;\ntypedef unsigned int dword;\ntypedef unsigned long qword;\ntypedef unsigned int uint;\ntypedef unsigned short word;\ntypedef unsigned long long unkbyte9;\ntypedef unsigned long long unkbyte10;\ntypedef unsigned long long unkbyte11;\ntypedef unsigned long long unkbyte12;\ntypedef unsigned long long unkbyte13;\ntypedef unsigned long long unkbyte14;\ntypedef unsigned long long unkbyte15;\ntypedef unsigned long long unkbyte16;\n\ntypedef unsigned long long unkuint9;\ntypedef unsigned long long unkuint10;\ntypedef unsigned long long unkuint11;\ntypedef unsigned long long unkuint12;\ntypedef unsigned long long unkuint13;\ntypedef unsigned long long unkuint14;\ntypedef unsigned long long unkuint15;\ntypedef unsigned long long unkuint16;\n\ntypedef long long unkint9;\ntypedef long long unkint10;\ntypedef long long unkint11;\ntypedef long long unkint12;\ntypedef long long unkint13;\ntypedef long long unkint14;\ntypedef long long unkint15;\ntypedef long long unkint16;\n\ntypedef float unkfloat1;\ntypedef float unkfloat2;\ntypedef float unkfloat3;\ntypedef double unkfloat5;\ntypedef double unkfloat6;\ntypedef double unkfloat7;\ntypedef long double unkfloat9;\ntypedef long double unkfloat11;\ntypedef long double unkfloat12;\ntypedef long double unkfloat13;\ntypedef long double unkfloat14;\ntypedef long double unkfloat15;\ntypedef long double unkfloat16;\n\ntypedef void BADSPACEBASE;\ntypedef void code;\n\n// C99 lacks bool, define it as byte for C-only output\n#if !defined(__cplusplus) && !defined(NO_BOOL)\ntypedef unsigned char bool;\n#endif\n\n\n\n\n\n//==============================================================================\n// FUNCTION DECLARATIONS \n// These function prototypes were extracted from binary analysis \n//==============================================================================\n\nuint target(uint param_1);\n\n\n//==============================================================================\n// FUNCTION IMPLEMENTATIONS \n// Decompiled code from the binary \n//==============================================================================\n\nuint target(uint param_1)\n\n{\n return param_1 << 0xd | param_1 >> 0x13;\n}\n\n\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_base: 4194304\noriginal_prototype: unsigned int target(unsigned int b);\n" + ], + "reference": "#include \n\nuint32_t target(uint32_t b) {\n return (b << 13) | (b >> 19);\n}\n", + "expected_verdict": "agree", + "ghidra": { + "adaptations": [], + "also_covers": [ + "rotate-vs-shift" + ], + "candidate_sha256": "708776d663ea18e760ed558c1aac9aaa0c2296b68e1940a5ebc96eeccc3cb850", + "candidate_symbol": "target", + "compiler": "gcc", + "expected_verdict": "agree", + "export_options": { + "address_set_str": "0x401000", + "run_decompiler_parameter_id": true + }, + "exported_globals": {}, + "exporter": { + "commit": "285529b434f6e46827e001c42eb1b090e187eaf9", + "repository": "https://github.com/edmcman/GhidraFunctionCPPExporter", + "sha256": "cb0d1c5c78f3c07cb2cc385165d9008efa112206acf488f1303d5c34458c3e67" + }, + "flags": "-O2", + "ghidra_revision": "8b4c91d4d5bd1549622bfbade0df199585b98365", + "ghidra_version": "12.1.3", + "image_base": "0x400000", + "input_binary_sha256": "ed266f4b86e24a0dee0bb51537c72ca36a4969dbf71dd8d2e41ab26636b086d3", + "input_toolchain": { + "clang": "Ubuntu clang version 18.1.3 (1ubuntu1)", + "gcc": "gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0" + }, + "interfaces_sha256": "078fc794c0385cc9e443f3b09420727b78da242a0ea39253889bab503189197b", + "original_bindings": "callees: {}\nglobals: {}\n", + "raw_sha256": "708776d663ea18e760ed558c1aac9aaa0c2296b68e1940a5ebc96eeccc3cb850", + "setup": [ + "Load at 0x400000 to match the verifier.", + "Treat the ELF target entry as an ordinary function using the default C calling convention; no source types supplied." + ], + "source_case": "identical" + }, + "expected_error": null + }, + { + "name": "ghidra-population-count", + "label": "Ghidra: population count", + "binary": "binaries/ghidra-population-count.elf", + "binary_sha256": "a67746d75fce366b0c9127d7868a715c188bb546ad1178f21e8b0fd432b6ea8d", + "inputs": [ + "0x401000", + "\n//==============================================================================\n// DATA TYPES \n// These types were decompiled from the binary and may not match original source\n//==============================================================================\n\ntypedef unsigned char undefined;\n\ntypedef unsigned char byte;\ntypedef unsigned char dwfenc;\ntypedef unsigned int dword;\ntypedef unsigned long qword;\ntypedef unsigned int uint;\ntypedef unsigned short word;\ntypedef unsigned long long unkbyte9;\ntypedef unsigned long long unkbyte10;\ntypedef unsigned long long unkbyte11;\ntypedef unsigned long long unkbyte12;\ntypedef unsigned long long unkbyte13;\ntypedef unsigned long long unkbyte14;\ntypedef unsigned long long unkbyte15;\ntypedef unsigned long long unkbyte16;\n\ntypedef unsigned long long unkuint9;\ntypedef unsigned long long unkuint10;\ntypedef unsigned long long unkuint11;\ntypedef unsigned long long unkuint12;\ntypedef unsigned long long unkuint13;\ntypedef unsigned long long unkuint14;\ntypedef unsigned long long unkuint15;\ntypedef unsigned long long unkuint16;\n\ntypedef long long unkint9;\ntypedef long long unkint10;\ntypedef long long unkint11;\ntypedef long long unkint12;\ntypedef long long unkint13;\ntypedef long long unkint14;\ntypedef long long unkint15;\ntypedef long long unkint16;\n\ntypedef float unkfloat1;\ntypedef float unkfloat2;\ntypedef float unkfloat3;\ntypedef double unkfloat5;\ntypedef double unkfloat6;\ntypedef double unkfloat7;\ntypedef long double unkfloat9;\ntypedef long double unkfloat11;\ntypedef long double unkfloat12;\ntypedef long double unkfloat13;\ntypedef long double unkfloat14;\ntypedef long double unkfloat15;\ntypedef long double unkfloat16;\n\ntypedef void BADSPACEBASE;\ntypedef void code;\n\n// C99 lacks bool, define it as byte for C-only output\n#if !defined(__cplusplus) && !defined(NO_BOOL)\ntypedef unsigned char bool;\n#endif\n\n\n\n\n\n//==============================================================================\n// FUNCTION DECLARATIONS \n// These function prototypes were extracted from binary analysis \n//==============================================================================\n\nuint target(uint param_1);\n\n\n//==============================================================================\n// FUNCTION IMPLEMENTATIONS \n// Decompiled code from the binary \n//==============================================================================\n\nuint target(uint param_1)\n\n{\n uint uVar1;\n \n uVar1 = param_1 - (param_1 >> 1 & 0x55555555);\n uVar1 = (uVar1 & 0x33333333) + (uVar1 >> 2 & 0x33333333);\n return ((uVar1 >> 4) + uVar1 & 0xf0f0f0f) * 0x1010101 >> 0x18;\n}\n\n\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_base: 4194304\noriginal_prototype: unsigned int target(unsigned int x);\n" + ], + "reference": "#include \n\nuint32_t target(uint32_t x) {\n x -= (x >> 1) & 0x55555555u;\n x = (x & 0x33333333u) + ((x >> 2) & 0x33333333u);\n x = (x + (x >> 4)) & 0x0f0f0f0fu;\n return (x * 0x01010101u) >> 24;\n}\n", + "expected_verdict": "agree", + "ghidra": { + "adaptations": [], + "also_covers": [], + "candidate_sha256": "b5c5f46f35a431be7fc9c484b70b083c0c013bf572ea1dfacc4f28376fb45e88", + "candidate_symbol": "target", + "compiler": "gcc", + "expected_verdict": "agree", + "export_options": { + "address_set_str": "0x401000", + "run_decompiler_parameter_id": true + }, + "exported_globals": {}, + "exporter": { + "commit": "285529b434f6e46827e001c42eb1b090e187eaf9", + "repository": "https://github.com/edmcman/GhidraFunctionCPPExporter", + "sha256": "cb0d1c5c78f3c07cb2cc385165d9008efa112206acf488f1303d5c34458c3e67" + }, + "flags": "-O2", + "ghidra_revision": "8b4c91d4d5bd1549622bfbade0df199585b98365", + "ghidra_version": "12.1.3", + "image_base": "0x400000", + "input_binary_sha256": "a67746d75fce366b0c9127d7868a715c188bb546ad1178f21e8b0fd432b6ea8d", + "input_toolchain": { + "clang": "Ubuntu clang version 18.1.3 (1ubuntu1)", + "gcc": "gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0" + }, + "interfaces_sha256": "eee2da234a187d744013266114b7540f3f15c680df1ad37b671215952037ba78", + "original_bindings": "callees: {}\nglobals: {}\n", + "raw_sha256": "b5c5f46f35a431be7fc9c484b70b083c0c013bf572ea1dfacc4f28376fb45e88", + "setup": [ + "Load at 0x400000 to match the verifier.", + "Treat the ELF target entry as an ordinary function using the default C calling convention; no source types supplied." + ], + "source_case": "population-count" + }, + "expected_error": null + }, + { + "name": "ghidra-unsigned-maximum", + "label": "Ghidra: unsigned maximum", + "binary": "binaries/ghidra-unsigned-maximum.elf", + "binary_sha256": "8134647f27086ce0afe1c9b34b667b2ed0ab362562e2aaeeaa5120b26b093e7c", + "inputs": [ + "0x401000", + "\n//==============================================================================\n// DATA TYPES \n// These types were decompiled from the binary and may not match original source\n//==============================================================================\n\ntypedef unsigned char undefined;\n\ntypedef unsigned char byte;\ntypedef unsigned char dwfenc;\ntypedef unsigned int dword;\ntypedef unsigned long qword;\ntypedef unsigned int uint;\ntypedef unsigned short word;\ntypedef unsigned long long unkbyte9;\ntypedef unsigned long long unkbyte10;\ntypedef unsigned long long unkbyte11;\ntypedef unsigned long long unkbyte12;\ntypedef unsigned long long unkbyte13;\ntypedef unsigned long long unkbyte14;\ntypedef unsigned long long unkbyte15;\ntypedef unsigned long long unkbyte16;\n\ntypedef unsigned long long unkuint9;\ntypedef unsigned long long unkuint10;\ntypedef unsigned long long unkuint11;\ntypedef unsigned long long unkuint12;\ntypedef unsigned long long unkuint13;\ntypedef unsigned long long unkuint14;\ntypedef unsigned long long unkuint15;\ntypedef unsigned long long unkuint16;\n\ntypedef long long unkint9;\ntypedef long long unkint10;\ntypedef long long unkint11;\ntypedef long long unkint12;\ntypedef long long unkint13;\ntypedef long long unkint14;\ntypedef long long unkint15;\ntypedef long long unkint16;\n\ntypedef float unkfloat1;\ntypedef float unkfloat2;\ntypedef float unkfloat3;\ntypedef double unkfloat5;\ntypedef double unkfloat6;\ntypedef double unkfloat7;\ntypedef long double unkfloat9;\ntypedef long double unkfloat11;\ntypedef long double unkfloat12;\ntypedef long double unkfloat13;\ntypedef long double unkfloat14;\ntypedef long double unkfloat15;\ntypedef long double unkfloat16;\n\ntypedef void BADSPACEBASE;\ntypedef void code;\n\n// C99 lacks bool, define it as byte for C-only output\n#if !defined(__cplusplus) && !defined(NO_BOOL)\ntypedef unsigned char bool;\n#endif\n\n\n\n\n\n//==============================================================================\n// FUNCTION DECLARATIONS \n// These function prototypes were extracted from binary analysis \n//==============================================================================\n\nuint target(uint param_1,uint param_2);\n\n\n//==============================================================================\n// FUNCTION IMPLEMENTATIONS \n// Decompiled code from the binary \n//==============================================================================\n\nuint target(uint param_1,uint param_2)\n\n{\n if (param_1 <= param_2) {\n param_1 = param_2;\n }\n return param_1;\n}\n\n\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_base: 4194304\noriginal_prototype: unsigned int target(unsigned int a, unsigned int b);\n" + ], + "reference": "#include \n\nuint32_t target(uint32_t a, uint32_t b) {\n return a > b ? a : b;\n}\n", + "expected_verdict": "agree", + "ghidra": { + "adaptations": [], + "also_covers": [], + "candidate_sha256": "85e88fa4de78bfe45173d4db23c8c9f4dd783a1f157869642e2024d11d7fb1f7", + "candidate_symbol": "target", + "compiler": "gcc", + "expected_verdict": "agree", + "export_options": { + "address_set_str": "0x401000", + "run_decompiler_parameter_id": true + }, + "exported_globals": {}, + "exporter": { + "commit": "285529b434f6e46827e001c42eb1b090e187eaf9", + "repository": "https://github.com/edmcman/GhidraFunctionCPPExporter", + "sha256": "cb0d1c5c78f3c07cb2cc385165d9008efa112206acf488f1303d5c34458c3e67" + }, + "flags": "-O2", + "ghidra_revision": "8b4c91d4d5bd1549622bfbade0df199585b98365", + "ghidra_version": "12.1.3", + "image_base": "0x400000", + "input_binary_sha256": "8134647f27086ce0afe1c9b34b667b2ed0ab362562e2aaeeaa5120b26b093e7c", + "input_toolchain": { + "clang": "Ubuntu clang version 18.1.3 (1ubuntu1)", + "gcc": "gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0" + }, + "interfaces_sha256": "b812b242072b24992de43b4de9634edec34196196a020e6887e1e5e3efd52c4b", + "original_bindings": "callees: {}\nglobals: {}\n", + "raw_sha256": "85e88fa4de78bfe45173d4db23c8c9f4dd783a1f157869642e2024d11d7fb1f7", + "setup": [ + "Load at 0x400000 to match the verifier.", + "Treat the ELF target entry as an ordinary function using the default C calling convention; no source types supplied." + ], + "source_case": "unsigned-maximum" + }, + "expected_error": null + }, + { + "name": "ghidra-byte-swap", + "label": "Ghidra: byte swap", + "binary": "binaries/ghidra-byte-swap.elf", + "binary_sha256": "6ce33f58d80b63a69164aead5ce15fdb6391aca39f0cc4cd7ac3c382ccb530fe", + "inputs": [ + "0x401000", + "\n//==============================================================================\n// DATA TYPES \n// These types were decompiled from the binary and may not match original source\n//==============================================================================\n\ntypedef unsigned char undefined;\n\ntypedef unsigned char byte;\ntypedef unsigned char dwfenc;\ntypedef unsigned int dword;\ntypedef unsigned long qword;\ntypedef unsigned int uint;\ntypedef unsigned short word;\ntypedef unsigned long long unkbyte9;\ntypedef unsigned long long unkbyte10;\ntypedef unsigned long long unkbyte11;\ntypedef unsigned long long unkbyte12;\ntypedef unsigned long long unkbyte13;\ntypedef unsigned long long unkbyte14;\ntypedef unsigned long long unkbyte15;\ntypedef unsigned long long unkbyte16;\n\ntypedef unsigned long long unkuint9;\ntypedef unsigned long long unkuint10;\ntypedef unsigned long long unkuint11;\ntypedef unsigned long long unkuint12;\ntypedef unsigned long long unkuint13;\ntypedef unsigned long long unkuint14;\ntypedef unsigned long long unkuint15;\ntypedef unsigned long long unkuint16;\n\ntypedef long long unkint9;\ntypedef long long unkint10;\ntypedef long long unkint11;\ntypedef long long unkint12;\ntypedef long long unkint13;\ntypedef long long unkint14;\ntypedef long long unkint15;\ntypedef long long unkint16;\n\ntypedef float unkfloat1;\ntypedef float unkfloat2;\ntypedef float unkfloat3;\ntypedef double unkfloat5;\ntypedef double unkfloat6;\ntypedef double unkfloat7;\ntypedef long double unkfloat9;\ntypedef long double unkfloat11;\ntypedef long double unkfloat12;\ntypedef long double unkfloat13;\ntypedef long double unkfloat14;\ntypedef long double unkfloat15;\ntypedef long double unkfloat16;\n\ntypedef void BADSPACEBASE;\ntypedef void code;\n\n// C99 lacks bool, define it as byte for C-only output\n#if !defined(__cplusplus) && !defined(NO_BOOL)\ntypedef unsigned char bool;\n#endif\n\n\n\n\n\n//==============================================================================\n// FUNCTION DECLARATIONS \n// These function prototypes were extracted from binary analysis \n//==============================================================================\n\nuint target(uint param_1);\n\n\n//==============================================================================\n// FUNCTION IMPLEMENTATIONS \n// Decompiled code from the binary \n//==============================================================================\n\nuint target(uint param_1)\n\n{\n return param_1 >> 0x18 | (param_1 & 0xff0000) >> 8 | (param_1 & 0xff00) << 8 | param_1 << 0x18;\n}\n\n\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_base: 4194304\noriginal_prototype: unsigned int target(unsigned int x);\n" + ], + "reference": "#include \n\nuint32_t target(uint32_t x) {\n return __builtin_bswap32(x);\n}\n", + "expected_verdict": "agree", + "ghidra": { + "adaptations": [], + "also_covers": [], + "candidate_sha256": "e9bf784b5b93cc816237f2f62835a4f117db9300acaec046326a1ed9644b7d44", + "candidate_symbol": "target", + "compiler": "gcc", + "expected_verdict": "agree", + "export_options": { + "address_set_str": "0x401000", + "run_decompiler_parameter_id": true + }, + "exported_globals": {}, + "exporter": { + "commit": "285529b434f6e46827e001c42eb1b090e187eaf9", + "repository": "https://github.com/edmcman/GhidraFunctionCPPExporter", + "sha256": "cb0d1c5c78f3c07cb2cc385165d9008efa112206acf488f1303d5c34458c3e67" + }, + "flags": "-O2", + "ghidra_revision": "8b4c91d4d5bd1549622bfbade0df199585b98365", + "ghidra_version": "12.1.3", + "image_base": "0x400000", + "input_binary_sha256": "6ce33f58d80b63a69164aead5ce15fdb6391aca39f0cc4cd7ac3c382ccb530fe", + "input_toolchain": { + "clang": "Ubuntu clang version 18.1.3 (1ubuntu1)", + "gcc": "gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0" + }, + "interfaces_sha256": "eee2da234a187d744013266114b7540f3f15c680df1ad37b671215952037ba78", + "original_bindings": "callees: {}\nglobals: {}\n", + "raw_sha256": "e9bf784b5b93cc816237f2f62835a4f117db9300acaec046326a1ed9644b7d44", + "setup": [ + "Load at 0x400000 to match the verifier.", + "Treat the ELF target entry as an ordinary function using the default C calling convention; no source types supplied." + ], + "source_case": "byte-swap" + }, + "expected_error": null + }, + { + "name": "ghidra-sign-extension", + "label": "Ghidra: sign extension", + "binary": "binaries/ghidra-sign-extension.elf", + "binary_sha256": "f14c44b97f79bbef5f1ec653f6dc029f5e97451bc17db2934c4dce851b609c6d", + "inputs": [ + "0x401000", + "\n//==============================================================================\n// DATA TYPES \n// These types were decompiled from the binary and may not match original source\n//==============================================================================\n\ntypedef unsigned char undefined;\n\ntypedef unsigned char byte;\ntypedef unsigned char dwfenc;\ntypedef unsigned int dword;\ntypedef unsigned long qword;\ntypedef unsigned short word;\ntypedef unsigned long long unkbyte9;\ntypedef unsigned long long unkbyte10;\ntypedef unsigned long long unkbyte11;\ntypedef unsigned long long unkbyte12;\ntypedef unsigned long long unkbyte13;\ntypedef unsigned long long unkbyte14;\ntypedef unsigned long long unkbyte15;\ntypedef unsigned long long unkbyte16;\n\ntypedef unsigned long long unkuint9;\ntypedef unsigned long long unkuint10;\ntypedef unsigned long long unkuint11;\ntypedef unsigned long long unkuint12;\ntypedef unsigned long long unkuint13;\ntypedef unsigned long long unkuint14;\ntypedef unsigned long long unkuint15;\ntypedef unsigned long long unkuint16;\n\ntypedef long long unkint9;\ntypedef long long unkint10;\ntypedef long long unkint11;\ntypedef long long unkint12;\ntypedef long long unkint13;\ntypedef long long unkint14;\ntypedef long long unkint15;\ntypedef long long unkint16;\n\ntypedef float unkfloat1;\ntypedef float unkfloat2;\ntypedef float unkfloat3;\ntypedef double unkfloat5;\ntypedef double unkfloat6;\ntypedef double unkfloat7;\ntypedef long double unkfloat9;\ntypedef long double unkfloat11;\ntypedef long double unkfloat12;\ntypedef long double unkfloat13;\ntypedef long double unkfloat14;\ntypedef long double unkfloat15;\ntypedef long double unkfloat16;\n\ntypedef void BADSPACEBASE;\ntypedef void code;\n\n// C99 lacks bool, define it as byte for C-only output\n#if !defined(__cplusplus) && !defined(NO_BOOL)\ntypedef unsigned char bool;\n#endif\n\n\n\n\n\n//==============================================================================\n// FUNCTION DECLARATIONS \n// These function prototypes were extracted from binary analysis \n//==============================================================================\n\nint target(char param_1);\n\n\n//==============================================================================\n// FUNCTION IMPLEMENTATIONS \n// Decompiled code from the binary \n//==============================================================================\n\nint target(char param_1)\n\n{\n return (int)param_1;\n}\n\n\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_base: 4194304\noriginal_prototype: int target(unsigned int x);\n" + ], + "reference": "#include \n\nint32_t target(uint32_t x) {\n return (int8_t)x;\n}\n", + "expected_verdict": null, + "ghidra": { + "adaptations": [], + "also_covers": [], + "candidate_sha256": "925c658aa134738d6f1f2a47f80257ab0b73131f9db895395d5b8ada2cd0a41b", + "candidate_symbol": "target", + "compiler": "gcc", + "expected_error": "original and candidate logical types differ; supply original_prototype if inference is insufficient", + "export_options": { + "address_set_str": "0x401000", + "run_decompiler_parameter_id": true + }, + "exported_globals": {}, + "exporter": { + "commit": "285529b434f6e46827e001c42eb1b090e187eaf9", + "repository": "https://github.com/edmcman/GhidraFunctionCPPExporter", + "sha256": "cb0d1c5c78f3c07cb2cc385165d9008efa112206acf488f1303d5c34458c3e67" + }, + "flags": "-O2", + "ghidra_revision": "8b4c91d4d5bd1549622bfbade0df199585b98365", + "ghidra_version": "12.1.3", + "image_base": "0x400000", + "input_binary_sha256": "f14c44b97f79bbef5f1ec653f6dc029f5e97451bc17db2934c4dce851b609c6d", + "input_toolchain": { + "clang": "Ubuntu clang version 18.1.3 (1ubuntu1)", + "gcc": "gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0" + }, + "interfaces_sha256": "2ab2af67d91e76af9b1728ade3d8bc8e49b73a2a51d6aab621fd35e73a4e0600", + "notes": "Ghidra infers an 8-bit argument where the original accepts 32 bits.", + "original_bindings": "callees: {}\nglobals: {}\n", + "raw_sha256": "925c658aa134738d6f1f2a47f80257ab0b73131f9db895395d5b8ada2cd0a41b", + "setup": [ + "Load at 0x400000 to match the verifier.", + "Treat the ELF target entry as an ordinary function using the default C calling convention; no source types supplied." + ], + "source_case": "sign-extension" + }, + "expected_error": "original and candidate logical types differ; supply original_prototype if inference is insufficient" + }, + { + "name": "ghidra-hello-goodbye", + "label": "Ghidra: hello goodbye", + "binary": "binaries/ghidra-hello-goodbye.elf", + "binary_sha256": "ab00d3407494aaba2993945265484e1fc85e3be779081ca75bdcce12093cadce", + "inputs": [ + "0x401000", + "\n//==============================================================================\n// DATA TYPES \n// These types were decompiled from the binary and may not match original source\n//==============================================================================\n\ntypedef unsigned char undefined;\n\ntypedef unsigned char byte;\ntypedef unsigned char dwfenc;\ntypedef unsigned int dword;\ntypedef unsigned long qword;\ntypedef unsigned char undefined1;\ntypedef unsigned int undefined4;\ntypedef unsigned short word;\ntypedef unsigned long long unkbyte9;\ntypedef unsigned long long unkbyte10;\ntypedef unsigned long long unkbyte11;\ntypedef unsigned long long unkbyte12;\ntypedef unsigned long long unkbyte13;\ntypedef unsigned long long unkbyte14;\ntypedef unsigned long long unkbyte15;\ntypedef unsigned long long unkbyte16;\n\ntypedef unsigned long long unkuint9;\ntypedef unsigned long long unkuint10;\ntypedef unsigned long long unkuint11;\ntypedef unsigned long long unkuint12;\ntypedef unsigned long long unkuint13;\ntypedef unsigned long long unkuint14;\ntypedef unsigned long long unkuint15;\ntypedef unsigned long long unkuint16;\n\ntypedef long long unkint9;\ntypedef long long unkint10;\ntypedef long long unkint11;\ntypedef long long unkint12;\ntypedef long long unkint13;\ntypedef long long unkint14;\ntypedef long long unkint15;\ntypedef long long unkint16;\n\ntypedef float unkfloat1;\ntypedef float unkfloat2;\ntypedef float unkfloat3;\ntypedef double unkfloat5;\ntypedef double unkfloat6;\ntypedef double unkfloat7;\ntypedef long double unkfloat9;\ntypedef long double unkfloat11;\ntypedef long double unkfloat12;\ntypedef long double unkfloat13;\ntypedef long double unkfloat14;\ntypedef long double unkfloat15;\ntypedef long double unkfloat16;\n\ntypedef void BADSPACEBASE;\ntypedef void code;\n\n// C99 lacks bool, define it as byte for C-only output\n#if !defined(__cplusplus) && !defined(NO_BOOL)\ntypedef unsigned char bool;\n#endif\n\n\n\n\n\n//==============================================================================\n// FUNCTION DECLARATIONS \n// These function prototypes were extracted from binary analysis \n//==============================================================================\n\nundefined4 target(undefined4 param_1);\nvoid observe(void);\n\n\n//==============================================================================\n// GLOBAL VARIABLES \n// These global variables were referenced in the decompiled functions \n//==============================================================================\n\nextern undefined1 out[16];\n\n\n//==============================================================================\n// FUNCTION IMPLEMENTATIONS \n// Decompiled code from the binary \n//==============================================================================\n\nundefined4 target(undefined4 param_1)\n\n{\n out._4_2_ = 0x6f;\n out._0_4_ = 0x6c6c6568;\n observe();\n return param_1;\n}\n\n\n", + "callees:\n observe: '0x401030'\nglobals:\n out: '0x403000'\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "callee_interfaces:\n observe:\n prototype: void observe(void * arg0);\noriginal_base: 4194304\noriginal_prototype: unsigned int target(unsigned int x);\n" + ], + "reference": "char out[16];\nvoid observe(const void *);\nunsigned target(unsigned x) {\n __builtin_strcpy(out, \"hello\");\n observe(out);\n return x;\n}\n", + "expected_verdict": null, + "ghidra": { + "adaptations": [ + { + "from": "undefined1 out[16];", + "line": 83, + "reason": "Bind the global to original storage instead of defining candidate storage.", + "to": "extern undefined1 out[16];" + } + ], + "also_covers": [], + "candidate_sha256": "02de8f591ba02650c951154b51d73f925e5c9f392f1f5d23be822527bbc05cf6", + "candidate_symbol": "target", + "compiler": "gcc", + "expected_error": "candidate compilation failed:", + "export_options": { + "address_set_str": "0x401000", + "run_decompiler_parameter_id": true + }, + "exported_globals": { + "out": "0x403000" + }, + "exporter": { + "commit": "285529b434f6e46827e001c42eb1b090e187eaf9", + "repository": "https://github.com/edmcman/GhidraFunctionCPPExporter", + "sha256": "cb0d1c5c78f3c07cb2cc385165d9008efa112206acf488f1303d5c34458c3e67" + }, + "flags": "-O2", + "ghidra_revision": "8b4c91d4d5bd1549622bfbade0df199585b98365", + "ghidra_version": "12.1.3", + "image_base": "0x400000", + "input_binary_sha256": "ab00d3407494aaba2993945265484e1fc85e3be779081ca75bdcce12093cadce", + "input_toolchain": { + "clang": "Ubuntu clang version 18.1.3 (1ubuntu1)", + "gcc": "gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0" + }, + "interfaces_sha256": "2bc168872697e0bc7ee1c6e6479bfc73b9c62293b53c1bbe29efb7b1d9e2ccbe", + "notes": "Ghidra emits array slice member syntax that is not valid C, and omits the observe argument.", + "original_bindings": "callees:\n observe: '0x401030'\nglobals:\n out: '0x403000'\n", + "raw_sha256": "834ee0bed729dbc3908fed7085e618564a4961b21e758373a8579ef2428f4270", + "setup": [ + "Load at 0x400000 to match the verifier.", + "Treat the ELF target entry as an ordinary function using the default C calling convention; no source types supplied." + ], + "source_case": "hello-goodbye" + }, + "expected_error": "candidate compilation failed:" + }, + { + "name": "ghidra-hello-world", + "label": "Ghidra: hello world", + "binary": "binaries/ghidra-hello-world.elf", + "binary_sha256": "b431776c7eae9f4539764ffb17302371d322c07fb0368ce5e8b9cfbc7635adc4", + "inputs": [ + "0x401000", + "\n//==============================================================================\n// DATA TYPES \n// These types were decompiled from the binary and may not match original source\n//==============================================================================\n\ntypedef unsigned char undefined;\n\ntypedef unsigned char byte;\ntypedef unsigned char dwfenc;\ntypedef unsigned int dword;\ntypedef unsigned long qword;\ntypedef unsigned long undefined8;\ntypedef unsigned short word;\ntypedef unsigned long long unkbyte9;\ntypedef unsigned long long unkbyte10;\ntypedef unsigned long long unkbyte11;\ntypedef unsigned long long unkbyte12;\ntypedef unsigned long long unkbyte13;\ntypedef unsigned long long unkbyte14;\ntypedef unsigned long long unkbyte15;\ntypedef unsigned long long unkbyte16;\n\ntypedef unsigned long long unkuint9;\ntypedef unsigned long long unkuint10;\ntypedef unsigned long long unkuint11;\ntypedef unsigned long long unkuint12;\ntypedef unsigned long long unkuint13;\ntypedef unsigned long long unkuint14;\ntypedef unsigned long long unkuint15;\ntypedef unsigned long long unkuint16;\n\ntypedef long long unkint9;\ntypedef long long unkint10;\ntypedef long long unkint11;\ntypedef long long unkint12;\ntypedef long long unkint13;\ntypedef long long unkint14;\ntypedef long long unkint15;\ntypedef long long unkint16;\n\ntypedef float unkfloat1;\ntypedef float unkfloat2;\ntypedef float unkfloat3;\ntypedef double unkfloat5;\ntypedef double unkfloat6;\ntypedef double unkfloat7;\ntypedef long double unkfloat9;\ntypedef long double unkfloat11;\ntypedef long double unkfloat12;\ntypedef long double unkfloat13;\ntypedef long double unkfloat14;\ntypedef long double unkfloat15;\ntypedef long double unkfloat16;\n\ntypedef void BADSPACEBASE;\ntypedef void code;\n\n// C99 lacks bool, define it as byte for C-only output\n#if !defined(__cplusplus) && !defined(NO_BOOL)\ntypedef unsigned char bool;\n#endif\n\n\n\n\n\n//==============================================================================\n// FUNCTION DECLARATIONS \n// These function prototypes were extracted from binary analysis \n//==============================================================================\n\nint printf(char *__format,...);\nundefined8 target(void);\n\n\n//==============================================================================\n// FUNCTION IMPLEMENTATIONS \n// Decompiled code from the binary \n//==============================================================================\n\nundefined8 target(void)\n\n{\n printf(\"hello world\\n\");\n return 0;\n}\n\n\n", + "callees:\n printf: '0x401020'\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2 -fno-builtin", + "callee_interfaces:\n printf:\n prototype: int printf(char * arg0, ...);\n variadic_types: []\nmemory_ranges:\n printf:\n 0: 13\noriginal_base: 4194304\noriginal_prototype: int target(void);\n" + ], + "reference": "int printf(const char *, ...);\n\nint target(void) {\n printf(\"hello world\\n\");\n return 0;\n}\n", + "expected_verdict": null, + "ghidra": { + "adaptations": [], + "also_covers": [], + "candidate_sha256": "4aaf18c4c315498fcc3a51b6334a6f1a18c1eacfdbb46cd2e8d5ff9cc372039f", + "candidate_symbol": "target", + "compiler": "gcc", + "expected_error": "original and candidate logical types differ; supply original_prototype if inference is insufficient", + "export_options": { + "address_set_str": "0x401000", + "run_decompiler_parameter_id": true + }, + "exported_globals": {}, + "exporter": { + "commit": "285529b434f6e46827e001c42eb1b090e187eaf9", + "repository": "https://github.com/edmcman/GhidraFunctionCPPExporter", + "sha256": "cb0d1c5c78f3c07cb2cc385165d9008efa112206acf488f1303d5c34458c3e67" + }, + "flags": "-O2 -fno-builtin", + "ghidra_revision": "8b4c91d4d5bd1549622bfbade0df199585b98365", + "ghidra_version": "12.1.3", + "image_base": "0x400000", + "input_binary_sha256": "b431776c7eae9f4539764ffb17302371d322c07fb0368ce5e8b9cfbc7635adc4", + "input_toolchain": { + "clang": "Ubuntu clang version 18.1.3 (1ubuntu1)", + "gcc": "gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0" + }, + "interfaces_sha256": "3a5fab9ed9d51818dcf5c665f4d48896df3a5910d484e45eed88e38596a72d28", + "notes": "Ghidra infers a 64-bit return instead of the original 32-bit return.", + "original_bindings": "callees:\n printf: '0x401020'\nglobals: {}\n", + "raw_sha256": "4aaf18c4c315498fcc3a51b6334a6f1a18c1eacfdbb46cd2e8d5ff9cc372039f", + "setup": [ + "Load at 0x400000 to match the verifier.", + "Treat the ELF target entry as an ordinary function using the default C calling convention; no source types supplied." + ], + "source_case": "hello-world" + }, + "expected_error": "original and candidate logical types differ; supply original_prototype if inference is insufficient" + }, + { + "name": "ghidra-malloc", + "label": "Ghidra: malloc", + "binary": "binaries/ghidra-malloc.elf", + "binary_sha256": "25c4bf043f04e90cd1e7d54b90d61c9dfc24c41b65ffd87e0496b91c1467c3f2", + "inputs": [ + "0x401000", + "\n//==============================================================================\n// DATA TYPES \n// These types were decompiled from the binary and may not match original source\n//==============================================================================\n\ntypedef unsigned char undefined;\n\ntypedef unsigned char byte;\ntypedef unsigned char dwfenc;\ntypedef unsigned int dword;\ntypedef unsigned long qword;\ntypedef unsigned long ulong;\ntypedef unsigned short word;\ntypedef unsigned long long unkbyte9;\ntypedef unsigned long long unkbyte10;\ntypedef unsigned long long unkbyte11;\ntypedef unsigned long long unkbyte12;\ntypedef unsigned long long unkbyte13;\ntypedef unsigned long long unkbyte14;\ntypedef unsigned long long unkbyte15;\ntypedef unsigned long long unkbyte16;\n\ntypedef unsigned long long unkuint9;\ntypedef unsigned long long unkuint10;\ntypedef unsigned long long unkuint11;\ntypedef unsigned long long unkuint12;\ntypedef unsigned long long unkuint13;\ntypedef unsigned long long unkuint14;\ntypedef unsigned long long unkuint15;\ntypedef unsigned long long unkuint16;\n\ntypedef long long unkint9;\ntypedef long long unkint10;\ntypedef long long unkint11;\ntypedef long long unkint12;\ntypedef long long unkint13;\ntypedef long long unkint14;\ntypedef long long unkint15;\ntypedef long long unkint16;\n\ntypedef float unkfloat1;\ntypedef float unkfloat2;\ntypedef float unkfloat3;\ntypedef double unkfloat5;\ntypedef double unkfloat6;\ntypedef double unkfloat7;\ntypedef long double unkfloat9;\ntypedef long double unkfloat11;\ntypedef long double unkfloat12;\ntypedef long double unkfloat13;\ntypedef long double unkfloat14;\ntypedef long double unkfloat15;\ntypedef long double unkfloat16;\n\ntypedef void BADSPACEBASE;\ntypedef void code;\n\n// C99 lacks bool, define it as byte for C-only output\n#if !defined(__cplusplus) && !defined(NO_BOOL)\ntypedef unsigned char bool;\n#endif\n\n\ntypedef ulong size_t;\n\n\n\n\n//==============================================================================\n// FUNCTION DECLARATIONS \n// These function prototypes were extracted from binary analysis \n//==============================================================================\n\nvoid * malloc(size_t __size);\nvoid * target(size_t __size);\n\n\n//==============================================================================\n// FUNCTION IMPLEMENTATIONS \n// Decompiled code from the binary \n//==============================================================================\n\nvoid * target(size_t __size)\n\n{\n void *pvVar1;\n \n pvVar1 = malloc(__size);\n return pvVar1;\n}\n\n\n", + "callees:\n malloc: '0x401010'\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2 -fno-builtin", + "callee_interfaces:\n malloc:\n prototype: void * malloc(unsigned long arg0);\noriginal_base: 4194304\noriginal_prototype: void * target(unsigned long size);\n" + ], + "reference": "void *malloc(unsigned long);\n\nvoid *target(unsigned long size) {\n return malloc(size);\n}\n", + "expected_verdict": "agree", + "ghidra": { + "adaptations": [], + "also_covers": [], + "candidate_sha256": "e603faffd796ce4bd19fc6e20b376f5a4429a7e3c63b288c441bd42eedbf062b", + "candidate_symbol": "target", + "compiler": "gcc", + "expected_verdict": "agree", + "export_options": { + "address_set_str": "0x401000", + "run_decompiler_parameter_id": true + }, + "exported_globals": {}, + "exporter": { + "commit": "285529b434f6e46827e001c42eb1b090e187eaf9", + "repository": "https://github.com/edmcman/GhidraFunctionCPPExporter", + "sha256": "cb0d1c5c78f3c07cb2cc385165d9008efa112206acf488f1303d5c34458c3e67" + }, + "flags": "-O2 -fno-builtin", + "ghidra_revision": "8b4c91d4d5bd1549622bfbade0df199585b98365", + "ghidra_version": "12.1.3", + "image_base": "0x400000", + "input_binary_sha256": "25c4bf043f04e90cd1e7d54b90d61c9dfc24c41b65ffd87e0496b91c1467c3f2", + "input_toolchain": { + "clang": "Ubuntu clang version 18.1.3 (1ubuntu1)", + "gcc": "gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0" + }, + "interfaces_sha256": "7bf80faa4a4b9654a7d3f75c80b3c28119d0b63667e9a54b3ac493dc49caed78", + "original_bindings": "callees:\n malloc: '0x401010'\nglobals: {}\n", + "raw_sha256": "e603faffd796ce4bd19fc6e20b376f5a4429a7e3c63b288c441bd42eedbf062b", + "setup": [ + "Load at 0x400000 to match the verifier.", + "Treat the ELF target entry as an ordinary function using the default C calling convention; no source types supplied." + ], + "source_case": "malloc" + }, + "expected_error": null + }, + { + "name": "ghidra-format-string", + "label": "Ghidra: format string", + "binary": "binaries/ghidra-format-string.elf", + "binary_sha256": "34939255714fccbe44aeed7be5e3743d405b755ae405a2cacc5e12055b3f3080", + "inputs": [ + "0x401000", + "\n//==============================================================================\n// DATA TYPES \n// These types were decompiled from the binary and may not match original source\n//==============================================================================\n\ntypedef unsigned char undefined;\n\ntypedef unsigned char byte;\ntypedef unsigned char dwfenc;\ntypedef unsigned int dword;\ntypedef unsigned long qword;\ntypedef unsigned long undefined8;\ntypedef unsigned short word;\ntypedef unsigned long long unkbyte9;\ntypedef unsigned long long unkbyte10;\ntypedef unsigned long long unkbyte11;\ntypedef unsigned long long unkbyte12;\ntypedef unsigned long long unkbyte13;\ntypedef unsigned long long unkbyte14;\ntypedef unsigned long long unkbyte15;\ntypedef unsigned long long unkbyte16;\n\ntypedef unsigned long long unkuint9;\ntypedef unsigned long long unkuint10;\ntypedef unsigned long long unkuint11;\ntypedef unsigned long long unkuint12;\ntypedef unsigned long long unkuint13;\ntypedef unsigned long long unkuint14;\ntypedef unsigned long long unkuint15;\ntypedef unsigned long long unkuint16;\n\ntypedef long long unkint9;\ntypedef long long unkint10;\ntypedef long long unkint11;\ntypedef long long unkint12;\ntypedef long long unkint13;\ntypedef long long unkint14;\ntypedef long long unkint15;\ntypedef long long unkint16;\n\ntypedef float unkfloat1;\ntypedef float unkfloat2;\ntypedef float unkfloat3;\ntypedef double unkfloat5;\ntypedef double unkfloat6;\ntypedef double unkfloat7;\ntypedef long double unkfloat9;\ntypedef long double unkfloat11;\ntypedef long double unkfloat12;\ntypedef long double unkfloat13;\ntypedef long double unkfloat14;\ntypedef long double unkfloat15;\ntypedef long double unkfloat16;\n\ntypedef void BADSPACEBASE;\ntypedef void code;\n\n// C99 lacks bool, define it as byte for C-only output\n#if !defined(__cplusplus) && !defined(NO_BOOL)\ntypedef unsigned char bool;\n#endif\n\n\ntypedef unsigned long ulong;\n\n\n\n//==============================================================================\n// FUNCTION DECLARATIONS \n// These function prototypes were extracted from binary analysis \n//==============================================================================\n\nint target(int param_1);\nundefined8 format(void);\n\n\n//==============================================================================\n// FUNCTION IMPLEMENTATIONS \n// Decompiled code from the binary \n//==============================================================================\n\nint target(int param_1)\n\n{\n int iVar1;\n ulong uVar2;\n \n uVar2 = format();\n iVar1 = param_1 + 0xb;\n if ((uVar2 & 1) == 0) {\n iVar1 = param_1 + 0x1d;\n }\n return iVar1;\n}\n\n\n", + "callees:\n format: '0x401030'\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "callee_interfaces:\n format:\n prototype: unsigned int format(char * arg0);\nmemory_ranges:\n format:\n 0: 10\noriginal_base: 4194304\noriginal_prototype: unsigned int target(unsigned int x);\n" + ], + "reference": "unsigned format(const char *);\nunsigned target(unsigned x) {\n return (format(\"value: %u\") & 1) ? x + 11 : x + 29;\n}\n", + "expected_verdict": "mismatch", + "ghidra": { + "adaptations": [], + "also_covers": [], + "candidate_sha256": "93007c55b6ee6dcceb08b0e08e6e51dd1086b39615168dd0d20ecec2a7ffaa66", + "candidate_symbol": "target", + "compiler": "gcc", + "expected_verdict": "mismatch", + "export_options": { + "address_set_str": "0x401000", + "run_decompiler_parameter_id": true + }, + "exported_globals": {}, + "exporter": { + "commit": "285529b434f6e46827e001c42eb1b090e187eaf9", + "repository": "https://github.com/edmcman/GhidraFunctionCPPExporter", + "sha256": "cb0d1c5c78f3c07cb2cc385165d9008efa112206acf488f1303d5c34458c3e67" + }, + "flags": "-O2", + "ghidra_revision": "8b4c91d4d5bd1549622bfbade0df199585b98365", + "ghidra_version": "12.1.3", + "image_base": "0x400000", + "input_binary_sha256": "34939255714fccbe44aeed7be5e3743d405b755ae405a2cacc5e12055b3f3080", + "input_toolchain": { + "clang": "Ubuntu clang version 18.1.3 (1ubuntu1)", + "gcc": "gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0" + }, + "interfaces_sha256": "9d148ffd496518e4be214cc6e96b2af54d36feb77f09153ff699ef6e88670b1e", + "notes": "Ghidra drops the format-string call argument. The independent original callee declaration and explicit byte range expose a call argument mismatch.", + "original_bindings": "callees:\n format: '0x401030'\nglobals: {}\n", + "raw_sha256": "93007c55b6ee6dcceb08b0e08e6e51dd1086b39615168dd0d20ecec2a7ffaa66", + "setup": [ + "Load at 0x400000 to match the verifier.", + "Treat the ELF target entry as an ordinary function using the default C calling convention; no source types supplied." + ], + "source_case": "format-string" + }, + "expected_error": null + }, + { + "name": "ghidra-transient-global", + "label": "Ghidra: transient global", + "binary": "binaries/ghidra-transient-global.elf", + "binary_sha256": "ae3efe79e92a97b196a13e405820c4bfebf1365e3ef6d04161916d85b311c297", + "inputs": [ + "0x401000", + "\n//==============================================================================\n// DATA TYPES \n// These types were decompiled from the binary and may not match original source\n//==============================================================================\n\ntypedef unsigned char undefined;\n\ntypedef unsigned char byte;\ntypedef unsigned char dwfenc;\ntypedef unsigned int dword;\ntypedef unsigned long qword;\ntypedef unsigned int undefined4;\ntypedef unsigned short word;\ntypedef unsigned long long unkbyte9;\ntypedef unsigned long long unkbyte10;\ntypedef unsigned long long unkbyte11;\ntypedef unsigned long long unkbyte12;\ntypedef unsigned long long unkbyte13;\ntypedef unsigned long long unkbyte14;\ntypedef unsigned long long unkbyte15;\ntypedef unsigned long long unkbyte16;\n\ntypedef unsigned long long unkuint9;\ntypedef unsigned long long unkuint10;\ntypedef unsigned long long unkuint11;\ntypedef unsigned long long unkuint12;\ntypedef unsigned long long unkuint13;\ntypedef unsigned long long unkuint14;\ntypedef unsigned long long unkuint15;\ntypedef unsigned long long unkuint16;\n\ntypedef long long unkint9;\ntypedef long long unkint10;\ntypedef long long unkint11;\ntypedef long long unkint12;\ntypedef long long unkint13;\ntypedef long long unkint14;\ntypedef long long unkint15;\ntypedef long long unkint16;\n\ntypedef float unkfloat1;\ntypedef float unkfloat2;\ntypedef float unkfloat3;\ntypedef double unkfloat5;\ntypedef double unkfloat6;\ntypedef double unkfloat7;\ntypedef long double unkfloat9;\ntypedef long double unkfloat11;\ntypedef long double unkfloat12;\ntypedef long double unkfloat13;\ntypedef long double unkfloat14;\ntypedef long double unkfloat15;\ntypedef long double unkfloat16;\n\ntypedef void BADSPACEBASE;\ntypedef void code;\n\n// C99 lacks bool, define it as byte for C-only output\n#if !defined(__cplusplus) && !defined(NO_BOOL)\ntypedef unsigned char bool;\n#endif\n\n\n\n\n\n//==============================================================================\n// FUNCTION DECLARATIONS \n// These function prototypes were extracted from binary analysis \n//==============================================================================\n\nint foo(int param_1);\nint target(int param_1);\n\n\n//==============================================================================\n// GLOBAL VARIABLES \n// These global variables were referenced in the decompiled functions \n//==============================================================================\n\nextern undefined4 g;\n\n\n//==============================================================================\n// FUNCTION IMPLEMENTATIONS \n// Decompiled code from the binary \n//==============================================================================\n\nint target(int param_1)\n\n{\n g = 1;\n foo(param_1);\n g = 3;\n return param_1;\n}\n\n\n", + "callees:\n foo: '0x401030'\nglobals:\n g: '0x403000'\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "callee_interfaces:\n foo:\n prototype: unsigned int foo(unsigned int arg0);\noriginal_base: 4194304\noriginal_prototype: unsigned int target(unsigned int x);\n" + ], + "reference": "volatile unsigned g;\nunsigned foo(unsigned);\nunsigned target(unsigned x) {\n g = 1;\n foo(x);\n g = 3;\n return x;\n}\n", + "expected_verdict": "agree", + "ghidra": { + "adaptations": [ + { + "from": "undefined4 g;", + "line": 82, + "reason": "Bind the global to original storage instead of defining candidate storage.", + "to": "extern undefined4 g;" + } + ], + "also_covers": [], + "candidate_sha256": "45109e3af57c6225bf5d41188dc405e815466d60145785366f68c2ef7b551f8f", + "candidate_symbol": "target", + "compiler": "gcc", + "expected_verdict": "agree", + "export_options": { + "address_set_str": "0x401000", + "run_decompiler_parameter_id": true + }, + "exported_globals": { + "g": "0x403000" + }, + "exporter": { + "commit": "285529b434f6e46827e001c42eb1b090e187eaf9", + "repository": "https://github.com/edmcman/GhidraFunctionCPPExporter", + "sha256": "cb0d1c5c78f3c07cb2cc385165d9008efa112206acf488f1303d5c34458c3e67" + }, + "flags": "-O2", + "ghidra_revision": "8b4c91d4d5bd1549622bfbade0df199585b98365", + "ghidra_version": "12.1.3", + "image_base": "0x400000", + "input_binary_sha256": "ae3efe79e92a97b196a13e405820c4bfebf1365e3ef6d04161916d85b311c297", + "input_toolchain": { + "clang": "Ubuntu clang version 18.1.3 (1ubuntu1)", + "gcc": "gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0" + }, + "interfaces_sha256": "a29f5d144a636ebac8a2291acf7bb53bbcaa1aaecdef342c9068fd7be4689d2e", + "original_bindings": "callees:\n foo: '0x401030'\nglobals:\n g: '0x403000'\n", + "raw_sha256": "5989649667a0a60ad479525d2eda8dc701fe32cc0243653bbb91a36d66412179", + "setup": [ + "Load at 0x400000 to match the verifier.", + "Treat the ELF target entry as an ordinary function using the default C calling convention; no source types supplied." + ], + "source_case": "transient-global" + }, + "expected_error": null + }, + { + "name": "ghidra-tail-call", + "label": "Ghidra: tail call", + "binary": "binaries/ghidra-tail-call.elf", + "binary_sha256": "f43e9cba13b6f8df9d7215a6757b8a8bb731457bef1a28ddd1855c4892c0f612", + "inputs": [ + "0x401000", + "\n//==============================================================================\n// DATA TYPES \n// These types were decompiled from the binary and may not match original source\n//==============================================================================\n\ntypedef unsigned char undefined;\n\ntypedef unsigned char byte;\ntypedef unsigned char dwfenc;\ntypedef unsigned int dword;\ntypedef unsigned long qword;\ntypedef unsigned short word;\ntypedef unsigned long long unkbyte9;\ntypedef unsigned long long unkbyte10;\ntypedef unsigned long long unkbyte11;\ntypedef unsigned long long unkbyte12;\ntypedef unsigned long long unkbyte13;\ntypedef unsigned long long unkbyte14;\ntypedef unsigned long long unkbyte15;\ntypedef unsigned long long unkbyte16;\n\ntypedef unsigned long long unkuint9;\ntypedef unsigned long long unkuint10;\ntypedef unsigned long long unkuint11;\ntypedef unsigned long long unkuint12;\ntypedef unsigned long long unkuint13;\ntypedef unsigned long long unkuint14;\ntypedef unsigned long long unkuint15;\ntypedef unsigned long long unkuint16;\n\ntypedef long long unkint9;\ntypedef long long unkint10;\ntypedef long long unkint11;\ntypedef long long unkint12;\ntypedef long long unkint13;\ntypedef long long unkint14;\ntypedef long long unkint15;\ntypedef long long unkint16;\n\ntypedef float unkfloat1;\ntypedef float unkfloat2;\ntypedef float unkfloat3;\ntypedef double unkfloat5;\ntypedef double unkfloat6;\ntypedef double unkfloat7;\ntypedef long double unkfloat9;\ntypedef long double unkfloat11;\ntypedef long double unkfloat12;\ntypedef long double unkfloat13;\ntypedef long double unkfloat14;\ntypedef long double unkfloat15;\ntypedef long double unkfloat16;\n\ntypedef void BADSPACEBASE;\ntypedef void code;\n\n// C99 lacks bool, define it as byte for C-only output\n#if !defined(__cplusplus) && !defined(NO_BOOL)\ntypedef unsigned char bool;\n#endif\n\n\n\n\n\n//==============================================================================\n// FUNCTION DECLARATIONS \n// These function prototypes were extracted from binary analysis \n//==============================================================================\n\nint foo(int param_1);\nint target(int param_1);\n\n\n//==============================================================================\n// FUNCTION IMPLEMENTATIONS \n// Decompiled code from the binary \n//==============================================================================\n\nint target(int param_1)\n\n{\n int iVar1;\n \n iVar1 = foo(param_1);\n return iVar1;\n}\n\n\n", + "callees:\n foo: '0x401010'\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "callee_interfaces:\n foo:\n prototype: unsigned int foo(unsigned int arg0);\noriginal_base: 4194304\noriginal_prototype: unsigned int target(unsigned int x);\n" + ], + "reference": "unsigned foo(unsigned);\nunsigned target(unsigned x) { return foo(x); }\n", + "expected_verdict": "agree", + "ghidra": { + "adaptations": [], + "also_covers": [], + "candidate_sha256": "fe3948037a6b400f14987554474b4cd969749386fdc5885c46037b18a28ff058", + "candidate_symbol": "target", + "compiler": "gcc", + "expected_verdict": "agree", + "export_options": { + "address_set_str": "0x401000", + "run_decompiler_parameter_id": true + }, + "exported_globals": {}, + "exporter": { + "commit": "285529b434f6e46827e001c42eb1b090e187eaf9", + "repository": "https://github.com/edmcman/GhidraFunctionCPPExporter", + "sha256": "cb0d1c5c78f3c07cb2cc385165d9008efa112206acf488f1303d5c34458c3e67" + }, + "flags": "-O2", + "ghidra_revision": "8b4c91d4d5bd1549622bfbade0df199585b98365", + "ghidra_version": "12.1.3", + "image_base": "0x400000", + "input_binary_sha256": "f43e9cba13b6f8df9d7215a6757b8a8bb731457bef1a28ddd1855c4892c0f612", + "input_toolchain": { + "clang": "Ubuntu clang version 18.1.3 (1ubuntu1)", + "gcc": "gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0" + }, + "interfaces_sha256": "a29f5d144a636ebac8a2291acf7bb53bbcaa1aaecdef342c9068fd7be4689d2e", + "original_bindings": "callees:\n foo: '0x401010'\nglobals: {}\n", + "raw_sha256": "fe3948037a6b400f14987554474b4cd969749386fdc5885c46037b18a28ff058", + "setup": [ + "Load at 0x400000 to match the verifier.", + "Treat the ELF target entry as an ordinary function using the default C calling convention; no source types supplied." + ], + "source_case": "tail-call" + }, + "expected_error": null + }, + { + "name": "ghidra-wide-integer", + "label": "Ghidra: wide integer", + "binary": "binaries/ghidra-wide-integer.elf", + "binary_sha256": "9c65a2af785fb889e890664298de3fb5b915a5eeb19a89bee46360a5b73a5905", + "inputs": [ + "0x401000", + "\n//==============================================================================\n// DATA TYPES \n// These types were decompiled from the binary and may not match original source\n//==============================================================================\n\ntypedef unsigned char undefined;\n\ntypedef unsigned char byte;\ntypedef unsigned char dwfenc;\ntypedef unsigned int dword;\ntypedef unsigned long qword;\ntypedef unsigned long ulong;\ntypedef unsigned char undefined1;\ntypedef unsigned short word;\ntypedef unsigned long long unkbyte9;\ntypedef unsigned long long unkbyte10;\ntypedef unsigned long long unkbyte11;\ntypedef unsigned long long unkbyte12;\ntypedef unsigned long long unkbyte13;\ntypedef unsigned long long unkbyte14;\ntypedef unsigned long long unkbyte15;\ntypedef unsigned long long unkbyte16;\n\ntypedef unsigned long long unkuint9;\ntypedef unsigned long long unkuint10;\ntypedef unsigned long long unkuint11;\ntypedef unsigned long long unkuint12;\ntypedef unsigned long long unkuint13;\ntypedef unsigned long long unkuint14;\ntypedef unsigned long long unkuint15;\ntypedef unsigned long long unkuint16;\n\ntypedef long long unkint9;\ntypedef long long unkint10;\ntypedef long long unkint11;\ntypedef long long unkint12;\ntypedef long long unkint13;\ntypedef long long unkint14;\ntypedef long long unkint15;\ntypedef long long unkint16;\n\ntypedef float unkfloat1;\ntypedef float unkfloat2;\ntypedef float unkfloat3;\ntypedef double unkfloat5;\ntypedef double unkfloat6;\ntypedef double unkfloat7;\ntypedef long double unkfloat9;\ntypedef long double unkfloat11;\ntypedef long double unkfloat12;\ntypedef long double unkfloat13;\ntypedef long double unkfloat14;\ntypedef long double unkfloat15;\ntypedef long double unkfloat16;\n\ntypedef void BADSPACEBASE;\ntypedef void code;\n\n// C99 lacks bool, define it as byte for C-only output\n#if !defined(__cplusplus) && !defined(NO_BOOL)\ntypedef unsigned char bool;\n#endif\n\n\n\n\n\n//==============================================================================\n// FUNCTION DECLARATIONS \n// These function prototypes were extracted from binary analysis \n//==============================================================================\n\nundefined1 [16] target(ulong param_1,long param_2);\n\n\n//==============================================================================\n// FUNCTION IMPLEMENTATIONS \n// Decompiled code from the binary \n//==============================================================================\n\nundefined1 [16] target(ulong param_1,long param_2)\n\n{\n undefined1 auVar1 [16];\n \n auVar1._0_8_ = param_1 + 7;\n auVar1._8_8_ = param_2 + (ulong)(0xfffffffffffffff8 < param_1);\n return auVar1;\n}\n\n\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_base: 4194304\noriginal_prototype: unsigned __int128 target(unsigned __int128 x);\n" + ], + "reference": "unsigned __int128 target(unsigned __int128 x) {\n return x + 7;\n}\n", + "expected_verdict": null, + "ghidra": { + "adaptations": [], + "also_covers": [], + "candidate_sha256": "20f2da3990285fd04caa393f8dfc76d991ebd6b67bd4f7bc4b6130c74e231291", + "candidate_symbol": "target", + "compiler": "gcc", + "expected_error": "candidate compilation failed:", + "export_options": { + "address_set_str": "0x401000", + "run_decompiler_parameter_id": true + }, + "exported_globals": {}, + "exporter": { + "commit": "285529b434f6e46827e001c42eb1b090e187eaf9", + "repository": "https://github.com/edmcman/GhidraFunctionCPPExporter", + "sha256": "cb0d1c5c78f3c07cb2cc385165d9008efa112206acf488f1303d5c34458c3e67" + }, + "flags": "-O2", + "ghidra_revision": "8b4c91d4d5bd1549622bfbade0df199585b98365", + "ghidra_version": "12.1.3", + "image_base": "0x400000", + "input_binary_sha256": "9c65a2af785fb889e890664298de3fb5b915a5eeb19a89bee46360a5b73a5905", + "input_toolchain": { + "clang": "Ubuntu clang version 18.1.3 (1ubuntu1)", + "gcc": "gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0" + }, + "interfaces_sha256": "57f9b5439f106a126e75e9a7911d258f43d238608c9af8128862fa5566d613b8", + "notes": "Ghidra emits an array return declaration that is not valid C.", + "original_bindings": "callees: {}\nglobals: {}\n", + "raw_sha256": "20f2da3990285fd04caa393f8dfc76d991ebd6b67bd4f7bc4b6130c74e231291", + "setup": [ + "Load at 0x400000 to match the verifier.", + "Treat the ELF target entry as an ordinary function using the default C calling convention; no source types supplied." + ], + "source_case": "wide-integer" + }, + "expected_error": "candidate compilation failed:" + }, + { + "name": "ghidra-float-identity", + "label": "Ghidra: float identity", + "binary": "binaries/ghidra-float-identity.elf", + "binary_sha256": "31210459dda670d87cd7911a06d12862dc1c6f40384a876be65f09aeb43e5a7d", + "inputs": [ + "0x401000", + "\n//==============================================================================\n// DATA TYPES \n// These types were decompiled from the binary and may not match original source\n//==============================================================================\n\ntypedef unsigned char undefined;\n\ntypedef unsigned char byte;\ntypedef unsigned char dwfenc;\ntypedef unsigned int dword;\ntypedef unsigned long qword;\ntypedef unsigned short word;\ntypedef unsigned long long unkbyte9;\ntypedef unsigned long long unkbyte10;\ntypedef unsigned long long unkbyte11;\ntypedef unsigned long long unkbyte12;\ntypedef unsigned long long unkbyte13;\ntypedef unsigned long long unkbyte14;\ntypedef unsigned long long unkbyte15;\ntypedef unsigned long long unkbyte16;\n\ntypedef unsigned long long unkuint9;\ntypedef unsigned long long unkuint10;\ntypedef unsigned long long unkuint11;\ntypedef unsigned long long unkuint12;\ntypedef unsigned long long unkuint13;\ntypedef unsigned long long unkuint14;\ntypedef unsigned long long unkuint15;\ntypedef unsigned long long unkuint16;\n\ntypedef long long unkint9;\ntypedef long long unkint10;\ntypedef long long unkint11;\ntypedef long long unkint12;\ntypedef long long unkint13;\ntypedef long long unkint14;\ntypedef long long unkint15;\ntypedef long long unkint16;\n\ntypedef float unkfloat1;\ntypedef float unkfloat2;\ntypedef float unkfloat3;\ntypedef double unkfloat5;\ntypedef double unkfloat6;\ntypedef double unkfloat7;\ntypedef long double unkfloat9;\ntypedef long double unkfloat11;\ntypedef long double unkfloat12;\ntypedef long double unkfloat13;\ntypedef long double unkfloat14;\ntypedef long double unkfloat15;\ntypedef long double unkfloat16;\n\ntypedef void BADSPACEBASE;\ntypedef void code;\n\n// C99 lacks bool, define it as byte for C-only output\n#if !defined(__cplusplus) && !defined(NO_BOOL)\ntypedef unsigned char bool;\n#endif\n\n\n\n\n\n//==============================================================================\n// FUNCTION DECLARATIONS \n// These function prototypes were extracted from binary analysis \n//==============================================================================\n\nvoid target(void);\n\n\n//==============================================================================\n// FUNCTION IMPLEMENTATIONS \n// Decompiled code from the binary \n//==============================================================================\n\nvoid target(void)\n\n{\n return;\n}\n\n\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_base: 4194304\noriginal_prototype: float target(float x);\n" + ], + "reference": "float target(float x) {\n return x;\n}\n", + "expected_verdict": null, + "ghidra": { + "adaptations": [], + "also_covers": [], + "candidate_sha256": "5ee298dbfe8d449b933109cdf20610908f0559f84250791be4484ccc822a3234", + "candidate_symbol": "target", + "compiler": "gcc", + "expected_error": "original and candidate logical types differ; supply original_prototype if inference is insufficient", + "export_options": { + "address_set_str": "0x401000", + "run_decompiler_parameter_id": true + }, + "exported_globals": {}, + "exporter": { + "commit": "285529b434f6e46827e001c42eb1b090e187eaf9", + "repository": "https://github.com/edmcman/GhidraFunctionCPPExporter", + "sha256": "cb0d1c5c78f3c07cb2cc385165d9008efa112206acf488f1303d5c34458c3e67" + }, + "flags": "-O2", + "ghidra_revision": "8b4c91d4d5bd1549622bfbade0df199585b98365", + "ghidra_version": "12.1.3", + "image_base": "0x400000", + "input_binary_sha256": "31210459dda670d87cd7911a06d12862dc1c6f40384a876be65f09aeb43e5a7d", + "input_toolchain": { + "clang": "Ubuntu clang version 18.1.3 (1ubuntu1)", + "gcc": "gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0" + }, + "interfaces_sha256": "34b8728e38f848045eea705aeecca4828a8d103d097aed4ccacab56eeb6493d1", + "notes": "Ghidra infers a void function with no arguments instead of float input and return.", + "original_bindings": "callees: {}\nglobals: {}\n", + "raw_sha256": "5ee298dbfe8d449b933109cdf20610908f0559f84250791be4484ccc822a3234", + "setup": [ + "Load at 0x400000 to match the verifier.", + "Treat the ELF target entry as an ordinary function using the default C calling convention; no source types supplied." + ], + "source_case": "float-identity" + }, + "expected_error": "original and candidate logical types differ; supply original_prototype if inference is insufficient" + }, + { + "name": "ghidra-signed-zero", + "label": "Ghidra: signed zero", + "binary": "binaries/ghidra-signed-zero.elf", + "binary_sha256": "7e22e5995a6a10efe68502f4b8420199c0d4097b4a9b2a933cc137f0dcbd3d9d", + "inputs": [ + "0x401000", + "\n//==============================================================================\n// DATA TYPES \n// These types were decompiled from the binary and may not match original source\n//==============================================================================\n\ntypedef unsigned char undefined;\n\ntypedef unsigned char byte;\ntypedef unsigned char dwfenc;\ntypedef unsigned int dword;\ntypedef unsigned long qword;\ntypedef unsigned long undefined8;\ntypedef unsigned short word;\ntypedef unsigned long long unkbyte9;\ntypedef unsigned long long unkbyte10;\ntypedef unsigned long long unkbyte11;\ntypedef unsigned long long unkbyte12;\ntypedef unsigned long long unkbyte13;\ntypedef unsigned long long unkbyte14;\ntypedef unsigned long long unkbyte15;\ntypedef unsigned long long unkbyte16;\n\ntypedef unsigned long long unkuint9;\ntypedef unsigned long long unkuint10;\ntypedef unsigned long long unkuint11;\ntypedef unsigned long long unkuint12;\ntypedef unsigned long long unkuint13;\ntypedef unsigned long long unkuint14;\ntypedef unsigned long long unkuint15;\ntypedef unsigned long long unkuint16;\n\ntypedef long long unkint9;\ntypedef long long unkint10;\ntypedef long long unkint11;\ntypedef long long unkint12;\ntypedef long long unkint13;\ntypedef long long unkint14;\ntypedef long long unkint15;\ntypedef long long unkint16;\n\ntypedef float unkfloat1;\ntypedef float unkfloat2;\ntypedef float unkfloat3;\ntypedef double unkfloat5;\ntypedef double unkfloat6;\ntypedef double unkfloat7;\ntypedef long double unkfloat9;\ntypedef long double unkfloat11;\ntypedef long double unkfloat12;\ntypedef long double unkfloat13;\ntypedef long double unkfloat14;\ntypedef long double unkfloat15;\ntypedef long double unkfloat16;\n\ntypedef void BADSPACEBASE;\ntypedef void code;\n\n// C99 lacks bool, define it as byte for C-only output\n#if !defined(__cplusplus) && !defined(NO_BOOL)\ntypedef unsigned char bool;\n#endif\n\n\n\n\n\n//==============================================================================\n// FUNCTION DECLARATIONS \n// These function prototypes were extracted from binary analysis \n//==============================================================================\n\nundefined8 target(void);\n\n\n//==============================================================================\n// FUNCTION IMPLEMENTATIONS \n// Decompiled code from the binary \n//==============================================================================\n\nundefined8 target(void)\n\n{\n return 0;\n}\n\n\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_base: 4194304\noriginal_prototype: double target(void);\n" + ], + "reference": "double target(void) {\n return 0.0;\n}\n", + "expected_verdict": null, + "ghidra": { + "adaptations": [], + "also_covers": [], + "candidate_sha256": "dc2cf6bc8f86f14d8b466a90e8fcb9f6c457f4f9c0ab9643500f67c0e1db7a91", + "candidate_symbol": "target", + "compiler": "gcc", + "expected_error": "original and candidate logical types differ; supply original_prototype if inference is insufficient", + "export_options": { + "address_set_str": "0x401000", + "run_decompiler_parameter_id": true + }, + "exported_globals": {}, + "exporter": { + "commit": "285529b434f6e46827e001c42eb1b090e187eaf9", + "repository": "https://github.com/edmcman/GhidraFunctionCPPExporter", + "sha256": "cb0d1c5c78f3c07cb2cc385165d9008efa112206acf488f1303d5c34458c3e67" + }, + "flags": "-O2", + "ghidra_revision": "8b4c91d4d5bd1549622bfbade0df199585b98365", + "ghidra_version": "12.1.3", + "image_base": "0x400000", + "input_binary_sha256": "7e22e5995a6a10efe68502f4b8420199c0d4097b4a9b2a933cc137f0dcbd3d9d", + "input_toolchain": { + "clang": "Ubuntu clang version 18.1.3 (1ubuntu1)", + "gcc": "gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0" + }, + "interfaces_sha256": "8e765f80961c32823796bae8b2121523e25ed5cc8d719f4136d16fd7d1448ac7", + "notes": "Ghidra infers an integer return instead of double.", + "original_bindings": "callees: {}\nglobals: {}\n", + "raw_sha256": "dc2cf6bc8f86f14d8b466a90e8fcb9f6c457f4f9c0ab9643500f67c0e1db7a91", + "setup": [ + "Load at 0x400000 to match the verifier.", + "Treat the ELF target entry as an ordinary function using the default C calling convention; no source types supplied." + ], + "source_case": "signed-zero" + }, + "expected_error": "original and candidate logical types differ; supply original_prototype if inference is insufficient" + }, + { + "name": "ghidra-nan-payload", + "label": "Ghidra: nan payload", + "binary": "binaries/ghidra-nan-payload.elf", + "binary_sha256": "253009e2afa992db2a2b5ce621e45b8009ad85ee5faf04b35b695239c83ebfb7", + "inputs": [ + "0x401000", + "\n//==============================================================================\n// DATA TYPES \n// These types were decompiled from the binary and may not match original source\n//==============================================================================\n\ntypedef unsigned char undefined;\n\ntypedef unsigned char byte;\ntypedef unsigned char dwfenc;\ntypedef unsigned int dword;\ntypedef unsigned long qword;\ntypedef unsigned long undefined8;\ntypedef unsigned short word;\ntypedef unsigned long long unkbyte9;\ntypedef unsigned long long unkbyte10;\ntypedef unsigned long long unkbyte11;\ntypedef unsigned long long unkbyte12;\ntypedef unsigned long long unkbyte13;\ntypedef unsigned long long unkbyte14;\ntypedef unsigned long long unkbyte15;\ntypedef unsigned long long unkbyte16;\n\ntypedef unsigned long long unkuint9;\ntypedef unsigned long long unkuint10;\ntypedef unsigned long long unkuint11;\ntypedef unsigned long long unkuint12;\ntypedef unsigned long long unkuint13;\ntypedef unsigned long long unkuint14;\ntypedef unsigned long long unkuint15;\ntypedef unsigned long long unkuint16;\n\ntypedef long long unkint9;\ntypedef long long unkint10;\ntypedef long long unkint11;\ntypedef long long unkint12;\ntypedef long long unkint13;\ntypedef long long unkint14;\ntypedef long long unkint15;\ntypedef long long unkint16;\n\ntypedef float unkfloat1;\ntypedef float unkfloat2;\ntypedef float unkfloat3;\ntypedef double unkfloat5;\ntypedef double unkfloat6;\ntypedef double unkfloat7;\ntypedef long double unkfloat9;\ntypedef long double unkfloat11;\ntypedef long double unkfloat12;\ntypedef long double unkfloat13;\ntypedef long double unkfloat14;\ntypedef long double unkfloat15;\ntypedef long double unkfloat16;\n\ntypedef void BADSPACEBASE;\ntypedef void code;\n\n// C99 lacks bool, define it as byte for C-only output\n#if !defined(__cplusplus) && !defined(NO_BOOL)\ntypedef unsigned char bool;\n#endif\n\n\n\n\n\n//==============================================================================\n// FUNCTION DECLARATIONS \n// These function prototypes were extracted from binary analysis \n//==============================================================================\n\nundefined8 target(void);\n\n\n//==============================================================================\n// FUNCTION IMPLEMENTATIONS \n// Decompiled code from the binary \n//==============================================================================\n\nundefined8 target(void)\n\n{\n return 0x7ff8000000000001;\n}\n\n\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_base: 4194304\noriginal_prototype: double target(void);\n" + ], + "reference": "#include \n\ndouble target(void) {\n union { uint64_t bits; double value; } nan = { .bits = UINT64_C(0x7ff8000000000001) };\n return nan.value;\n}\n", + "expected_verdict": null, + "ghidra": { + "adaptations": [], + "also_covers": [], + "candidate_sha256": "af0c56c9321faa5eecd6e824afed4da0f0b8e9d00b3467a55f645d5c87625064", + "candidate_symbol": "target", + "compiler": "gcc", + "expected_error": "original and candidate logical types differ; supply original_prototype if inference is insufficient", + "export_options": { + "address_set_str": "0x401000", + "run_decompiler_parameter_id": true + }, + "exported_globals": {}, + "exporter": { + "commit": "285529b434f6e46827e001c42eb1b090e187eaf9", + "repository": "https://github.com/edmcman/GhidraFunctionCPPExporter", + "sha256": "cb0d1c5c78f3c07cb2cc385165d9008efa112206acf488f1303d5c34458c3e67" + }, + "flags": "-O2", + "ghidra_revision": "8b4c91d4d5bd1549622bfbade0df199585b98365", + "ghidra_version": "12.1.3", + "image_base": "0x400000", + "input_binary_sha256": "253009e2afa992db2a2b5ce621e45b8009ad85ee5faf04b35b695239c83ebfb7", + "input_toolchain": { + "clang": "Ubuntu clang version 18.1.3 (1ubuntu1)", + "gcc": "gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0" + }, + "interfaces_sha256": "8e765f80961c32823796bae8b2121523e25ed5cc8d719f4136d16fd7d1448ac7", + "notes": "Ghidra preserves the payload as an integer constant but infers integer return instead of double.", + "original_bindings": "callees: {}\nglobals: {}\n", + "raw_sha256": "af0c56c9321faa5eecd6e824afed4da0f0b8e9d00b3467a55f645d5c87625064", + "setup": [ + "Load at 0x400000 to match the verifier.", + "Treat the ELF target entry as an ordinary function using the default C calling convention; no source types supplied." + ], + "source_case": "nan-payload" + }, + "expected_error": "original and candidate logical types differ; supply original_prototype if inference is insufficient" + }, + { + "name": "ghidra-struct-fields", + "label": "Ghidra: struct fields", + "binary": "binaries/ghidra-struct-fields.elf", + "binary_sha256": "2b1504a5f36ab87d389be925fb6afaf19b7e7a53678a933ce5336652c51fca50", + "inputs": [ + "0x401000", + "\n//==============================================================================\n// DATA TYPES \n// These types were decompiled from the binary and may not match original source\n//==============================================================================\n\ntypedef unsigned char undefined;\n\ntypedef unsigned char byte;\ntypedef unsigned char dwfenc;\ntypedef unsigned int dword;\ntypedef unsigned long qword;\ntypedef unsigned char undefined1;\ntypedef unsigned long undefined8;\ntypedef unsigned short word;\ntypedef unsigned long long unkbyte9;\ntypedef unsigned long long unkbyte10;\ntypedef unsigned long long unkbyte11;\ntypedef unsigned long long unkbyte12;\ntypedef unsigned long long unkbyte13;\ntypedef unsigned long long unkbyte14;\ntypedef unsigned long long unkbyte15;\ntypedef unsigned long long unkbyte16;\n\ntypedef unsigned long long unkuint9;\ntypedef unsigned long long unkuint10;\ntypedef unsigned long long unkuint11;\ntypedef unsigned long long unkuint12;\ntypedef unsigned long long unkuint13;\ntypedef unsigned long long unkuint14;\ntypedef unsigned long long unkuint15;\ntypedef unsigned long long unkuint16;\n\ntypedef long long unkint9;\ntypedef long long unkint10;\ntypedef long long unkint11;\ntypedef long long unkint12;\ntypedef long long unkint13;\ntypedef long long unkint14;\ntypedef long long unkint15;\ntypedef long long unkint16;\n\ntypedef float unkfloat1;\ntypedef float unkfloat2;\ntypedef float unkfloat3;\ntypedef double unkfloat5;\ntypedef double unkfloat6;\ntypedef double unkfloat7;\ntypedef long double unkfloat9;\ntypedef long double unkfloat11;\ntypedef long double unkfloat12;\ntypedef long double unkfloat13;\ntypedef long double unkfloat14;\ntypedef long double unkfloat15;\ntypedef long double unkfloat16;\n\ntypedef void BADSPACEBASE;\ntypedef void code;\n\n// C99 lacks bool, define it as byte for C-only output\n#if !defined(__cplusplus) && !defined(NO_BOOL)\ntypedef unsigned char bool;\n#endif\n\n\n\n\n\n//==============================================================================\n// FUNCTION DECLARATIONS \n// These function prototypes were extracted from binary analysis \n//==============================================================================\n\nundefined1 [16] target(long param_1,undefined8 param_2);\n\n\n//==============================================================================\n// FUNCTION IMPLEMENTATIONS \n// Decompiled code from the binary \n//==============================================================================\n\nundefined1 [16] target(long param_1,undefined8 param_2)\n\n{\n undefined1 auVar1 [16];\n \n auVar1._8_8_ = param_2;\n auVar1._0_8_ = param_1 + 3;\n return auVar1;\n}\n\n\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_base: 4194304\noriginal_prototype: '#include \n\n struct Pair { uint64_t first, second; };\n\n struct Pair target(struct Pair x);\n\n '\n" + ], + "reference": "#include \n\nstruct Pair { uint64_t first, second; };\n\nstruct Pair target(struct Pair x) {\n x.first += 3;\n return x;\n}\n", + "expected_verdict": null, + "ghidra": { + "adaptations": [], + "also_covers": [], + "candidate_sha256": "4f53cf5cae52add716d4e8caf23a392dce6971d1c98dcbc0e6d6b3c77087de09", + "candidate_symbol": "target", + "compiler": "gcc", + "expected_error": "candidate compilation failed:", + "export_options": { + "address_set_str": "0x401000", + "run_decompiler_parameter_id": true + }, + "exported_globals": {}, + "exporter": { + "commit": "285529b434f6e46827e001c42eb1b090e187eaf9", + "repository": "https://github.com/edmcman/GhidraFunctionCPPExporter", + "sha256": "cb0d1c5c78f3c07cb2cc385165d9008efa112206acf488f1303d5c34458c3e67" + }, + "flags": "-O2", + "ghidra_revision": "8b4c91d4d5bd1549622bfbade0df199585b98365", + "ghidra_version": "12.1.3", + "image_base": "0x400000", + "input_binary_sha256": "2b1504a5f36ab87d389be925fb6afaf19b7e7a53678a933ce5336652c51fca50", + "input_toolchain": { + "clang": "Ubuntu clang version 18.1.3 (1ubuntu1)", + "gcc": "gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0" + }, + "interfaces_sha256": "083ed6d0c7f5c444bbbedb0ebd5c95895974199c3f8431d31771a6f12fee4a4b", + "notes": "Ghidra emits an array return declaration and slice syntax that are not valid C.", + "original_bindings": "callees: {}\nglobals: {}\n", + "raw_sha256": "4f53cf5cae52add716d4e8caf23a392dce6971d1c98dcbc0e6d6b3c77087de09", + "setup": [ + "Load at 0x400000 to match the verifier.", + "Treat the ELF target entry as an ordinary function using the default C calling convention; no source types supplied." + ], + "source_case": "struct-fields" + }, + "expected_error": "candidate compilation failed:" + }, + { + "name": "ghidra-struct-indirect", + "label": "Ghidra: struct indirect", + "binary": "binaries/ghidra-struct-indirect.elf", + "binary_sha256": "2b5d94eeea99772bc228d54c66ebd03b3beca9060ed12cb4286f94330bb04318", + "inputs": [ + "0x401000", + "\n//==============================================================================\n// DATA TYPES \n// These types were decompiled from the binary and may not match original source\n//==============================================================================\n\ntypedef unsigned char undefined;\n\ntypedef unsigned char byte;\ntypedef unsigned char dwfenc;\ntypedef unsigned int dword;\ntypedef unsigned long qword;\ntypedef unsigned short word;\ntypedef unsigned long long unkbyte9;\ntypedef unsigned long long unkbyte10;\ntypedef unsigned long long unkbyte11;\ntypedef unsigned long long unkbyte12;\ntypedef unsigned long long unkbyte13;\ntypedef unsigned long long unkbyte14;\ntypedef unsigned long long unkbyte15;\ntypedef unsigned long long unkbyte16;\n\ntypedef unsigned long long unkuint9;\ntypedef unsigned long long unkuint10;\ntypedef unsigned long long unkuint11;\ntypedef unsigned long long unkuint12;\ntypedef unsigned long long unkuint13;\ntypedef unsigned long long unkuint14;\ntypedef unsigned long long unkuint15;\ntypedef unsigned long long unkuint16;\n\ntypedef long long unkint9;\ntypedef long long unkint10;\ntypedef long long unkint11;\ntypedef long long unkint12;\ntypedef long long unkint13;\ntypedef long long unkint14;\ntypedef long long unkint15;\ntypedef long long unkint16;\n\ntypedef float unkfloat1;\ntypedef float unkfloat2;\ntypedef float unkfloat3;\ntypedef double unkfloat5;\ntypedef double unkfloat6;\ntypedef double unkfloat7;\ntypedef long double unkfloat9;\ntypedef long double unkfloat11;\ntypedef long double unkfloat12;\ntypedef long double unkfloat13;\ntypedef long double unkfloat14;\ntypedef long double unkfloat15;\ntypedef long double unkfloat16;\n\ntypedef void BADSPACEBASE;\ntypedef void code;\n\n// C99 lacks bool, define it as byte for C-only output\n#if !defined(__cplusplus) && !defined(NO_BOOL)\ntypedef unsigned char bool;\n#endif\n\n\n\n\n\n//==============================================================================\n// FUNCTION DECLARATIONS \n// These function prototypes were extracted from binary analysis \n//==============================================================================\n\nlong * target(long *param_1);\n\n\n//==============================================================================\n// FUNCTION IMPLEMENTATIONS \n// Decompiled code from the binary \n//==============================================================================\n\nlong * target(long *param_1)\n\n{\n long in_stack_00000008;\n long in_stack_00000010;\n long in_stack_00000018;\n \n param_1[2] = in_stack_00000018;\n *param_1 = in_stack_00000008 + 3;\n param_1[1] = in_stack_00000010;\n return param_1;\n}\n\n\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_base: 4194304\noriginal_prototype: '#include \n\n struct Triple { uint64_t first, second, third; };\n\n struct Triple target(struct Triple x);\n\n '\n" + ], + "reference": "#include \n\nstruct Triple { uint64_t first, second, third; };\n\nstruct Triple target(struct Triple x) {\n x.first += 3;\n return x;\n}\n", + "expected_verdict": null, + "ghidra": { + "adaptations": [], + "also_covers": [], + "candidate_sha256": "0b19fee6de1681e258fdf9c29ea39a1c504991823493a66541348a23451722ad", + "candidate_symbol": "target", + "compiler": "gcc", + "expected_error": "original and candidate logical types differ; supply original_prototype if inference is insufficient", + "export_options": { + "address_set_str": "0x401000", + "run_decompiler_parameter_id": true + }, + "exported_globals": {}, + "exporter": { + "commit": "285529b434f6e46827e001c42eb1b090e187eaf9", + "repository": "https://github.com/edmcman/GhidraFunctionCPPExporter", + "sha256": "cb0d1c5c78f3c07cb2cc385165d9008efa112206acf488f1303d5c34458c3e67" + }, + "flags": "-O2", + "ghidra_revision": "8b4c91d4d5bd1549622bfbade0df199585b98365", + "ghidra_version": "12.1.3", + "image_base": "0x400000", + "input_binary_sha256": "2b5d94eeea99772bc228d54c66ebd03b3beca9060ed12cb4286f94330bb04318", + "input_toolchain": { + "clang": "Ubuntu clang version 18.1.3 (1ubuntu1)", + "gcc": "gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0" + }, + "interfaces_sha256": "105cb716738e501e997e06d6d4649253bb47575b88c127dd33667ccc5b50834d", + "notes": "Ghidra exposes the hidden return pointer and uninitialized stack locals instead of the original struct interface.", + "original_bindings": "callees: {}\nglobals: {}\n", + "raw_sha256": "0b19fee6de1681e258fdf9c29ea39a1c504991823493a66541348a23451722ad", + "setup": [ + "Load at 0x400000 to match the verifier.", + "Treat the ELF target entry as an ordinary function using the default C calling convention; no source types supplied." + ], + "source_case": "struct-indirect" + }, + "expected_error": "original and candidate logical types differ; supply original_prototype if inference is insufficient" + }, + { + "name": "ghidra-struct-padding", + "label": "Ghidra: struct padding", + "binary": "binaries/ghidra-struct-padding.elf", + "binary_sha256": "f2f978dfd8f491547d9d7ae586f7b6c536ed7291760a30b61319931a69e34ef5", + "inputs": [ + "0x401000", + "\n//==============================================================================\n// DATA TYPES \n// These types were decompiled from the binary and may not match original source\n//==============================================================================\n\ntypedef unsigned char undefined;\n\ntypedef unsigned char byte;\ntypedef unsigned char dwfenc;\ntypedef unsigned int dword;\ntypedef unsigned long qword;\ntypedef unsigned char undefined1;\ntypedef unsigned long undefined8;\ntypedef unsigned short word;\ntypedef unsigned long long unkbyte9;\ntypedef unsigned long long unkbyte10;\ntypedef unsigned long long unkbyte11;\ntypedef unsigned long long unkbyte12;\ntypedef unsigned long long unkbyte13;\ntypedef unsigned long long unkbyte14;\ntypedef unsigned long long unkbyte15;\ntypedef unsigned long long unkbyte16;\n\ntypedef unsigned long long unkuint9;\ntypedef unsigned long long unkuint10;\ntypedef unsigned long long unkuint11;\ntypedef unsigned long long unkuint12;\ntypedef unsigned long long unkuint13;\ntypedef unsigned long long unkuint14;\ntypedef unsigned long long unkuint15;\ntypedef unsigned long long unkuint16;\n\ntypedef long long unkint9;\ntypedef long long unkint10;\ntypedef long long unkint11;\ntypedef long long unkint12;\ntypedef long long unkint13;\ntypedef long long unkint14;\ntypedef long long unkint15;\ntypedef long long unkint16;\n\ntypedef float unkfloat1;\ntypedef float unkfloat2;\ntypedef float unkfloat3;\ntypedef double unkfloat5;\ntypedef double unkfloat6;\ntypedef double unkfloat7;\ntypedef long double unkfloat9;\ntypedef long double unkfloat11;\ntypedef long double unkfloat12;\ntypedef long double unkfloat13;\ntypedef long double unkfloat14;\ntypedef long double unkfloat15;\ntypedef long double unkfloat16;\n\ntypedef void BADSPACEBASE;\ntypedef void code;\n\n// C99 lacks bool, define it as byte for C-only output\n#if !defined(__cplusplus) && !defined(NO_BOOL)\ntypedef unsigned char bool;\n#endif\n\n\n\n\n\n//==============================================================================\n// FUNCTION DECLARATIONS \n// These function prototypes were extracted from binary analysis \n//==============================================================================\n\nundefined1 [16] target(void);\n\n\n//==============================================================================\n// FUNCTION IMPLEMENTATIONS \n// Decompiled code from the binary \n//==============================================================================\n\nundefined1 [16] target(void)\n\n{\n undefined1 auVar1 [16];\n \n auVar1._8_8_ = 2;\n auVar1._0_8_ = 0xaaaaaaaaaaaaaa01;\n return auVar1;\n}\n\n\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_base: 4194304\noriginal_prototype: '#include \n\n struct Record { uint8_t tag; uint64_t value; };\n\n struct Record target(void);\n\n '\n" + ], + "reference": "#include \n\nstruct Record { uint8_t tag; uint64_t value; };\n\nstruct Record target(void) {\n struct Record result;\n __builtin_memset(&result, 0xaa, sizeof result);\n result.tag = 1;\n result.value = 2;\n return result;\n}\n", + "expected_verdict": null, + "ghidra": { + "adaptations": [], + "also_covers": [], + "candidate_sha256": "6ce17453ffe878467d7977df3ac9222e7fc98a74cfba32ed3e6922c1fd289dd9", + "candidate_symbol": "target", + "compiler": "gcc", + "expected_error": "candidate compilation failed:", + "export_options": { + "address_set_str": "0x401000", + "run_decompiler_parameter_id": true + }, + "exported_globals": {}, + "exporter": { + "commit": "285529b434f6e46827e001c42eb1b090e187eaf9", + "repository": "https://github.com/edmcman/GhidraFunctionCPPExporter", + "sha256": "cb0d1c5c78f3c07cb2cc385165d9008efa112206acf488f1303d5c34458c3e67" + }, + "flags": "-O2", + "ghidra_revision": "8b4c91d4d5bd1549622bfbade0df199585b98365", + "ghidra_version": "12.1.3", + "image_base": "0x400000", + "input_binary_sha256": "f2f978dfd8f491547d9d7ae586f7b6c536ed7291760a30b61319931a69e34ef5", + "input_toolchain": { + "clang": "Ubuntu clang version 18.1.3 (1ubuntu1)", + "gcc": "gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0" + }, + "interfaces_sha256": "c77372b16dfd9ce02b686e777e17cf3dc2b95fe380b81c3ed70173c17d9a7482", + "notes": "Ghidra emits an array return declaration and slice syntax that are not valid C.", + "original_bindings": "callees: {}\nglobals: {}\n", + "raw_sha256": "6ce17453ffe878467d7977df3ac9222e7fc98a74cfba32ed3e6922c1fd289dd9", + "setup": [ + "Load at 0x400000 to match the verifier.", + "Treat the ELF target entry as an ordinary function using the default C calling convention; no source types supplied." + ], + "source_case": "struct-padding" + }, + "expected_error": "candidate compilation failed:" + }, + { + "name": "ghidra-pointer-identity", + "label": "Ghidra: pointer identity", + "binary": "binaries/ghidra-pointer-identity.elf", + "binary_sha256": "5c3cc2e9fc9af5915812dd54613e4b5716442fcc178eb63c5c2402fc73c88886", + "inputs": [ + "0x401000", + "\n//==============================================================================\n// DATA TYPES \n// These types were decompiled from the binary and may not match original source\n//==============================================================================\n\ntypedef unsigned char undefined;\n\ntypedef unsigned char byte;\ntypedef unsigned char dwfenc;\ntypedef unsigned int dword;\ntypedef unsigned long qword;\ntypedef unsigned long undefined8;\ntypedef unsigned short word;\ntypedef unsigned long long unkbyte9;\ntypedef unsigned long long unkbyte10;\ntypedef unsigned long long unkbyte11;\ntypedef unsigned long long unkbyte12;\ntypedef unsigned long long unkbyte13;\ntypedef unsigned long long unkbyte14;\ntypedef unsigned long long unkbyte15;\ntypedef unsigned long long unkbyte16;\n\ntypedef unsigned long long unkuint9;\ntypedef unsigned long long unkuint10;\ntypedef unsigned long long unkuint11;\ntypedef unsigned long long unkuint12;\ntypedef unsigned long long unkuint13;\ntypedef unsigned long long unkuint14;\ntypedef unsigned long long unkuint15;\ntypedef unsigned long long unkuint16;\n\ntypedef long long unkint9;\ntypedef long long unkint10;\ntypedef long long unkint11;\ntypedef long long unkint12;\ntypedef long long unkint13;\ntypedef long long unkint14;\ntypedef long long unkint15;\ntypedef long long unkint16;\n\ntypedef float unkfloat1;\ntypedef float unkfloat2;\ntypedef float unkfloat3;\ntypedef double unkfloat5;\ntypedef double unkfloat6;\ntypedef double unkfloat7;\ntypedef long double unkfloat9;\ntypedef long double unkfloat11;\ntypedef long double unkfloat12;\ntypedef long double unkfloat13;\ntypedef long double unkfloat14;\ntypedef long double unkfloat15;\ntypedef long double unkfloat16;\n\ntypedef void BADSPACEBASE;\ntypedef void code;\n\n// C99 lacks bool, define it as byte for C-only output\n#if !defined(__cplusplus) && !defined(NO_BOOL)\ntypedef unsigned char bool;\n#endif\n\n\n\n\n\n//==============================================================================\n// FUNCTION DECLARATIONS \n// These function prototypes were extracted from binary analysis \n//==============================================================================\n\nundefined8 target(undefined8 param_1);\n\n\n//==============================================================================\n// FUNCTION IMPLEMENTATIONS \n// Decompiled code from the binary \n//==============================================================================\n\nundefined8 target(undefined8 param_1)\n\n{\n return param_1;\n}\n\n\n", + "callees: {}\nglobals: {}\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_base: 4194304\noriginal_prototype: void * target(void * p);\n" + ], + "reference": "const void *target(const void *p) {\n return p;\n}\n", + "expected_verdict": null, + "ghidra": { + "adaptations": [], + "also_covers": [], + "candidate_sha256": "2b6be1c3bc90cf4ba210d6f43c46fd4b43476b4a061a7e19df04852dcb02ae15", + "candidate_symbol": "target", + "compiler": "gcc", + "expected_error": "original and candidate logical types differ; supply original_prototype if inference is insufficient", + "export_options": { + "address_set_str": "0x401000", + "run_decompiler_parameter_id": true + }, + "exported_globals": {}, + "exporter": { + "commit": "285529b434f6e46827e001c42eb1b090e187eaf9", + "repository": "https://github.com/edmcman/GhidraFunctionCPPExporter", + "sha256": "cb0d1c5c78f3c07cb2cc385165d9008efa112206acf488f1303d5c34458c3e67" + }, + "flags": "-O2", + "ghidra_revision": "8b4c91d4d5bd1549622bfbade0df199585b98365", + "ghidra_version": "12.1.3", + "image_base": "0x400000", + "input_binary_sha256": "5c3cc2e9fc9af5915812dd54613e4b5716442fcc178eb63c5c2402fc73c88886", + "input_toolchain": { + "clang": "Ubuntu clang version 18.1.3 (1ubuntu1)", + "gcc": "gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0" + }, + "interfaces_sha256": "9107464db9cdf4217789e45f73891ce42544a6bee48fe1c877568b8663e1e2ee", + "notes": "Ghidra infers integer input and return instead of pointer types.", + "original_bindings": "callees: {}\nglobals: {}\n", + "raw_sha256": "2b6be1c3bc90cf4ba210d6f43c46fd4b43476b4a061a7e19df04852dcb02ae15", + "setup": [ + "Load at 0x400000 to match the verifier.", + "Treat the ELF target entry as an ordinary function using the default C calling convention; no source types supplied." + ], + "source_case": "pointer-identity" + }, + "expected_error": "original and candidate logical types differ; supply original_prototype if inference is insufficient" + }, + { + "name": "ghidra-void-memory", + "label": "Ghidra: void memory", + "binary": "binaries/ghidra-void-memory.elf", + "binary_sha256": "067e6f54cff95e14978d44c952a3cb546071412fe2e4d7744599090938a99649", + "inputs": [ + "0x401000", + "\n//==============================================================================\n// DATA TYPES \n// These types were decompiled from the binary and may not match original source\n//==============================================================================\n\ntypedef unsigned char undefined;\n\ntypedef unsigned char byte;\ntypedef unsigned char dwfenc;\ntypedef unsigned int dword;\ntypedef unsigned long qword;\ntypedef unsigned int undefined4;\ntypedef unsigned short word;\ntypedef unsigned long long unkbyte9;\ntypedef unsigned long long unkbyte10;\ntypedef unsigned long long unkbyte11;\ntypedef unsigned long long unkbyte12;\ntypedef unsigned long long unkbyte13;\ntypedef unsigned long long unkbyte14;\ntypedef unsigned long long unkbyte15;\ntypedef unsigned long long unkbyte16;\n\ntypedef unsigned long long unkuint9;\ntypedef unsigned long long unkuint10;\ntypedef unsigned long long unkuint11;\ntypedef unsigned long long unkuint12;\ntypedef unsigned long long unkuint13;\ntypedef unsigned long long unkuint14;\ntypedef unsigned long long unkuint15;\ntypedef unsigned long long unkuint16;\n\ntypedef long long unkint9;\ntypedef long long unkint10;\ntypedef long long unkint11;\ntypedef long long unkint12;\ntypedef long long unkint13;\ntypedef long long unkint14;\ntypedef long long unkint15;\ntypedef long long unkint16;\n\ntypedef float unkfloat1;\ntypedef float unkfloat2;\ntypedef float unkfloat3;\ntypedef double unkfloat5;\ntypedef double unkfloat6;\ntypedef double unkfloat7;\ntypedef long double unkfloat9;\ntypedef long double unkfloat11;\ntypedef long double unkfloat12;\ntypedef long double unkfloat13;\ntypedef long double unkfloat14;\ntypedef long double unkfloat15;\ntypedef long double unkfloat16;\n\ntypedef void BADSPACEBASE;\ntypedef void code;\n\n// C99 lacks bool, define it as byte for C-only output\n#if !defined(__cplusplus) && !defined(NO_BOOL)\ntypedef unsigned char bool;\n#endif\n\n\n\n\n\n//==============================================================================\n// FUNCTION DECLARATIONS \n// These function prototypes were extracted from binary analysis \n//==============================================================================\n\nvoid target(undefined4 param_1);\n\n\n//==============================================================================\n// GLOBAL VARIABLES \n// These global variables were referenced in the decompiled functions \n//==============================================================================\n\nextern undefined4 output;\n\n\n//==============================================================================\n// FUNCTION IMPLEMENTATIONS \n// Decompiled code from the binary \n//==============================================================================\n\nvoid target(undefined4 param_1)\n\n{\n output = param_1;\n return;\n}\n\n\n", + "callees: {}\nglobals:\n output: '0x403000'\n", + "target", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_base: 4194304\noriginal_prototype: void target(unsigned int x);\n" + ], + "reference": "unsigned output;\n\nvoid target(unsigned x) {\n output = x;\n}\n", + "expected_verdict": "agree", + "ghidra": { + "adaptations": [ + { + "from": "undefined4 output;", + "line": 81, + "reason": "Bind the global to original storage instead of defining candidate storage.", + "to": "extern undefined4 output;" + } + ], + "also_covers": [], + "candidate_sha256": "3d1193dc343c0c08bba3d014a1d9b9896e5011e85a69743c456780fc1b73c0cf", + "candidate_symbol": "target", + "compiler": "gcc", + "expected_verdict": "agree", + "export_options": { + "address_set_str": "0x401000", + "run_decompiler_parameter_id": true + }, + "exported_globals": { + "output": "0x403000" + }, + "exporter": { + "commit": "285529b434f6e46827e001c42eb1b090e187eaf9", + "repository": "https://github.com/edmcman/GhidraFunctionCPPExporter", + "sha256": "cb0d1c5c78f3c07cb2cc385165d9008efa112206acf488f1303d5c34458c3e67" + }, + "flags": "-O2", + "ghidra_revision": "8b4c91d4d5bd1549622bfbade0df199585b98365", + "ghidra_version": "12.1.3", + "image_base": "0x400000", + "input_binary_sha256": "067e6f54cff95e14978d44c952a3cb546071412fe2e4d7744599090938a99649", + "input_toolchain": { + "clang": "Ubuntu clang version 18.1.3 (1ubuntu1)", + "gcc": "gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0" + }, + "interfaces_sha256": "e5aa1f7c2fc4f8970abc2a024e27359c5e4ecda70a287e917362aca2d29436cb", + "original_bindings": "callees: {}\nglobals:\n output: '0x403000'\n", + "raw_sha256": "d3c8f7abcfc950f43248571d05ba3e7971becb9b7e541a109626ede49608a03a", + "setup": [ + "Load at 0x400000 to match the verifier.", + "Treat the ELF target entry as an ordinary function using the default C calling convention; no source types supplied." + ], + "source_case": "void-memory" + }, + "expected_error": null + }, + { + "name": "ghidra-factor-gcd", + "label": "Ghidra: factor gcd", + "binary": "binaries/factor", + "binary_sha256": "c87caacbd2a40fb4e16398e8cf1d7aceca214af64b09e9635ebdbb449898478b", + "inputs": [ + "0x403300", + "#ifndef true\n#define true 1\n#endif\n#ifndef false\n#define false 0\n#endif\n\n\n//==============================================================================\n// DATA TYPES \n// These types were decompiled from the binary and may not match original source\n//==============================================================================\n\ntypedef unsigned char undefined;\n\ntypedef unsigned char bool;\ntypedef unsigned char byte;\ntypedef unsigned char dwfenc;\ntypedef unsigned int dword;\ntypedef unsigned long qword;\ntypedef unsigned int uint;\ntypedef unsigned long ulong;\ntypedef unsigned char undefined1;\ntypedef unsigned int undefined4;\ntypedef unsigned long undefined8;\ntypedef unsigned short ushort;\ntypedef unsigned short word;\ntypedef unsigned long long unkbyte9;\ntypedef unsigned long long unkbyte10;\ntypedef unsigned long long unkbyte11;\ntypedef unsigned long long unkbyte12;\ntypedef unsigned long long unkbyte13;\ntypedef unsigned long long unkbyte14;\ntypedef unsigned long long unkbyte15;\ntypedef unsigned long long unkbyte16;\n\ntypedef unsigned long long unkuint9;\ntypedef unsigned long long unkuint10;\ntypedef unsigned long long unkuint11;\ntypedef unsigned long long unkuint12;\ntypedef unsigned long long unkuint13;\ntypedef unsigned long long unkuint14;\ntypedef unsigned long long unkuint15;\ntypedef unsigned long long unkuint16;\n\ntypedef long long unkint9;\ntypedef long long unkint10;\ntypedef long long unkint11;\ntypedef long long unkint12;\ntypedef long long unkint13;\ntypedef long long unkint14;\ntypedef long long unkint15;\ntypedef long long unkint16;\n\ntypedef float unkfloat1;\ntypedef float unkfloat2;\ntypedef float unkfloat3;\ntypedef double unkfloat5;\ntypedef double unkfloat6;\ntypedef double unkfloat7;\ntypedef long double unkfloat9;\ntypedef long double unkfloat11;\ntypedef long double unkfloat12;\ntypedef long double unkfloat13;\ntypedef long double unkfloat14;\ntypedef long double unkfloat15;\ntypedef long double unkfloat16;\n\ntypedef void BADSPACEBASE;\ntypedef void code;\n\n// C99 lacks bool, define it as byte for C-only output\n#if !defined(__cplusplus) && !defined(NO_BOOL)\ntypedef unsigned char bool;\n#endif\n\n\n\n\n\n//==============================================================================\n// FUNCTION DECLARATIONS \n// These function prototypes were extracted from binary analysis \n//==============================================================================\n\nulong FUN_00403300(ulong param_1,ulong param_2);\n\n\n//==============================================================================\n// FUNCTION IMPLEMENTATIONS \n// Decompiled code from the binary \n//==============================================================================\n\nulong FUN_00403300(ulong param_1,ulong param_2)\n\n{\n ulong uVar1;\n ulong uVar2;\n ulong uVar3;\n \n uVar1 = param_1;\n if ((param_2 & 1) != 0) {\n uVar1 = param_2;\n param_2 = param_1;\n }\n if (param_2 == 0) {\n return uVar1;\n }\n uVar1 = uVar1 >> 1;\n while( true ) {\n do {\n uVar2 = param_2;\n param_2 = uVar2 >> 1;\n } while ((uVar2 & 1) == 0);\n uVar3 = (uVar2 >> 1) - uVar1;\n if (uVar3 == 0) break;\n uVar2 = (long)uVar3 >> 0x3f;\n uVar1 = uVar1 + (uVar3 & uVar2);\n param_2 = (uVar3 ^ uVar2) - uVar2;\n }\n return uVar2 | 1;\n}\n\n\n", + "callees: {}\nglobals: {}\n", + "FUN_00403300", + 100, + "0", + 100000, + "gcc", + "-O2", + "original_base: 4194304\noriginal_prototype: unsigned long gcd_odd(unsigned long a, unsigned long b);\n" + ], + "reference": "", + "expected_verdict": "agree", + "ghidra": { + "adaptations": [ + { + "prefix": "#ifndef true\n#define true 1\n#endif\n#ifndef false\n#define false 0\n#endif\n\n", + "reason": "Supply C boolean constants used by Ghidra." + } + ], + "also_covers": [ + "factor-gcd-euclidean", + "factor-gcd-even" + ], + "candidate_sha256": "a0951272066178d7e4e6d73b6e8b23d53c7197ca43af689e5911aa127ea56ee0", + "candidate_symbol": "FUN_00403300", + "compiler": "gcc", + "expected_verdict": "agree", + "export_options": { + "address_set_str": "0x403300", + "run_decompiler_parameter_id": true + }, + "exported_globals": {}, + "exporter": { + "commit": "285529b434f6e46827e001c42eb1b090e187eaf9", + "repository": "https://github.com/edmcman/GhidraFunctionCPPExporter", + "sha256": "cb0d1c5c78f3c07cb2cc385165d9008efa112206acf488f1303d5c34458c3e67" + }, + "flags": "-O2", + "ghidra_revision": "8b4c91d4d5bd1549622bfbade0df199585b98365", + "ghidra_version": "12.1.3", + "image_base": "0x400000", + "input_binary_sha256": "c87caacbd2a40fb4e16398e8cf1d7aceca214af64b09e9635ebdbb449898478b", + "input_toolchain": { + "clang": "Ubuntu clang version 18.1.3 (1ubuntu1)", + "gcc": "gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0" + }, + "interfaces_sha256": "53eb9a78edb2b0ae0001e59fde7a5a3d865046db58b36207d479d5988330f6ae", + "original_bindings": "callees: {}\nglobals: {}\n", + "raw_sha256": "3ac07c971c8da6ceadae6b68c9421f7e3486c8ca280534c5681bdc14a9a751a4", + "setup": [ + "Load at 0x400000 to match the verifier." + ], + "source_case": "factor-gcd" + }, + "expected_error": null + } +] diff --git a/examples/coreutils.copyright b/examples/coreutils.copyright new file mode 100644 index 0000000000000000000000000000000000000000..24c7bf6ec1fe61017c74ac1785e4d1e273b46808 --- /dev/null +++ b/examples/coreutils.copyright @@ -0,0 +1,124 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Comment: This is the Debian GNU/Linux packaged version of the GNU core + utilities. + This package is maintained by Michael Stone . + See the file AUTHORS for a list of each program's main authors. +Source: ftp://ftp.gnu.org/gnu/coreutils + +Files: * +Copyright: (C) 1984-2023 Free Software Foundation, Inc. +License: GPL-3+ + +Files: lib/fts.c + lib/fts_.h +Copyright: (C) 2004-2020, 2008 Free Software Foundation, Inc. + (c) 1989, 1990, 1993, 1994 The Regents of the University of California. All rights reserved. +License: GPL-3+ and BSD-4-clause-UC + +License: GPL-3+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General + Public License can be found in `/usr/share/common-licenses/GPL-3'. + +License: BSD-4-clause-UC + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + +Files: lib/rand-isaac.[ch] +Copyright: (C) 1999-2006 Free Software Foundation, Inc. + (C) 1997, 1998, 1999 Colin Plumb. +License: GPL-3+ + +Files: lib/inet_ntop.c +Copyright: (C) 2005, 2006 Free Software Foundation, Inc. +License: GPL-3+ and ISC + +License: ISC + * Copyright (c) 1996-1999 by Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS + * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE + * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + +Files: m4/autobuild.m4 +Copyright: (C) 2004, 2006-2023 Free Software Foundation, Inc. +License: FSFULLR + This file is free software; the Free Software Foundation + gives unlimited permission to copy and/or distribute it, + with or without modifications, as long as this notice is preserved. +Comment: From Simon Josefsson + +Files: src/cut.c +Copyright: (C) 1997-2007 Free Software Foundation, Inc. + (C) 1984 David M. Ihnat +License: GPL-3+ + +Files: src/dircolors.c +Copyright: (C) 1996-2007 Free Software Foundation, Inc. + (C) 1994, 1995, 1997, 1998, 1999, 2000 H. Peter Anvin +License: GPL-3+ + +Files: src/paste.c +Copyright: (C) 1997-2005 Free Software Foundation, Inc. + (C) 1984 David M. Ihnat +License: GPL-3+ + +Files: src/shred.c +Copyright: (C) 1999-2007 Free Software Foundation, Inc. + (C) 1997, 1998, 1999 Colin Plumb. +License: GPL-3+ + +Files: doc/coreutils.texi +Copyright: 1994-2023 Free Software Foundation, Inc. +License: GFDL-NIV-1.3 + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 or + any later version published by the Free Software Foundation; with no + Invariant Sections, with no Front-Cover Texts, and with no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. + . + On Debian systems, the complete text of the GNU Free Documentation License, + Version 1.3 can be found in `/usr/share/common-licenses/GFDL-1.3'. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..867a77be2bb9f58fb70e1cae030b43a4d73d4945 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,21 @@ +[project] +name = "decompile-verify-gradio" +version = "0.0.0" +requires-python = ">=3.11,<3.12" +dependencies = ["decompile-verify==0.0.0", "gradio==6.9.0"] + +[tool.uv] +package = false + +[tool.uv.sources] +decompile-verify = { path = "core", editable = true } + +[dependency-groups] +dev = ["pytest==8.4.1"] +bootstrap = ["setuptools>=68", "wheel"] + +[tool.pytest.ini_options] +testpaths = ["tests"] +pythonpath = ["."] +addopts = "-ra" +markers = ["demo: demo streaming and UI tests"] diff --git a/requirements-runtime.txt b/requirements-runtime.txt new file mode 100644 index 0000000000000000000000000000000000000000..fa7d22aa19851a33a9ed2c0bdc1a9113cea0d31a --- /dev/null +++ b/requirements-runtime.txt @@ -0,0 +1,634 @@ +# This file was autogenerated by uv via the following command: +# uv export --locked --no-dev --group bootstrap --no-emit-project --no-emit-package decompile-verify --output-file requirements-runtime.txt +aiofiles==24.1.0 \ + --hash=sha256:22a075c9e5a3810f0c2e48f3008c94d68c65d763b9b03857924c99e57355166c \ + --hash=sha256:b4ec55f4195e3eb5d7abd1bf7e061763e864dd4954231fb8539a0ef8bb8260e5 + # via gradio +angr==9.2.175 \ + --hash=sha256:54ea709e2986d1fbff613d903eb731c28da2661fe3c16ca9012c6db2e3a3a531 \ + --hash=sha256:72a6fe03f721307267aad3ccf716e14f8dbdda79d90bfdfcc00235c7529f5e11 \ + --hash=sha256:adf653ff8ffbcd706c050fc75e74b85cc8d3cf1877526fda4c6845ed058a4424 \ + --hash=sha256:b22d58131dfce22fb49fc88d4a64770168b21faf1bcbbd835d75c6b12d238f54 \ + --hash=sha256:b2c67073603862b171d2507a68bf6aaa3adb63bdfdb50931e2e4eff08f5b5fbf \ + --hash=sha256:e5d919c6ebd3958db4557b73388ea1dfd929ca9f6c8f2931a36e6b1b3530ba26 + # via decompile-verify +annotated-doc==0.0.5 \ + --hash=sha256:117bac03a25ede5df5440e855b32d556049ca169ead221505badf432fed4b101 \ + --hash=sha256:c7e58ce09192557605d8bbd92836d7e1d520ac9580096042c0bfd197efacf1bb + # via + # fastapi + # typer +annotated-types==0.8.0 \ + --hash=sha256:13b2beaad985e05e2d6407ee4c4f35590b11f8d693a258a561055cac8f64cab7 \ + --hash=sha256:f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0 + # via pydantic +anyio==4.15.1 \ + --hash=sha256:6152fdbbf9a77fdec97731721bebf7c4c44f7c29b424b0065826173efc7ed101 \ + --hash=sha256:9f28306018cbd6d329e64a36d58256edff76dd996fe423bc957326e578b82a94 + # via + # gradio + # httpx + # starlette +archinfo==9.2.175 \ + --hash=sha256:6e1f928e583f67aff462dfd83e4b9b43c0db225c2b7250764701a587df524da9 \ + --hash=sha256:d73cc95580ea1675cd0b9a6d8d8021017d27484e9f2a1ce867505e459d1dc315 + # via + # angr + # cle +bitarray==3.11.0 \ + --hash=sha256:027766e71da6063cb51fcd4c51f031ac14d5088ecb55e4500ffd692d78630dd3 \ + --hash=sha256:116a23f655f394f80f41fdc03368862485ac05534a56991eefb9f18f72e17f17 \ + --hash=sha256:155205159f3c38180a705253341b8200414c0198e86a9b9e2db49010236ff785 \ + --hash=sha256:1c49fc5f57eea2e859a3f2936a1fed84510af6f7464572b641485de2d22148cb \ + --hash=sha256:30597fa6f4116eb6e374568d4f4de7e220462368ec7ce37d93403871bdf27a8c \ + --hash=sha256:41545b21384fd91767d294a5b3526c6306f7db577cf59ba72b51498e90bd52a7 \ + --hash=sha256:470940879d8553fecddc3cf306b7d4b69fa0f5b7a6e3790b238fe553578061c1 \ + --hash=sha256:4bddbc76e619a36d2abad14713c4dd970a8fa46a75a85ebbb626a2f26f1821d8 \ + --hash=sha256:55370f00c52b5e46800fee0218a27a1b99db6e09113c1b804190c039e4350ea1 \ + --hash=sha256:56a2aa49e900aa927c147328e571da8a38a50ae99277ed093290845498dedefc \ + --hash=sha256:7b16df7ddef03e30622d894cce86a560b7888415ddcac470eb99940a5adf1a35 \ + --hash=sha256:afe8ee837c085eeeaead62429f260a2de3a0602d1a34bcdead8b9f0388ef6114 \ + --hash=sha256:bf19437ec00ec3d40aef82eaeedc14cf4000be9b635c4f5049796506e6630dd8 \ + --hash=sha256:ec3d8b99a92220bdba382acf4eff370d6a6cda34a5ce936726cb9e8cf2427c47 + # via bitstring +bitstring==4.4.0 \ + --hash=sha256:e682ac522bb63e041d16cbc9d0ca86a4f00194db16d0847c7efe066f836b2e37 \ + --hash=sha256:feac49524fcf3ef27e6081e86f02b10d2adf6c3773bf22fbe0e7eea9534bc737 + # via pyvex +brotli==1.2.0 \ + --hash=sha256:022426c9e99fd65d9475dce5c195526f04bb8be8907607e27e747893f6ee3e24 \ + --hash=sha256:15b33fe93cedc4caaff8a0bd1eb7e3dab1c61bb22a0bf5bdfdfd97cd7da79744 \ + --hash=sha256:2a7f1d03727130fc875448b65b127a9ec5d06d19d0148e7554384229706f9d1b \ + --hash=sha256:2e1ad3fda65ae0d93fec742a128d72e145c9c7a99ee2fcd667785d99eb25a7fe \ + --hash=sha256:350c8348f0e76fff0a0fd6c26755d2653863279d086d3aa2c290a6a7251135dd \ + --hash=sha256:40d918bce2b427a0c4ba189df7a006ac0c7277c180aee4617d99e9ccaaf59e6a \ + --hash=sha256:844a8ceb8483fefafc412f85c14f2aae2fb69567bf2a0de53cdb88b73e7c43ae \ + --hash=sha256:898be2be399c221d2671d29eed26b6b2713a02c2119168ed914e7d00ceadb56f \ + --hash=sha256:9c79f57faa25d97900bfb119480806d783fba83cd09ee0b33c17623935b05fa3 \ + --hash=sha256:aa47441fa3026543513139cb8926a92a8e305ee9c71a6209ef7a97d91640ea03 \ + --hash=sha256:e310f77e41941c13340a95976fe66a8a95b01e783d430eeaf7a2f87e0a57dd0a + # via gradio +cachetools==7.2.0 \ + --hash=sha256:3045213f186b89fdd95d94441354c4bd87c570b7a38d8c3fd1d9dd37f6dc90d8 \ + --hash=sha256:bcac1a1b8da6909994a2957238a57b8140dab7c5c5c69a43669654fe87a33c1d + # via + # angr + # claripy +capstone==5.0.3 \ + --hash=sha256:1f15616c0528f5268f2dc0a81708483e605ce71961b02a01a791230b51fe862d \ + --hash=sha256:1f25e23052d5fa5b6709f7111d7f1250131fb5dac878b8249a4637e6ab953129 \ + --hash=sha256:21d00dce9dc204a22126fe6f45a8894d03a6607182bc86f14fc9bd1d1d3897ed \ + --hash=sha256:237fef7e20906bad09286554c7f8a5a744adeec4d658c5e33938bf9241b5f076 \ + --hash=sha256:5917b00ddb0b3a665bcb7a623ee08bcaf4ddec783c5d2ca69f72278d6de38d2c \ + --hash=sha256:5dc6b5f4d85a2ba2330473529d7b4faccd71470b489fd19a539c20b74f3c9924 \ + --hash=sha256:63e8544d7500b889a5feb6f7c9a939723663107dd3360ad18f36a3f6985cfd26 \ + --hash=sha256:76658b66a5f0275c942cd4daf35dca7520387689f588f127020c9130d76c4ddf \ + --hash=sha256:8d45fdf4ae11197234eedbd81742bd4650924f9bb3abee0b238ea63dad8001cc \ + --hash=sha256:a6b7f3ec2346a60475d9d043b437ace5e6688fc9c4d45387476104bd2c231040 \ + --hash=sha256:aebb35f0cfb808aac24d2e3c745be43bcedbb863ecb0192d720faa8002983544 + # via angr +cart==1.2.3 \ + --hash=sha256:32a1f16a5b521e077a540b98942e74d3ae04fba58be3c658f7b7c14dcef1a53f + # via cle +certifi==2026.7.22 \ + --hash=sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775 \ + --hash=sha256:741e2c3b351ddf169a738da9f2c048608ff7f2c5cc02f1ebc6b118bb090d5d55 + # via + # httpcore + # httpx +cffi==2.1.1 \ + --hash=sha256:154852545011f779917b11c78db2358d095da62a9a172b78ad0a583ee5adc0d0 \ + --hash=sha256:3311ed60d36f83378794e1009ac6258bafbf81f7888b4caa7b35a521e3f95813 \ + --hash=sha256:34e261f78cb6ceaaa36f42f2613f4380d94d9c759a9c73c769ee6e0247364632 \ + --hash=sha256:398aff33cee2767e3e781d2554c54bd0dff386bb437581e0d8011fde1a942ec1 \ + --hash=sha256:42f6930c31dc7f50732c9ae793c2786c7b6b044195967bbdde40bb9be81c4cc0 \ + --hash=sha256:6e192623c49c94421616a5778fba35cf0d5a8d000650c1967ef4448ee5cdd990 \ + --hash=sha256:7225e4514edb64eb6740324353e0da0711954fd8d7da4576755b1c6e09b697cd \ + --hash=sha256:a6e721d4b0e45d5b65e87534470e67b18dcd092c83f68fba09f152b9cbc061af \ + --hash=sha256:c7659f22557c5a0bc4855cd635f55edec690cc008a40768527762cb9fb263455 \ + --hash=sha256:c8d2c9fd1f2d16f780d15127abb050d13d1a76c03a4bd87d7e4980e45e511e12 \ + --hash=sha256:dd31f52ea1086513bb9df30f8fcee9b8918323ae067a3d5b78bc826a000712be \ + --hash=sha256:df913725b79db7bcf03448f36b7bf8815363417d5b58deecf9305e3e30f0f21a \ + --hash=sha256:f5cfbc5fe74540d335175b656c725d74d90e3730c626d92575eea35029d9afaa \ + --hash=sha256:f8ec5e643a9a937f64e1999eb9f75d072263751912dc5cd06d3c85f8f44be7c3 + # via + # angr + # pyvex +claripy==9.2.175 \ + --hash=sha256:36e3ca0437d8ff0e0bbce73d78f87a8dc01d9f0fa7267814436669c7ccf17797 \ + --hash=sha256:b50663d4b7934c21ae5ece5b1e452544e3c9d3b86d80be5e061dbec890a63a01 + # via angr +cle==9.2.175 \ + --hash=sha256:5ca5e1678bd1935d3c63479099aa6947987d3a8b14a84b5999b18e4114802c9b \ + --hash=sha256:afc50bdba62f72d6063199a60f1072bf62f5ee782e45ccd828eb1d399b2af2e8 + # via angr +click==8.5.0 \ + --hash=sha256:255bc9599cf7748b4b1a446ccc735421bd08a2ae529a8b88597d3de5664ee360 \ + --hash=sha256:ba0d2089de75ea0310e2dde03160e6ca10009947fb95a182f9b54021bb272e34 + # via + # huggingface-hub + # uvicorn +colorama==0.4.6 ; sys_platform == 'win32' \ + --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \ + --hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6 + # via + # angr + # tqdm + # typer +cxxheaderparser==2.0.0 \ + --hash=sha256:6298f40fcedf8a3a7dbec679c4e88686f24f34edb5bdc1fdca65c1802a4205ab \ + --hash=sha256:d545e6e627bc7d305204a9fe1e9ea4f88983419ec3a6c0fec1e3f419c3006a07 + # via angr +fastapi==0.142.2 \ + --hash=sha256:06366626f2e70576367714d9ab2fe8472e6c8456dba69b399f9f797ab5e92570 \ + --hash=sha256:bd5f4d81f1e93a88bcd77caf4dfe3c2dbffc3805407a0007e9a114c18b3a670b + # via gradio +ffmpy==1.0.0 \ + --hash=sha256:5640e5f0fd03fb6236d0e119b16ccf6522db1c826fdf35dcb87087b60fd7504f \ + --hash=sha256:b12932e95435c8820f1cd041024402765f821971e4bae753b327fc02a6e12f8b + # via gradio +filelock==4.0.9 \ + --hash=sha256:635e7d67fa92654eed444e75e9ca18426d34e77ad9c469bf4373f75a932f7b22 \ + --hash=sha256:9287fd61b99a806e5202be29a83034c0808a1b9830e820537c2f5773981f7eeb + # via huggingface-hub +fsspec==2026.9.0 \ + --hash=sha256:0f08147951c8cb31d844c3547d631053b127863b60be04cf06e121333ee0e2fe \ + --hash=sha256:8dd6e646e99ea382bd85f97a45e6b526a442d79423a7dc673f1e2756d05fcb5f + # via + # gradio-client + # huggingface-hub +gitdb==4.0.12 \ + --hash=sha256:5ef71f855d191a3326fcfbc0d5da835f26b13fbcba60c32c21091c349ffdb571 \ + --hash=sha256:67073e15955400952c6565cc3e707c554a4eea2e428946f7a4c162fab9bd9bcf + # via gitpython +gitpython==3.2.0 \ + --hash=sha256:bd70c5ec05cd2b797423e7eb312147d2458d3cca92085888fba2213f85905537 \ + --hash=sha256:fb92310af6844d96adc95ca066ed2e617c00e1dbd146a326626c81e72e18cc2e + # via angr +gradio==6.9.0 \ + --hash=sha256:593e60e33233f3586452ebfa9f741817c5ae849a98cc70945f3ccb8dc895eb22 \ + --hash=sha256:c173dd330c9247002a42222c85d76c0ecee65437eff808084e360862e7bbd24f + # via decompile-verify-gradio +gradio-client==2.3.0 \ + --hash=sha256:1c700dc60e65bae4386ba7cf3732b9f9d5bcf5fb8eb451df3944fe092d7d9a29 \ + --hash=sha256:9ec51a927888fc188e123a0ac5ad341d9265b325539a399554d1fc2604942e74 + # via gradio +groovy==0.1.2 \ + --hash=sha256:25c1dc09b3f9d7e292458aa762c6beb96ea037071bf5e917fc81fb78d2231083 \ + --hash=sha256:7f7975bab18c729a257a8b1ae9dcd70b7cafb1720481beae47719af57c35fa64 + # via gradio +h11==0.16.0 \ + --hash=sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1 \ + --hash=sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86 + # via + # httpcore + # uvicorn +hf-xet==1.6.0 ; platform_machine == 'AMD64' or platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64' \ + --hash=sha256:0e6e21fa3cdfcdcd76748564bf593870a5e013f47d97cf10aed63aa222cff5b7 \ + --hash=sha256:2e58454a340b3556dfa4972d5451aff4fba8dd42a236600ba1a1d2b1514f0fef \ + --hash=sha256:3dc3e35441ba395006af5aaacc40ef2e603c51ef46c3530b9156185f00935ea3 \ + --hash=sha256:4fc74352a17015bd0ee90038bc9efe38db894cde45f268b6712b04fce8cd0acb \ + --hash=sha256:633dc0cd71d32da58ab8c03ad38e2fac452c15c2b0a2866ebf6ededfe0a5061d \ + --hash=sha256:8fb4f71cba6129110c3374a33f919001ff130488fc23553698e34cc1c2a1198c \ + --hash=sha256:d62671bb130879cef0ee4c9ebe47a14af6c66ec53e6d84dc15936e5ffdfac82f \ + --hash=sha256:f0906082d9932ae0c0057fa194041c22b4e2cdb46b2592ef3b91f020d62a081a \ + --hash=sha256:fb4fadde1b2b70bf4c0c14a6dccbe7194b1c28947fefd5bbe3fed9d940676c3b + # via huggingface-hub +httpcore==1.0.9 \ + --hash=sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55 \ + --hash=sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8 + # via httpx +httpx==0.28.1 \ + --hash=sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc \ + --hash=sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad + # via + # gradio + # gradio-client + # huggingface-hub + # safehttpx +huggingface-hub==1.33.0 \ + --hash=sha256:04e434b06e100eddbce9a6e817d72693a7884b10a79bd67ab48080d5c07eb899 \ + --hash=sha256:367be21a201db9523eddf8aeac7048f2602c1b308691c97640d5e72ed188007e + # via + # gradio + # gradio-client +idna==3.20 \ + --hash=sha256:a7db850025b95ded1eae8a46181a1a6c56c92c96f0e2b005d9ff8dc0210cab44 \ + --hash=sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c + # via + # anyio + # httpx +jinja2==3.1.6 \ + --hash=sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d \ + --hash=sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67 + # via gradio +markdown-it-py==4.2.0 \ + --hash=sha256:04a21681d6fbb623de53f6f364d352309d4094dd4194040a10fd51833e418d49 \ + --hash=sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a + # via rich +markupsafe==3.0.3 \ + --hash=sha256:068f375c472b3e7acbe2d5318dea141359e6900156b5b2ba06a30b169086b91a \ + --hash=sha256:0bf2a864d67e76e5c9a34dc26ec616a66b9888e25e7b9460e1c76d3293bd9dbf \ + --hash=sha256:0db14f5dafddbb6d9208827849fad01f1a2609380add406671a26386cdf15a19 \ + --hash=sha256:1cc7ea17a6824959616c525620e387f6dd30fec8cb44f649e31712db02123dad \ + --hash=sha256:3b562dd9e9ea93f13d53989d23a7e775fdfd1066c33494ff43f5418bc8c58a5c \ + --hash=sha256:4bd4cd07944443f5a265608cc6aab442e4f74dff8088b0dfc8238647b8f6ae9a \ + --hash=sha256:6b5420a1d9450023228968e7e6a9ce57f65d148ab56d2313fcd589eee96a7a50 \ + --hash=sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698 \ + --hash=sha256:7be7b61bb172e1ed687f1754f8e7484f1c8019780f6f6b0786e76bb01c2ae115 \ + --hash=sha256:bc51efed119bc9cfdf792cdeaa4d67e8f6fcccab66ed4bfdd6bde3e59bfcbb2f \ + --hash=sha256:de8a88e63464af587c950061a5e6a67d3632e36df62b986892331d4620a35c01 \ + --hash=sha256:f9e130248f4462aaa8e2552d547f36ddadbeaa573879158d721bbd33dfe4743a + # via + # gradio + # jinja2 +mdurl==0.1.2 \ + --hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 \ + --hash=sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba + # via markdown-it-py +mpmath==1.3.0 \ + --hash=sha256:7a28eb2a9774d00c7bc92411c19a89209d5da7c4c9a9e227be8330a23a25b91f \ + --hash=sha256:a0b2b9fe80bbcd81a6647ff13108738cfb482d481d826cc0e02f5b35e5c88d2c + # via sympy +msgspec==0.22.0 \ + --hash=sha256:024138c51afd335d0b4dce401be33902caafac2b64f8c9f2509a378986175d98 \ + --hash=sha256:0a13624a4969159fe35d8c2a3d377b2b61bbd8585e327440d5e52725affcce38 \ + --hash=sha256:0b31746da07cba0e330c6433a94a4699ad77d3aeb9638d1a320a7686b69f6249 \ + --hash=sha256:4600dbec738ed74e4c9bd35503e84701200ea7db344cfdeda80677b3ee53eb64 \ + --hash=sha256:6ae370f92f3517f0e6f209ba7cc649c957b444868439197e046be07154667551 \ + --hash=sha256:9a696f23f7c1ffb31fae308502e01a3965c3891d5c400f01d0d1096dbe77519e \ + --hash=sha256:a6db3806b3b76ca78064255eac6fa101a8a64fe6f698d80fbaf81fdfa21217d4 \ + --hash=sha256:a88d939d3fe4b8c7314645ebcd6e86c8c8a512ea7820d6550355973e803bc0f1 \ + --hash=sha256:b962000e11dd34fb210a5a2c57a8a62b2d92b381c8cb3b05c075a83e38f8d645 \ + --hash=sha256:dce29a04966e31abf9b83b697c6d672486526dc5d03fcd6970cb56d5dc1fbeea \ + --hash=sha256:fb1e129b81ac8fcf9ec649b081c6c8da1c7ea6f87cab336d46386abc2cd855c1 + # via angr +mulpyplexer==0.9 \ + --hash=sha256:144e9e9bf66d3988f60542c9d3d4c94857438f7908f60e53f4c1cb1622fbbd30 + # via angr +networkx==3.6.1 \ + --hash=sha256:26b7c357accc0c8cde558ad486283728b65b6a95d85ee1cd66bafab4c8168509 \ + --hash=sha256:d47fbf302e7d9cbbb9e2555a0d267983d2aa476bac30e90dfbe5669bd57f3762 + # via + # angr + # pyformlang +numpy==2.4.6 \ + --hash=sha256:0280e0356c0829a18d9de1cb7eee50ec22ca639878d7240307ca0943d73cd2c4 \ + --hash=sha256:0ab0a9c4ffb1a6d95ef519fe4247dba8eb6b18ad93999f76b7f657039acabd47 \ + --hash=sha256:110f8b71aacb688ec69062bb7f6938a0f8acb01b7c1c4beb453c65b6d234584d \ + --hash=sha256:1e254a00cdf42b1e4d5b3d68d33af63268d41340d8885df2ab6470f2e1500147 \ + --hash=sha256:2803abfebfc990042cd494d8ce2d5f82e9d847af6d35ec486923aa19dbad5e73 \ + --hash=sha256:4cfe66903cc32a9921a6733d96b19bb6abf310397581bbad89c228f5abaf0ee8 \ + --hash=sha256:55cced7c52e981362f708ad635198e97a752dfba412cc03c23bbf3bd8d5cd662 \ + --hash=sha256:5dbbdb29840ca3d91ee0fece42fc29278886d908280bfec0a5846c6f901a3eb0 \ + --hash=sha256:68a5124b13fa6cc2086764a20005d30bc0548146f7f5322f02fce212ca14317f \ + --hash=sha256:8155154c7c691289fe18f510b5d4657c68c67989f293f0535a91360392ff6538 \ + --hash=sha256:89cd468399cfd2504718f0ba50e410dca55a170b61a02ad92bb18c8a65186e93 \ + --hash=sha256:8ad03c0965fb3c692200e74d458ca28c1dbb4ce96f9a479a8aa041ad5fabca02 \ + --hash=sha256:948424b06129ce883307e8cff868c31396d8dc7630a59c61d70d98dbe70f222c \ + --hash=sha256:c2d37ab77531417474168eb79d6d80b14f821a966818505d03013d0833edb7a8 \ + --hash=sha256:d6da64deb6b8ed903e7560180a92f2d804ee1ba5eeb849ac2748b8c1aba1f6d7 \ + --hash=sha256:ddea102b48f9e339f3948bf22040944184627a30fdf7f858667673b9c5f033c8 \ + --hash=sha256:ed9749eef4cbd126da3dc1d6bcb3a57f5eb7ac6a6484146bdbf743f552dfc577 \ + --hash=sha256:f3a3570c4a2a16746ac2c31a7c7c7b0c186b95ce902e33db6f28094ed7387dda \ + --hash=sha256:f407cb6b8e9d6d8c626bc73c945db1706035af8fd632295547bf1c9e46d092d6 + # via + # gradio + # pandas + # pyformlang +opentelemetry-api==1.45.0 \ + --hash=sha256:711ede81773c8025c2c03dac0450bc89f3d30aea6eabcc815c570d4e35a963f7 \ + --hash=sha256:80e068aba7cd56c8b58512d6a36f8d25cb1dfaa0c0a4cc1c938ccf9f362d9cb3 + # via fastapi +orjson==3.12.0 \ + --hash=sha256:31ed278a36304390adc3eec5d7f6fd593a7c3e99e5a06cd07866396c4b1b4710 \ + --hash=sha256:61318b6de893c7a9d9f3e5ecbadccbfc26a7eb417ccc7bbf0771de3b4d72f868 \ + --hash=sha256:8e29957429c35bbb5a185a119c523aa2428b7bbf1a293724c7b9375ed8f892a3 \ + --hash=sha256:9caf3d09f47c3c70c4451ada20ef9bc4a4cdffa26f49862cf0a253b329aae2d5 \ + --hash=sha256:a696529ec96a90d9a5f9570207efe403c8b08f8e4aa2783ee3403511e2fdfa10 \ + --hash=sha256:a791f793b287bbc135b8e87c34e35c8bfc693e2a8a620fab1ae682b925f9a32e \ + --hash=sha256:a94f0f0c6fcbb2b5bd9734c57a489c7584a732bbdf04a39e8c83b861e9d03e92 \ + --hash=sha256:b9dca132b1fda5565088e65a6b6e742285e0aeceb6fae549fa8863e16c7d3998 \ + --hash=sha256:d14203fb1aae2ad9b3d52f8a0e82aeb10197ef1c9bc61da7f358bd70b00123d5 \ + --hash=sha256:dce0166feb0a737ab84f598c9a338cbc0b764a036617aa686194f53c7eba0c3e \ + --hash=sha256:e4ac5059baab4b3acbd99485de019ff8cda0fdf34b61fa74f7197a53db78bfe8 \ + --hash=sha256:fb2539159dfe8d371914f354360fa50e4a577cc89222a3828b9650a5e5040252 + # via gradio +packaging==26.3 \ + --hash=sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79 \ + --hash=sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c + # via + # gradio + # gradio-client + # huggingface-hub + # wheel +pandas==3.0.6 \ + --hash=sha256:085e3786ae6b2e82b406266bce36690f72b9dc1421903ba9296b2981a9fcf586 \ + --hash=sha256:1e7c0afdcaf6661d795fcefc2f647ddd1136f62cdc153fba177c685d97a87808 \ + --hash=sha256:2e5fa32ff162dfdbc280157d664f44d23049ae414725af9676df339c501d82cd \ + --hash=sha256:47121f9571503f724c9b93e297ab6254ac99c77adf5e9ed085ea419fd585c258 \ + --hash=sha256:5e75072773c1b2f7cb63faa3a6f562aede11f3976f68ed34cb538bc091a28171 \ + --hash=sha256:66b07ef7315a31bfe1089cd3d71a7de781c9dca986762d0b4fe7c0ef17465d10 \ + --hash=sha256:994a79608263fe1c14cc48ffa7300e2b834b7d1cb406ffe96a08828cb0cdd79b \ + --hash=sha256:a3a22e07fe75347eaacc75b0e85297947af4fba6b4aae23916bd8b6828d0bba3 \ + --hash=sha256:d7564d86a94c2eb8ab290b07f63ddaae5c032fa53897c29a2ff2197d43aee8af + # via gradio +pefile==2024.8.26 \ + --hash=sha256:3ff6c5d8b43e8c37bb6e6dd5085658d658a7a0bdcd20b6a07b1fcfc1c4e9d632 \ + --hash=sha256:76f8b485dcd3b1bb8166f1128d395fa3d87af26360c2358fb75b80019b957c6f + # via cle +pillow==12.3.0 \ + --hash=sha256:00808c5e14ef63ac5161091d242999076604ff74b883423a11e5d7bbb38bf756 \ + --hash=sha256:04f01d28a6aaff387bf842a13be313df23ba0597a44f1a976c9feb3c6ff4711a \ + --hash=sha256:10e41f0fbf1eec8cfd234b8fe17a4caac7c9d0db4c204d3c173a8f9f6ef3232b \ + --hash=sha256:236ff70b9312fb68943c703aa842ca6a758abfa45ac187a5e7c1452e96ef72b5 \ + --hash=sha256:23d27a3e0307ec2244cc51e7287b919aa68d097504ebe19df4e76a98a3eea5bd \ + --hash=sha256:37d6d0a00072fd2948eb22bce7e1475f34569d90c87c59f7a2ec59541b77f7a6 \ + --hash=sha256:3b8182a766685eaa002637e28b4ec8d6b18819a0c71f579bf0dbaa5830297cce \ + --hash=sha256:4f883547d4b7f0495ebe7056b0cc2aea76094e7a4abc8e933540f3271df27d9c \ + --hash=sha256:8e95e1385e4998ae9694eeaa4730ba5457ff61185b3a55e2e7bea0880aef452a \ + --hash=sha256:b343699e8308bdc51978310e1c959c584e7869cc8c40780058c87da7781a1e94 \ + --hash=sha256:b3c777e849237620b022f7f297dd67705f9f5cf1685f09f02e46f93e92725468 \ + --hash=sha256:bcb46e2f9feff8d06323983bd83ed00c201fdcab3d74973e7072a889b3979fcd \ + --hash=sha256:e7e480451b9fa137494bccd3a7d69adbe8ac65a87d97be61e11f1b1050a5bac3 \ + --hash=sha256:ebaea975e03d3141d9d3a507df75c9b3ec90fa9d2ffd07567b3a978d9d790b26 \ + --hash=sha256:fbd139c8447d25dd750ab79ee274cc5e1fe80fc56340ab10b18a195e1b6eca3e + # via gradio +protobuf==7.36.2 \ + --hash=sha256:497d0463ff3316681da6c0b9e8d06cb465d61abce00b613ab42226175644d1bb \ + --hash=sha256:89f23aa53c24553a2416fd4fd1ec06f74fa42b14b546d8883128813f775bbfd2 \ + --hash=sha256:912c1221170e16c08d1f086762f563dd61ff83c18b5fa6652952dfaded66f728 \ + --hash=sha256:a300819d441e078a5608c0d3c709796bb548136058fda017ae51d425b44fd353 \ + --hash=sha256:bdb3a345d48db958e6ce1f18e508beb0cc981d64f24088427549c866cd039f1e \ + --hash=sha256:cbc70b17ee27e28894c7fee8bb04be1abead49e936bc70eb60052531eee2079e \ + --hash=sha256:e11e1f0180583a2af89db6a2ecd9e8dc40aa6d2988ca175bfd0e6d12ea72d74e \ + --hash=sha256:f4fee11ec330d238b34a05c9b675f693c20415d1c5bd7d5320cc2f8a798eb9cf + # via angr +psutil==7.2.2 \ + --hash=sha256:0746f5f8d406af344fd547f1c8daa5f5c33dbc293bb8d6a16d80b4bb88f59372 \ + --hash=sha256:076a2d2f923fd4821644f5ba89f059523da90dc9014e85f8e45a5774ca5bc6f9 \ + --hash=sha256:1a7b04c10f32cc88ab39cbf606e117fd74721c831c98a27dc04578deb0c16979 \ + --hash=sha256:8c233660f575a5a89e6d4cb65d9f938126312bca76d8fe087b947b3a1aaac9ee \ + --hash=sha256:b0726cecd84f9474419d67252add4ac0cd9811b04d61123054b9fb6f57df6e9e \ + --hash=sha256:b58fabe35e80b264a4e3bb23e6b96f9e45a3df7fb7eed419ac0e5947c61e47cc \ + --hash=sha256:eb7e81434c8d223ec4a219b5fc1c47d0417b12be7ea866e24fb5ad6e84b3d988 \ + --hash=sha256:ed0cace939114f62738d808fdcecd4c869222507e266e574799e9c0faa17d486 \ + --hash=sha256:fd04ef36b4a6d599bbdb225dd1d3f51e00105f6d48a28f006da7f9822f2606d8 + # via angr +pycparser==2.22 \ + --hash=sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6 \ + --hash=sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc + # via + # angr + # cffi + # decompile-verify +pycryptodome==3.23.0 \ + --hash=sha256:11eeeb6917903876f134b56ba11abe95c0b0fd5e3330def218083c7d98bbcb3c \ + --hash=sha256:156df9667ad9f2ad26255926524e1c136d6664b741547deb0a86a9acf5ea631f \ + --hash=sha256:187058ab80b3281b1de11c2e6842a357a1f71b42cb1e15bce373f3d238135c27 \ + --hash=sha256:447700a657182d60338bab09fdb27518f8856aecd80ae4c6bdddb67ff5da44ef \ + --hash=sha256:507dbead45474b62b2bbe318eb1c4c8ee641077532067fec9c1aa82c31f84886 \ + --hash=sha256:53ecbafc2b55353edcebd64bf5da94a2a2cdf5090a6915bcca6eca6cc452585a \ + --hash=sha256:67bd81fcbe34f43ad9422ee8fd4843c8e7198dd88dd3d40e6de42ee65fbe1490 \ + --hash=sha256:aa0698f65e5b570426fc31b8162ed4603b0c2841cbb9088e2b01641e3065915b \ + --hash=sha256:c75b52aacc6c0c260f204cbdd834f76edc9fb0d8e0da9fbf8352ef58202564e2 \ + --hash=sha256:c8987bd3307a39bc03df5c8e0e3d8be0c4c3518b7f044b0f4c15d1aa78f52575 \ + --hash=sha256:cfb5cd445280c5b0a4e6187a7ce8de5a07b5f3f897f235caa11f1f435f182843 \ + --hash=sha256:dea827b4d55ee390dc89b2afe5927d4308a8b538ae91d9c6f7a5090f397af1aa + # via cart +pydantic==2.13.5 \ + --hash=sha256:346a034f080da3755d8e9cb5e00e8b07de1d39e4f6e2c87d8ab7cafa0b269a73 \ + --hash=sha256:51a9c5f7b2f8e636f04c6cada605d9b6a3bf1348fdf945a3d8869b19bba0ee08 + # via + # fastapi + # gradio +pydantic-core==2.46.5 \ + --hash=sha256:0bddb4020d8f04175865ccd17eff3040874fc11fb593f424edb452653b4b947c \ + --hash=sha256:10416c15b8839ecc4ef4d0885da76da6fd0f67333a0eb8aff6d93c4b8f2910fc \ + --hash=sha256:1e449def1945a462c464331254e5a44fca7c3b4f9aedf59ec2f50f8066dd8e25 \ + --hash=sha256:2471fd51c61c610e1dcf7de44d7299283661654d11264ab4802b303368d69c47 \ + --hash=sha256:28a6a556cd3b6066bea827857f9d9cce027c96f776e512f544a581f9e42161f8 \ + --hash=sha256:2d330aaba8621b1edcec8ae2c4050f63b84ccf6d98723a8f212e9684713abf0e \ + --hash=sha256:337639ba62a11acde6ef3aeb08c8ea755f8ef1fe5e513356c0f36a2b0d7568b0 \ + --hash=sha256:40375c2d05acec10323e45dfe2077ac44bc74659008614af5069034e2cfc781c \ + --hash=sha256:413a717a410d0c817ef5b786a059415550b3794e1d0c2abffd9efb93a3d9f7b4 \ + --hash=sha256:49776eab08766a08dfff7012f8b422dcd7e25e43b316eedf0477c24fcfa84b7c \ + --hash=sha256:4f8507560a9284e1370bb048ed4282012fbef4e8d109875b95e884d228552061 \ + --hash=sha256:53feb344243bb9510a9dec7bf3cf1b64d88a98af5dc7872a5160465f8b198c8e \ + --hash=sha256:5f93c5fe914d75fbec9a49209b00da5f08e9e467d69da2b1510c81940cfd10be \ + --hash=sha256:701b2e04b560eeb4bddf7a25ab8ca476176e34fdbd9a0e18196f0d12d4685f0b \ + --hash=sha256:892a881d5f68c2b9ea304b7a6c2c60d9343df578a311b0f86b94bc8f1ffe8129 \ + --hash=sha256:8feeac04b5794e513e710af2f9c87d49f31a6dc47967bb264a1fed61a8989bec \ + --hash=sha256:9432f3598db432cb51c5b37fdbf29a60fcccc79e30d37a05022776a6bc4ab689 \ + --hash=sha256:a1dee1b804ff4d11c663636cf15d2ea47e9f79cd56c033fb1cbf08924842a48f \ + --hash=sha256:a2468d93d181667a7abd66e1b64bb9f76f361b0fef8faddf687456453576f5ee \ + --hash=sha256:a445486499897b88a7d6c310c88ed64dd37b1b59bfd7ae9107490bbb362f47d6 \ + --hash=sha256:ab4b66edffb32d9e951efb3814bd104b8367a7501b81b955cacb5726d897389f \ + --hash=sha256:aca6c767f552b21b10f774aeac128e828eafb796adfa1b666a18bf6321453c3a \ + --hash=sha256:b10ec717381bdbfafef34607824db4c91de69ff085e4fca3b2af91b4fa17e68a \ + --hash=sha256:b6acfb46a814762367fb7ba0828b0a17d441b92ce249a0e007474c9072662dda \ + --hash=sha256:c14ad3bdc85ee7f318742c457ca3968a92126d144b15721c759033bfb06296c2 \ + --hash=sha256:cd5214352ae68f3b5e9af7768bdc5253695ee069675db3480518420b3be881f2 \ + --hash=sha256:d0a24b40877af2de4950252be9d21eaf7fb07660f3c2cae1f56c6b599ada5266 \ + --hash=sha256:d625a186a65201c23a9e3b8ed9c47e90a026e03256608cc91851c6709096844f + # via pydantic +pydemumble==0.1.1 \ + --hash=sha256:025856cd4d0b47cfc89a525000748c278bcc00b13b3e4aa5b0f41dd77b0f25d2 \ + --hash=sha256:369d75ec81efc97f516ef34bd21d0e2c39ab6892eaa0df7b9017d5babaf929ef \ + --hash=sha256:6e22287828cee2ac2beb2c736deadacbefbd2987549e56a8ecf285a5cf756679 \ + --hash=sha256:6f26290ff94b75eb6a463f4fd2d8547b4a0c4850f959488129a148c5613c2a5c \ + --hash=sha256:a4adc86859ce7ccf10fd606a83a42cfad3d3d99bef9d98b6466d212670fecd0c \ + --hash=sha256:c29d076711fe6909ba24c2fe7e1b09008e57e01fc6a6ea12f393751b3511a940 \ + --hash=sha256:e01c240309509f472d8d2ed4cbdc399d2843fe4c49892fd915c9ddcaa6b4d757 \ + --hash=sha256:e2e23ce67f2c6083fc2fcd584786d8257f7e59852c0d7b89874c5ff6bab25912 + # via angr +pydot==4.0.1 \ + --hash=sha256:869c0efadd2708c0be1f916eb669f3d664ca684bc57ffb7ecc08e70d5e93fee6 \ + --hash=sha256:c2148f681c4a33e08bf0e26a9e5f8e4099a82e0e2a068098f32ce86577364ad5 + # via pyformlang +pydub==0.25.1 \ + --hash=sha256:65617e33033874b59d87db603aa1ed450633288aefead953b30bded59cb599a6 \ + --hash=sha256:980a33ce9949cab2a569606b65674d748ecbca4f0796887fd6f46173a7b0d30f + # via gradio +pyelftools==0.33 \ + --hash=sha256:660d82dcbeb8e83d1702bd97f223f761625da06111c0cc988eac6b8ab0c1b61f \ + --hash=sha256:f215ad5f47d3f1373a21496a6c9e0707c622840d0622f23ff7ce08678b020036 + # via cle +pyformlang==1.0.11 \ + --hash=sha256:a8d76481e4d76e4df1c00cd5c5fce61969635900ef521ad182a07a61ca1c070e \ + --hash=sha256:e292ec8b9cfa64c26b592faf9b7cfc72c4f4b0eb0d533f045a46061e75c5ce99 + # via angr +pygments==2.21.0 \ + --hash=sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9 \ + --hash=sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c + # via rich +pyparsing==3.3.3 \ + --hash=sha256:928ae7e20211f3b6f3915a72f06a0cfd29ab9d24279dd6346b6b1a7146397d36 \ + --hash=sha256:ece8c00a69cf01b45d0b1dedabb469c90d8caf996d4fda40f147627a122849a4 + # via pydot +pypcode==3.3.3 \ + --hash=sha256:378b8d3b1552c3251243b421114dd67ccb49660fe762c60fb19dede1279cf30c \ + --hash=sha256:4b8227ae155151b027f50a71d4fdc9c137c99692d22eb34d6fbe480f21939f75 \ + --hash=sha256:7fc2de4d2180acde8112bfab836887ab41b9a7da4bae425b79c382fc18a164b9 \ + --hash=sha256:8df381c579d78c92d3ca6ddbb80def3b81befc7919cb0ca0c75e0dce2de09d5c \ + --hash=sha256:a091874a36f2f54489011fde7c6245d92bb58431c0ae0282b3c9b552e559fb5b \ + --hash=sha256:d9c41f9f0f9a7c7d5d67cf90be775226324e5c442e182c215f82639ba2c12e25 + # via angr +python-dateutil==2.9.0.post0 \ + --hash=sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3 \ + --hash=sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427 + # via pandas +python-multipart==0.0.32 \ + --hash=sha256:be54b7f3fa167bb83e4fcd936b887b708f4e57fe75911c02aebf53efaf8d938e \ + --hash=sha256:ff6d3f776f16878c894e52e107296ffc890e913c611b1a4ec6c44e2821fe2e23 + # via gradio +pytz==2026.4 \ + --hash=sha256:464303645bafafd72418898368b2429458f709cf1eb6a15372fbcc396b64da63 \ + --hash=sha256:9d514388fbc89ca0833203464272ac485b8828568ab73532f5020f17e892a0ff + # via gradio +pyvex==9.2.175 \ + --hash=sha256:1218fab800f549d00e026bfaaffec1e5d2ec5fc74bc7b70d51c816ac2cb4f9cd \ + --hash=sha256:12f2bd2951e9a77e728050017d3d3e385ede8b6ea19cb3f0c9ce7f29c42cbb7c \ + --hash=sha256:1e748b2c83fc478f498216f77da43730be87f05946d02697345be08ef5feb830 \ + --hash=sha256:444bb754811ec7eecbb35a81dc00611cff343cc63c7c7cbfbb31d7fd3d7de0e9 \ + --hash=sha256:89fc4d1ab2a302f7c1c4a387664be6de8c872bc3b2e43ee82cae2ca8c2e2f1aa \ + --hash=sha256:bb5cbbf4735b70384cbcb2010d395639c80584156dc196cdb71d94b5e0d540e3 + # via + # angr + # cle +pyyaml==6.0.3 \ + --hash=sha256:10892704fc220243f5305762e276552a0395f7beb4dbf9b14ec8fd43b57f126c \ + --hash=sha256:1d37d57ad971609cf3c53ba6a7e365e40660e3be0e5175fa9f2365a379d6095a \ + --hash=sha256:37503bfbfc9d2c40b344d06b2199cf0e96e97957ab1c1b546fd4f87e53e5d3e4 \ + --hash=sha256:44edc647873928551a01e7a563d7452ccdebee747728c1080d881d68af7b997e \ + --hash=sha256:652cb6edd41e718550aad172851962662ff2681490a8a711af6a4d288dd96824 \ + --hash=sha256:8098f252adfa6c80ab48096053f512f2321f0b998f98150cea9bd23d83e1467b \ + --hash=sha256:850774a7879607d3a6f50d36d04f00ee69e7fc816450e5f7e58d7f17f1ae5c00 \ + --hash=sha256:9f3bfb4965eb874431221a3ff3fdcddc7e74e3b07799e0e84ca4a0f867d449bf \ + --hash=sha256:b8bb0864c5a28024fac8a632c443c87c5aa6f215c0b126c449ae1a150412f31d \ + --hash=sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f + # via + # decompile-verify + # gradio + # huggingface-hub +rich==15.0.0 \ + --hash=sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb \ + --hash=sha256:edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36 + # via + # angr + # typer +safehttpx==0.1.7 \ + --hash=sha256:c4f4a162db6993464d7ca3d7cc4af0ffc6515a606dfd220b9f82c6945d869cde \ + --hash=sha256:db201c0978c41eddb8bb480f3eee59dd67304fdd91646035e9d9a720049a9d23 + # via gradio +semantic-version==2.10.0 \ + --hash=sha256:bdabb6d336998cbb378d4b9db3a4b56a1e3235701dc05ea2690d9a997ed5041c \ + --hash=sha256:de78a3b8e0feda74cabc54aab2da702113e33ac9d9eb9d2389bcf1f58b7d9177 + # via gradio +setuptools==84.0.0 \ + --hash=sha256:51a52592b3b99e102b609654876bd65f19f999935166d1352678931132b0c670 \ + --hash=sha256:f4695c21257f0d9b537ec2692c941d02ee143b7cc1276941349a546573b2ef73 +shellingham==1.5.4 \ + --hash=sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686 \ + --hash=sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de + # via typer +six==1.17.0 \ + --hash=sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274 \ + --hash=sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81 + # via python-dateutil +smmap==5.0.3 \ + --hash=sha256:4d9debb8b99007ae47165abc08670bd74cb74b5227dda7f643eccc4e9eb5642c \ + --hash=sha256:c106e05d5a61449cf6ba9a1e650227ecfb141590d2a98412103ff35d89fc7b2f + # via gitdb +sortedcontainers==2.4.0 \ + --hash=sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88 \ + --hash=sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0 + # via + # angr + # cle +starlette==0.52.1 \ + --hash=sha256:0029d43eb3d273bc4f83a08720b4912ea4b071087a3b48db01b7c839f7954d74 \ + --hash=sha256:834edd1b0a23167694292e94f597773bc3f89f362be6effee198165a35d62933 + # via + # fastapi + # gradio +sympy==1.14.0 \ + --hash=sha256:d3d3fe8df1e5a0b42f0e7bdf50541697dbe7d23746e894990c030e2b05e72517 \ + --hash=sha256:e091cc3e99d2141a0ba2847328f5479b05d94a6635cb96148ccb3f34671bd8f5 + # via angr +tibs==0.5.7 \ + --hash=sha256:0a7ce857ef05c59dc61abadc31c4b9b1e3c62f9e5fb29217988c308936aea71e \ + --hash=sha256:130bc68ff500fc8185677df7a97350b5d5339e6ba7e325bc3031337f6424ede7 \ + --hash=sha256:173dfbecb2309edd9771f453580c88cf251e775613461566b23dbd756b3d54cb \ + --hash=sha256:1b56583db148e5094d781c3d746815dbcbb6378c6f813c8ce291efd4ab21da8b \ + --hash=sha256:1d5521cc6768bfa6282a0c591ba06b079ab91b5c7d5696925ad2abac59779a54 \ + --hash=sha256:477608f9b87e24a22ab6d50b81da04a5cb59bfa49598ff7ec5165035a18fb392 \ + --hash=sha256:76746f01b3db9dbd802f5e615f11f68df7a29ecef521b082dca53f3fa7d0084f \ + --hash=sha256:847709c108800ad6a45efaf9a040628278956938a4897f7427a2587013dc3b98 \ + --hash=sha256:859f05315ffb307d3474c505d694f3a547f00730a024c982f5f60316a5505b3c \ + --hash=sha256:a61d36155f8ab8642e1b6744e13822f72050fc7ec4f86ec6965295afa04949e2 \ + --hash=sha256:a883ca13a922a66b2c1326a9c188123a574741a72510a4bf52fd6f97db191e44 \ + --hash=sha256:ac0aa2aae38f7325c91c261ce1d18f769c4c7033c98d6ea3ea5534585cf16452 \ + --hash=sha256:ad61df93b50f875b277ab736c5d37b6bce56f9abce489a22f4e02d9daa2966e3 \ + --hash=sha256:d4f3ff613d486650816bc5516760c0382a2cc0ca8aeddd8914d011bc3b81d9a2 \ + --hash=sha256:e13b9c7ff2604b0146772025e1ac6f85c8c625bf6ac73736ff671eaf357dda41 \ + --hash=sha256:f70bd250769381c73110d6f24feaf8b6fcd44f680b3cb28a20ea06db3d04fb6f + # via bitstring +tomlkit==0.13.3 \ + --hash=sha256:430cf247ee57df2b94ee3fbe588e71d362a941ebb545dec29b53961d61add2a1 \ + --hash=sha256:c89c649d79ee40629a9fda55f8ace8c6a1b42deb912b2a8fd8d942ddadb606b0 + # via gradio +tqdm==4.70.1 \ + --hash=sha256:c293e525e6fef9c20e8728fd4612df02a0aa31bb5fe91ecd93e123b1b7bffa73 \ + --hash=sha256:cefd0eca11b2a37a3aee776544d4f4ae913f02688135b5556b8788dfa474afc4 + # via huggingface-hub +typer==0.27.2 \ + --hash=sha256:269b7eb9d3c202ca84b4bc9618cb04ebb43d3d4d1e567e4c768607232c05f945 \ + --hash=sha256:b3a5fc4342d5fc8fda8fc3010b1cf117e9249aab7fae800c2eff62fd3842d97d + # via gradio +typing-extensions==4.16.0 \ + --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8 \ + --hash=sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5 + # via + # angr + # anyio + # claripy + # fastapi + # gradio + # gradio-client + # huggingface-hub + # opentelemetry-api + # pydantic + # pydantic-core + # starlette + # typing-inspection +typing-inspection==0.4.4 \ + --hash=sha256:547274fa6b0a561ccf549cc9524b999a578e737d015d8709d021f9d0d13bea47 \ + --hash=sha256:65b8397ba37ccbce054456aaccddfc91e6e3083c92824df348d96ca832f3f147 + # via + # fastapi + # pydantic +tzdata==2026.4 ; sys_platform == 'emscripten' or sys_platform == 'win32' \ + --hash=sha256:c2169a8b0a7a5e9674da5a135ccdfb2b3e671b333ed9fed17b41f73c34476e81 \ + --hash=sha256:f1b8bd365d8d210c55353f4d7f8d6d8561c0ba50d704b700d195a9424bba0d79 + # via pandas +unique-log-filter==0.1.0 \ + --hash=sha256:411ca5b30572293fc37cd93a651da2a56d4b3a4fdafe9fdfaac14eee54d6a8db \ + --hash=sha256:e0e7012b4d5911233e02d5ae849fd716c1b8af14dfed0e456af1d6dcdd6a1195 + # via angr +uvicorn==0.54.0 \ + --hash=sha256:505bdb0f318731d45f1f712071fc781a8981f6847a31c902c9f5e652d4f67faf \ + --hash=sha256:a2e33cbfaa0306f8e6b0c13e0cb89d7d7a2da3e62b90c66e18c33d9807b28620 + # via gradio +wheel==0.48.0 \ + --hash=sha256:3217dcc807155e45db462d7ef2431f5ddda0d7273b700d05a67b271ceb1287ab \ + --hash=sha256:94800765601e9171bf5d58d066e640662842bcedcbab982b2c90787a2c987322 +z3-solver==4.13.0.0 \ + --hash=sha256:13468e1018c817b7f794898d3100f02541d15c13ab56c0785c5acdea32a066cf \ + --hash=sha256:3555436cfe9a5fa2d1b432fb9a5e4460e487649c22e5e68a56f7d81594d043e9 \ + --hash=sha256:4a4731fded91b32e1861e1c7c96e500da743bb9431246cac51f7c3ffc0f21b5d \ + --hash=sha256:52588e92aec7cb338fd6288ce93758ae01770f62ca0c80e8f4f2b2333feaf51b \ + --hash=sha256:8c42de82b6e3ff7ee61287d03c7af8a99f9f6554cdd1204c6b9bca96ff1cb7fb \ + --hash=sha256:9d622022a3511c059915c56b2c231c84b5c1be1b82f457d7560dda3d916474fe \ + --hash=sha256:bca7d59a699a440247537c2180c519d682c9df3520a16ce288fced61a70d253d + # via claripy diff --git a/scripts/audit_image.py b/scripts/audit_image.py new file mode 100644 index 0000000000000000000000000000000000000000..2e7999bd9d93409c15aed58bc93f9dbec9e8b874 --- /dev/null +++ b/scripts/audit_image.py @@ -0,0 +1,57 @@ +"""Check every published image layer for private core source or Git metadata.""" + +import argparse +from pathlib import PurePosixPath +import subprocess +import tarfile + + +def is_private_path(name, *, empty_file=False): + parts = PurePosixPath(name).parts + if "verifier" in parts: + return True + if name.lstrip("./").startswith("home/user/app/core/"): + return True + if ".git" in parts: + # uv creates an empty sdists-v9/.git sentinel to stop build tools from + # discovering an enclosing repository. It is not repository metadata. + sentinel = (".cache", "uv", "sdists-v9", ".git") + if tuple(parts[-4:]) == sentinel and empty_file: + return False + return True + return False + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("image") + args = parser.parse_args() + process = subprocess.Popen(["docker", "image", "save", args.image], stdout=subprocess.PIPE) + failures, layers = [], 0 + with tarfile.open(fileobj=process.stdout, mode="r|") as archive: + for member in archive: + if not member.isfile(): + continue + # Docker's OCI archive stores filesystem layers as tar blobs. + if member.name.endswith(".tar") or member.name.startswith("blobs/sha256/"): + blob = archive.extractfile(member) + try: + with tarfile.open(fileobj=blob, mode="r|*") as layer: + layers += 1 + for item in layer: + if is_private_path(item.name, empty_file=item.isfile() and item.size == 0): + failures.append(item.name) + except tarfile.ReadError: + # OCI manifests/config blobs are JSON, not filesystem layers. + pass + if process.wait() != 0: + raise SystemExit("docker image save failed") + if not layers: + raise SystemExit("no image filesystem layers were inspected") + if failures: + raise SystemExit("private paths found in image layers: " + ", ".join(failures)) + print(f"Inspected {layers} image layers: no private verifier source or Git metadata.") + + +if __name__ == "__main__": + main() diff --git a/scripts/pin_core.py b/scripts/pin_core.py new file mode 100644 index 0000000000000000000000000000000000000000..dfe86edfaf5a3ac357b61f47a6b2d3cc012fd14e --- /dev/null +++ b/scripts/pin_core.py @@ -0,0 +1,31 @@ +"""Record the submodule revision and export public-only runtime dependencies.""" + +import json +import re +from pathlib import Path +import subprocess +import tomllib + +ROOT = Path(__file__).resolve().parents[1] + + +def main(): + commit = subprocess.check_output(["git", "-C", str(ROOT / "core"), "rev-parse", "HEAD"], text=True).strip() + if subprocess.check_output(["git", "-C", str(ROOT / "core"), "status", "--porcelain"], text=True).strip(): + raise SystemExit("Commit core changes before pinning the submodule.") + subprocess.run(["git", "add", "core"], cwd=ROOT, check=True) + module = tomllib.loads((ROOT / "core/pyproject.toml").read_text()) + data = {"repository": "https://github.com/edmcman/decompile-verify.git", "commit": commit, + "version": module["project"]["version"]} + project = ROOT / "pyproject.toml" + project.write_text(re.sub(r'"decompile-verify==[^" ]+"', + f'"decompile-verify=={data["version"]}"', project.read_text())) + (ROOT / "core-revision.json").write_text(json.dumps(data, indent=2) + "\n") + subprocess.run(["uv", "lock"], cwd=ROOT, check=True) + subprocess.run(["uv", "export", "--locked", "--no-dev", "--group", "bootstrap", + "--no-emit-project", "--no-emit-package", "decompile-verify", + "--output-file", "requirements-runtime.txt"], cwd=ROOT, check=True, stdout=subprocess.DEVNULL) + + +if __name__ == "__main__": + main() diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/support.py b/tests/support.py new file mode 100644 index 0000000000000000000000000000000000000000..fa0f61a313e4d6b94f75faf6b02fb06e82036a3a --- /dev/null +++ b/tests/support.py @@ -0,0 +1,11 @@ +"""Public UI assertions; private arithmetic and engine oracles stay in the core repo.""" +import json +from demo.examples import example_metadata + + +def check_report(name, data, seed_count): + report = json.loads(data) + assert report["completed"] == seed_count + assert [item["seed"] for item in report["results"]] == list(range(seed_count)) + assert sum(report["counts"].values()) == seed_count + assert report["verdict"] == example_metadata(name)["expected_verdict"] diff --git a/tests/test_bootstrap.py b/tests/test_bootstrap.py new file mode 100644 index 0000000000000000000000000000000000000000..87673b3381892b0de3400e193670d2292ec89dcf --- /dev/null +++ b/tests/test_bootstrap.py @@ -0,0 +1,80 @@ +import json +import os +from pathlib import Path +import subprocess + +import pytest + +import bootstrap + + +def pinned(tmp_path, monkeypatch): + data = {"repository": bootstrap.REPOSITORY, "commit": "a" * 40, "version": "0.0.0"} + (tmp_path / "core-revision.json").write_text(json.dumps(data)) + monkeypatch.setattr(bootstrap, "ROOT", tmp_path) + return data + + +def test_missing_token_stops_before_fetch(tmp_path, monkeypatch): + pinned(tmp_path, monkeypatch) + monkeypatch.delenv("CORE_GITHUB_TOKEN", raising=False) + with pytest.raises(RuntimeError, match="CORE_GITHUB_TOKEN"): + bootstrap.install_core() + + +def test_invalid_repository_is_rejected_before_credentials(tmp_path, monkeypatch): + data = pinned(tmp_path, monkeypatch) + data["repository"] = "https://example.com/private.git" + (tmp_path / "core-revision.json").write_text(json.dumps(data)) + with pytest.raises(ValueError, match="invalid pinned"): + bootstrap.revision() + + +@pytest.mark.parametrize("matches", [True, False]) +def test_pin_and_credential_lifetime(tmp_path, monkeypatch, matches): + data = pinned(tmp_path, monkeypatch) + monkeypatch.setenv("CORE_GITHUB_TOKEN", "test-secret") + calls = [] + + def run(args, *, env=None, **kwargs): + calls.append((args, dict(env))) + assert "test-secret" not in " ".join(args) + if args[:2] == ["git", "fetch"]: + assert args[-1] == data["commit"] + assert env["CORE_GITHUB_TOKEN"] == "test-secret" + assert Path(env["GIT_ASKPASS"]).exists() + else: + assert "CORE_GITHUB_TOKEN" not in env + if args[:2] == ["git", "rev-parse"]: + return data["commit"] if matches else "b" * 40 + return "" + + monkeypatch.setattr(bootstrap, "command", run) + monkeypatch.setattr("importlib.metadata.version", lambda _: data["version"]) + if matches: + bootstrap.install_core() + assert calls[-1][0][:3] == ["uv", "pip", "install"] + else: + with pytest.raises(RuntimeError, match="differs"): + bootstrap.install_core() + assert not any(args[0] == "uv" for args, _ in calls) + assert "CORE_GITHUB_TOKEN" not in os.environ + assert not Path(calls[2][1]["GIT_ASKPASS"]).exists() + + +def test_git_errors_never_expose_credentials(monkeypatch): + def fail(*args, **kwargs): + raise subprocess.CalledProcessError(1, args[0], stderr="test-secret") + + monkeypatch.setattr(subprocess, "run", fail) + with pytest.raises(RuntimeError) as error: + bootstrap.command(["git", "fetch"]) + assert "test-secret" not in str(error.value) + + +def test_recorded_revision_matches_gitlink(): + root = Path(__file__).resolve().parents[1] + stage = subprocess.check_output(["git", "ls-files", "--stage", "core"], cwd=root, text=True) + mode, commit, rest = stage.split(maxsplit=2) + assert mode == "160000" + assert commit == bootstrap.revision()["commit"] diff --git a/tests/test_examples.py b/tests/test_examples.py new file mode 100644 index 0000000000000000000000000000000000000000..5df338c1318ae9557929fef50d02d7369a0c017d --- /dev/null +++ b/tests/test_examples.py @@ -0,0 +1,13 @@ +from hashlib import sha256 +from pathlib import Path + +from demo import examples + + +def test_all_public_assets_have_valid_checksums(tmp_path): + rows = examples.prepare_examples(tmp_path) + assert len(rows) == len(examples.EXAMPLE_NAMES) == 45 + assert len(examples.GHIDRA_EXAMPLE_NAMES) == 21 + for name, row in zip(examples.EXAMPLE_NAMES, rows): + assert sha256(Path(row[0]).read_bytes()).hexdigest() == examples.example_metadata(name)["binary_sha256"] + assert not row[0].startswith(str(examples.ROOT / "core")) diff --git a/tests/test_presentation.py b/tests/test_presentation.py new file mode 100644 index 0000000000000000000000000000000000000000..216a7ac32da2118826c9747ee8308a8eeed7441e --- /dev/null +++ b/tests/test_presentation.py @@ -0,0 +1,7 @@ +def test_literal_diagnostics_escape_html(): + from demo.presentation import literal_details + html = literal_details({"literal_bindings": [{"literal": '"