Spaces:
Running
Running
Edward J. Schwartz commited on
Commit ·
b727f11
0
Parent(s):
Create public Gradio frontend with private core submodule
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .dockerignore +11 -0
- .gitignore +6 -0
- .gitmodules +3 -0
- .python-version +1 -0
- Dockerfile +25 -0
- README.md +102 -0
- bootstrap.py +88 -0
- core +1 -0
- core-revision.json +5 -0
- demo/__init__.py +1 -0
- demo/app.py +277 -0
- demo/examples.py +47 -0
- demo/presentation.py +118 -0
- demo/session.py +104 -0
- demo/workbench.css +62 -0
- demo/workbench.js +32 -0
- examples/COPYING +674 -0
- examples/binaries/byte-swap.elf +0 -0
- examples/binaries/factor +0 -0
- examples/binaries/float-identity.elf +0 -0
- examples/binaries/format-string.elf +0 -0
- examples/binaries/ghidra-byte-swap.elf +0 -0
- examples/binaries/ghidra-float-identity.elf +0 -0
- examples/binaries/ghidra-format-string.elf +0 -0
- examples/binaries/ghidra-hello-goodbye.elf +0 -0
- examples/binaries/ghidra-hello-world.elf +0 -0
- examples/binaries/ghidra-identical.elf +0 -0
- examples/binaries/ghidra-malloc.elf +0 -0
- examples/binaries/ghidra-nan-payload.elf +0 -0
- examples/binaries/ghidra-pointer-identity.elf +0 -0
- examples/binaries/ghidra-population-count.elf +0 -0
- examples/binaries/ghidra-sign-extension.elf +0 -0
- examples/binaries/ghidra-signed-zero.elf +0 -0
- examples/binaries/ghidra-struct-fields.elf +0 -0
- examples/binaries/ghidra-struct-indirect.elf +0 -0
- examples/binaries/ghidra-struct-padding.elf +0 -0
- examples/binaries/ghidra-tail-call.elf +0 -0
- examples/binaries/ghidra-transient-global.elf +0 -0
- examples/binaries/ghidra-unsigned-maximum.elf +0 -0
- examples/binaries/ghidra-void-memory.elf +0 -0
- examples/binaries/ghidra-wide-integer.elf +0 -0
- examples/binaries/hello-goodbye.elf +0 -0
- examples/binaries/hello-world.elf +0 -0
- examples/binaries/identical.elf +0 -0
- examples/binaries/malloc.elf +0 -0
- examples/binaries/nan-payload.elf +0 -0
- examples/binaries/pointer-identity.elf +0 -0
- examples/binaries/population-count.elf +0 -0
- examples/binaries/rotate-vs-shift.elf +0 -0
- examples/binaries/sign-extension.elf +0 -0
.dockerignore
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
**
|
| 2 |
+
!Dockerfile
|
| 3 |
+
!README.md
|
| 4 |
+
!requirements-runtime.txt
|
| 5 |
+
!core-revision.json
|
| 6 |
+
!demo/
|
| 7 |
+
!demo/**
|
| 8 |
+
!examples/
|
| 9 |
+
!examples/**
|
| 10 |
+
!bootstrap.py
|
| 11 |
+
**/__pycache__/
|
.gitignore
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__pycache__/
|
| 2 |
+
.pytest_cache/
|
| 3 |
+
.venv/
|
| 4 |
+
build/
|
| 5 |
+
dist/
|
| 6 |
+
*.egg-info/
|
.gitmodules
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[submodule "core"]
|
| 2 |
+
path = core
|
| 3 |
+
url = https://github.com/edmcman/decompile-verify.git
|
.python-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
3.11.13
|
Dockerfile
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ghcr.io/astral-sh/uv:0.12.19@sha256:04d046b13e60d6bcec73cbc5e1cad25d680dea90c8573340950a0ac2d1aef424 AS uv
|
| 2 |
+
FROM ubuntu:24.04@sha256:a853f94d226358a79c740cfc7bce0c289748f3fe3488d921d038ccd752c61b60
|
| 3 |
+
|
| 4 |
+
RUN apt-get update && \
|
| 5 |
+
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
|
| 6 |
+
ca-certificates git gcc g++ clang binutils make && \
|
| 7 |
+
dpkg-query -W > /opt/apt-packages.txt && rm -rf /var/lib/apt/lists/*
|
| 8 |
+
COPY --from=uv /uv /uvx /usr/local/bin/
|
| 9 |
+
ENV UV_PYTHON_INSTALL_DIR=/opt/python UV_LINK_MODE=copy
|
| 10 |
+
RUN useradd -o -m -u 1000 user && \
|
| 11 |
+
uv python install 3.11.13 && uv venv --python 3.11.13 /opt/venv && \
|
| 12 |
+
chown -R user:user /opt/venv
|
| 13 |
+
COPY requirements-runtime.txt /opt/requirements-runtime.txt
|
| 14 |
+
USER user
|
| 15 |
+
ENV HOME=/home/user UV_CACHE_DIR=/home/user/.cache/uv
|
| 16 |
+
RUN --mount=type=cache,id=decompile-verify-gradio-uv,target=/home/user/.cache/uv,uid=1000,gid=1000 \
|
| 17 |
+
uv pip sync --python /opt/venv/bin/python --require-hashes /opt/requirements-runtime.txt
|
| 18 |
+
ENV PATH="/opt/venv/bin:$PATH" PYTHONHASHSEED=0 PYTHONUNBUFFERED=1 GRADIO_ANALYTICS_ENABLED=False
|
| 19 |
+
WORKDIR /home/user/app
|
| 20 |
+
# Do not COPY the build context as a whole: it may have an initialized private submodule.
|
| 21 |
+
COPY --chown=user:user demo/ ./demo/
|
| 22 |
+
COPY --chown=user:user examples/ ./examples/
|
| 23 |
+
COPY --chown=user:user bootstrap.py core-revision.json ./
|
| 24 |
+
EXPOSE 7860
|
| 25 |
+
CMD ["python", "bootstrap.py"]
|
README.md
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Decompiler verifier
|
| 3 |
+
emoji: 🔍
|
| 4 |
+
colorFrom: indigo
|
| 5 |
+
colorTo: blue
|
| 6 |
+
sdk: docker
|
| 7 |
+
app_port: 7860
|
| 8 |
+
fullWidth: true
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# Decompiler verifier workbench
|
| 12 |
+
|
| 13 |
+
Public Gradio frontend for comparing a binary function with candidate C. Select
|
| 14 |
+
an example or upload an ELF x86-64 binary, supply its function address and candidate
|
| 15 |
+
source, and stream verification results with assembly previews and a JSON download.
|
| 16 |
+
The application includes all 45 synthetic, saved Ghidra, and real-binary examples.
|
| 17 |
+
|
| 18 |
+
The verification library is a private GitHub repository referenced by the `core/`
|
| 19 |
+
Git submodule. This repository publishes the UI and demo assets. Running verification
|
| 20 |
+
locally requires access to the private core; cloning the public frontend alone does
|
| 21 |
+
not grant that access.
|
| 22 |
+
|
| 23 |
+
## Local development
|
| 24 |
+
|
| 25 |
+
Use Linux/amd64, Python 3.11.13, GCC, Clang, and binutils. On macOS or Windows,
|
| 26 |
+
use the Docker workflow below. With authorized GitHub credentials:
|
| 27 |
+
|
| 28 |
+
```sh
|
| 29 |
+
git submodule update --init core
|
| 30 |
+
uv sync --locked
|
| 31 |
+
uv run python -m demo.app
|
| 32 |
+
uv run python -m pytest -q
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
Open <http://localhost:7860>. The library is installed as an editable dependency
|
| 36 |
+
from the submodule. UI tests operate on public assets and the installed library;
|
| 37 |
+
they do not import the private engine tests. Core regression tests run separately
|
| 38 |
+
in the core project.
|
| 39 |
+
|
| 40 |
+
## Docker and Hugging Face
|
| 41 |
+
|
| 42 |
+
```sh
|
| 43 |
+
docker build --platform linux/amd64 -t decompile-verify:gradio .
|
| 44 |
+
docker run --rm --platform linux/amd64 --publish 127.0.0.1:7860:7860 \
|
| 45 |
+
--env CORE_GITHUB_TOKEN decompile-verify:gradio
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
Set `CORE_GITHUB_TOKEN` in your local environment using your credential manager
|
| 49 |
+
before running the command; do not write its value into shell history. In the
|
| 50 |
+
Space Settings, configure the same name as a secret. Use a GitHub token scoped
|
| 51 |
+
to the private core repository with read-only Contents permission.
|
| 52 |
+
|
| 53 |
+
The public image contains third-party dependencies, UI code, and example assets.
|
| 54 |
+
It excludes the private submodule even when initialized locally. At startup,
|
| 55 |
+
`bootstrap.py` fetches the pinned core commit, verifies it, installs the library,
|
| 56 |
+
deletes the temporary checkout, removes the token from the application environment,
|
| 57 |
+
and launches Gradio on port 7860. Startup fails clearly if credentials or the pinned
|
| 58 |
+
revision are unavailable. This requires network access to GitHub at startup.
|
| 59 |
+
The installed core exists only in the running container, outside the published image.
|
| 60 |
+
uv uses a BuildKit cache mount for dependency downloads and builds; that cache is
|
| 61 |
+
reused across builds and does not become part of the published image.
|
| 62 |
+
|
| 63 |
+
Uploads and downloaded reports are ephemeral. Gradio blocks file serving from
|
| 64 |
+
the private library, development submodule, and Git metadata. The workbench preserves
|
| 65 |
+
queued streaming, cancellation, editable settings, and deterministic JSON reports.
|
| 66 |
+
|
| 67 |
+
## Update the core revision
|
| 68 |
+
|
| 69 |
+
Commit and push library changes in the private core repository first. Update the
|
| 70 |
+
submodule to that committed revision, then regenerate pin metadata and dependencies:
|
| 71 |
+
|
| 72 |
+
```sh
|
| 73 |
+
git -C core fetch origin
|
| 74 |
+
git -C core checkout CORE_COMMIT
|
| 75 |
+
uv run --no-sync python scripts/pin_core.py
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
Commit `core`, `core-revision.json`, `uv.lock`, and `requirements-runtime.txt`
|
| 79 |
+
together. The private core stays on GitHub; only its gitlink is published here.
|
| 80 |
+
The Docker build installs the hashed requirements without authenticating to GitHub.
|
| 81 |
+
|
| 82 |
+
Examples are prepared in the private core's Linux container with
|
| 83 |
+
`python -m scripts.export_demo_examples --out build/public-examples` and copied
|
| 84 |
+
into `examples/`. Startup does not compile original example sources or require
|
| 85 |
+
the core's test tree. Reference C is a display aid; uploaded binaries have none.
|
| 86 |
+
The bundled `factor` executable retains its redistribution notices in `examples/`.
|
| 87 |
+
|
| 88 |
+
## Publish under the existing Space name
|
| 89 |
+
|
| 90 |
+
The old private `ejschwartz/decompile-verify` Space contains core source and history.
|
| 91 |
+
Do not make it public directly. Back it up privately, then create a clean replacement
|
| 92 |
+
at the same name and push only this repository's fresh history. Configure secrets,
|
| 93 |
+
validate the app and all image layers while private, and verify old core-containing
|
| 94 |
+
commits and images are inaccessible before publishing. Replacing the Space requires
|
| 95 |
+
separate approval because it interrupts the current app and removes its history/settings.
|
| 96 |
+
|
| 97 |
+
See [Docker Space secrets](https://huggingface.co/docs/hub/spaces-sdks-docker#secrets-and-variables-management)
|
| 98 |
+
and [downloadable Space images](https://huggingface.co/docs/hub/spaces-run-with-docker).
|
| 99 |
+
|
| 100 |
+
To inspect every image layer for private core files and repository metadata, run
|
| 101 |
+
`python scripts/audit_image.py decompile-verify:gradio`. The audit recognizes uv's
|
| 102 |
+
empty cache sentinel as installer metadata rather than a project Git repository.
|
bootstrap.py
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Install the pinned private submodule at runtime, before importing Gradio."""
|
| 2 |
+
|
| 3 |
+
import argparse
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
from pathlib import Path
|
| 7 |
+
import re
|
| 8 |
+
import subprocess
|
| 9 |
+
import sys
|
| 10 |
+
import tempfile
|
| 11 |
+
|
| 12 |
+
ROOT = Path(__file__).resolve().parent
|
| 13 |
+
REPOSITORY = "https://github.com/edmcman/decompile-verify.git"
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
def revision():
|
| 17 |
+
data = json.loads((ROOT / "core-revision.json").read_text())
|
| 18 |
+
if data["repository"] != REPOSITORY or not re.fullmatch(r"[0-9a-f]{40}", data["commit"]):
|
| 19 |
+
raise ValueError("invalid pinned core repository or commit")
|
| 20 |
+
return data
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def command(args, *, env=None, cwd=None, timeout=300):
|
| 24 |
+
try:
|
| 25 |
+
return subprocess.run(args, cwd=cwd, env=env, check=True, capture_output=True,
|
| 26 |
+
text=True, timeout=timeout).stdout.strip()
|
| 27 |
+
except (subprocess.CalledProcessError, subprocess.TimeoutExpired, OSError) as error:
|
| 28 |
+
# Never emit raw Git output or the authentication environment into Space logs.
|
| 29 |
+
raise RuntimeError(f"private core setup failed during {Path(args[0]).name}; "
|
| 30 |
+
"check repository access, pinned commit, and network availability") from error
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
def install_core():
|
| 34 |
+
pinned = revision()
|
| 35 |
+
token = os.environ.pop("CORE_GITHUB_TOKEN", None)
|
| 36 |
+
if not token:
|
| 37 |
+
raise RuntimeError("set the CORE_GITHUB_TOKEN Space secret to a read-only GitHub token")
|
| 38 |
+
clean_env = {key: value for key, value in os.environ.items()
|
| 39 |
+
if not key.startswith("GIT_")}
|
| 40 |
+
clean_env["GIT_TERMINAL_PROMPT"] = "0"
|
| 41 |
+
clean_env["GIT_CONFIG_GLOBAL"] = os.devnull
|
| 42 |
+
clean_env["GIT_CONFIG_NOSYSTEM"] = "1"
|
| 43 |
+
# An ephemeral askpass helper supplies the credential without storing it in
|
| 44 |
+
# a URL, git config, command line, or the environment of the running app.
|
| 45 |
+
with tempfile.TemporaryDirectory(prefix="private-core-") as temporary:
|
| 46 |
+
directory = Path(temporary)
|
| 47 |
+
askpass = directory / "askpass.py"
|
| 48 |
+
askpass.write_text(f"#!{sys.executable}\nimport os, sys\n"
|
| 49 |
+
"print('x-access-token' if 'username' in sys.argv[1].lower() "
|
| 50 |
+
"else os.environ['CORE_GITHUB_TOKEN'])\n")
|
| 51 |
+
askpass.chmod(0o700)
|
| 52 |
+
git_env = {**clean_env, "GIT_ASKPASS": str(askpass), "CORE_GITHUB_TOKEN": token}
|
| 53 |
+
# Disable credential helpers so no persistent credential is read or saved.
|
| 54 |
+
git_env.update(GIT_CONFIG_COUNT="1", GIT_CONFIG_KEY_0="credential.helper", GIT_CONFIG_VALUE_0="")
|
| 55 |
+
source = directory / "source"
|
| 56 |
+
source.mkdir()
|
| 57 |
+
command(["git", "init", "--quiet", str(source)], env=clean_env)
|
| 58 |
+
command(["git", "remote", "add", "origin", REPOSITORY], env=clean_env, cwd=source)
|
| 59 |
+
command(["git", "fetch", "--quiet", "--depth=1", "origin", pinned["commit"]], env=git_env, cwd=source)
|
| 60 |
+
fetched = command(["git", "rev-parse", "FETCH_HEAD"], env=clean_env, cwd=source)
|
| 61 |
+
if fetched != pinned["commit"]:
|
| 62 |
+
raise RuntimeError("fetched core revision differs from the pinned submodule")
|
| 63 |
+
command(["git", "checkout", "--quiet", "--detach", "FETCH_HEAD"], env=clean_env, cwd=source)
|
| 64 |
+
git_env.clear()
|
| 65 |
+
token = None
|
| 66 |
+
command(["uv", "pip", "install", "--python", sys.executable,
|
| 67 |
+
"--no-deps", "--no-build-isolation", str(source)], env=clean_env)
|
| 68 |
+
from importlib.metadata import version
|
| 69 |
+
if version("decompile-verify") != pinned["version"]:
|
| 70 |
+
raise RuntimeError("installed core version differs from the pinned metadata")
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
def main():
|
| 74 |
+
parser = argparse.ArgumentParser(description=__doc__)
|
| 75 |
+
parser.add_argument("--install-only", action="store_true")
|
| 76 |
+
args = parser.parse_args()
|
| 77 |
+
try:
|
| 78 |
+
install_core()
|
| 79 |
+
except (RuntimeError, ValueError, KeyError, OSError) as error:
|
| 80 |
+
print(str(error), file=sys.stderr)
|
| 81 |
+
return 1
|
| 82 |
+
if not args.install_only:
|
| 83 |
+
os.execv(sys.executable, [sys.executable, "-m", "demo.app", "--host", "0.0.0.0", "--port", "7860"])
|
| 84 |
+
return 0
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
if __name__ == "__main__":
|
| 88 |
+
raise SystemExit(main())
|
core
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Subproject commit bdc8d4af1f3a26294cbca5bb094b7308b98859bd
|
core-revision.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"repository": "https://github.com/edmcman/decompile-verify.git",
|
| 3 |
+
"commit": "bdc8d4af1f3a26294cbca5bb094b7308b98859bd",
|
| 4 |
+
"version": "0.0.0"
|
| 5 |
+
}
|
demo/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
"""Gradio front end; verification is owned by verifier.api."""
|
demo/app.py
ADDED
|
@@ -0,0 +1,277 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Local Gradio demo. Run inside the Linux x86-64 Docker environment."""
|
| 2 |
+
|
| 3 |
+
import argparse
|
| 4 |
+
from contextlib import closing
|
| 5 |
+
from dataclasses import asdict
|
| 6 |
+
from hashlib import sha256
|
| 7 |
+
from decimal import Decimal
|
| 8 |
+
import re
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
import verifier
|
| 11 |
+
import shlex
|
| 12 |
+
import tempfile
|
| 13 |
+
|
| 14 |
+
import gradio as gr
|
| 15 |
+
|
| 16 |
+
from demo.examples import EXAMPLE_LABELS, ROOT, prepare_examples, reference_sources
|
| 17 |
+
from demo.presentation import banner, format_bit_ranges, json_detail, mismatch_summary, status
|
| 18 |
+
from demo.session import (UISession, begin_ui, cancel_session, controls, edit_inputs, idle_controls,
|
| 19 |
+
reset_session, stream_ui)
|
| 20 |
+
import verifier as api
|
| 21 |
+
from verifier import Task, integer_text, parse_bindings, parse_function, yaml_mapping
|
| 22 |
+
|
| 23 |
+
HEADERS = ["Seed", "Verdict", "Location", "Differing bits", "Original", "Candidate", "Reason"]
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def integer(value, label):
|
| 27 |
+
if type(value) is int:
|
| 28 |
+
return value
|
| 29 |
+
if isinstance(value, float) and value.is_integer():
|
| 30 |
+
return int(value)
|
| 31 |
+
if isinstance(value, str):
|
| 32 |
+
try:
|
| 33 |
+
if value.strip().lower().startswith("0x"):
|
| 34 |
+
return int(value.strip(), 16)
|
| 35 |
+
if re.fullmatch(r"[+-]?[0-9]+", value.strip()):
|
| 36 |
+
return int(Decimal(value.strip()))
|
| 37 |
+
except ValueError:
|
| 38 |
+
pass
|
| 39 |
+
raise ValueError(f"{label} must be an integer")
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
def result_row(result):
|
| 43 |
+
diff = result.difference
|
| 44 |
+
bits = format_bit_ranges((span.first, span.last) for span in getattr(diff, "bit_ranges", ()))
|
| 45 |
+
original, candidate = getattr(diff, "original", ""), getattr(diff, "candidate", "")
|
| 46 |
+
if isinstance(original, int):
|
| 47 |
+
original, candidate = hex(original), hex(candidate)
|
| 48 |
+
return [integer_text(result.seed), result.verdict, getattr(diff, "location", ""), bits,
|
| 49 |
+
original, candidate, result.reason or result.original.reason or result.candidate.reason or ""]
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
def task_from_inputs(binary, function, candidate, bindings, candidate_symbol,
|
| 53 |
+
seed_count, seed_start, instruction_budget, compiler, flags, interfaces=""):
|
| 54 |
+
if not binary:
|
| 55 |
+
raise ValueError("upload a binary or select an example")
|
| 56 |
+
options = yaml_mapping(interfaces or "")
|
| 57 |
+
allowed = {"original_prototype", "original_cc", "candidate_cc", "variadic_types", "callee_interfaces", "memory_ranges", "original_base"}
|
| 58 |
+
if set(options) - allowed:
|
| 59 |
+
raise ValueError("unknown interface settings: " + ", ".join(sorted(set(options) - allowed)))
|
| 60 |
+
return Task(binary=Path(binary), function=parse_function(function), candidate=candidate,
|
| 61 |
+
bindings=parse_bindings(bindings), candidate_symbol=candidate_symbol.strip(),
|
| 62 |
+
seed_count=integer(seed_count, "seed count"), seed_start=integer(seed_start, "seed start"),
|
| 63 |
+
instruction_budget=integer(instruction_budget, "instruction budget"),
|
| 64 |
+
compiler=compiler, flags=tuple(shlex.split(flags)), **options)
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
def clear_outputs():
|
| 68 |
+
return "", [], None, None, "", ""
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
def show_assembly(binary, function, candidate, bindings, candidate_symbol,
|
| 72 |
+
seed_count, seed_start, instruction_budget, compiler, flags, interfaces=""):
|
| 73 |
+
try:
|
| 74 |
+
report = api.inspect(task_from_inputs(binary, function, candidate, bindings, candidate_symbol,
|
| 75 |
+
seed_count, seed_start, instruction_budget, compiler, flags, interfaces))
|
| 76 |
+
yield banner(report, preview=True), [], None, None, report.original_assembly, report.candidate_assembly
|
| 77 |
+
except (ValueError, OSError) as error:
|
| 78 |
+
raise gr.Error(str(error)) from error
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
def run_verification(binary, function, candidate, bindings, candidate_symbol,
|
| 82 |
+
seed_count, seed_start, instruction_budget, compiler, flags, interfaces="", *, report_directory=None):
|
| 83 |
+
"""Translate UI inputs, stream engine results, then supply the JSON download."""
|
| 84 |
+
try:
|
| 85 |
+
task = task_from_inputs(binary, function, candidate, bindings, candidate_symbol,
|
| 86 |
+
seed_count, seed_start, instruction_budget, compiler, flags, interfaces)
|
| 87 |
+
rows, detail = [], None
|
| 88 |
+
with closing(api.verify(task, stream=True)) as iterator:
|
| 89 |
+
for report in iterator:
|
| 90 |
+
rows.append(result_row(report.results[-1]))
|
| 91 |
+
if detail is None and report.first_mismatch is not None:
|
| 92 |
+
detail = asdict(report.first_mismatch)
|
| 93 |
+
yield banner(report), list(rows), detail, None, report.original_assembly, report.candidate_assembly
|
| 94 |
+
output = report.to_json()
|
| 95 |
+
directory = Path(report_directory) if report_directory else Path(tempfile.gettempdir()) / "decompile-verify-reports"
|
| 96 |
+
directory.mkdir(parents=True, exist_ok=True)
|
| 97 |
+
path = directory / (sha256(output.encode()).hexdigest() + ".json")
|
| 98 |
+
# Atomic writes allow concurrent requests for the same deterministic report.
|
| 99 |
+
with tempfile.NamedTemporaryFile(mode="w", dir=directory, delete=False) as stream:
|
| 100 |
+
stream.write(output)
|
| 101 |
+
temporary = Path(stream.name)
|
| 102 |
+
temporary.replace(path)
|
| 103 |
+
yield banner(report, complete=True), rows, detail, str(path), report.original_assembly, report.candidate_assembly
|
| 104 |
+
except (ValueError, OSError) as error:
|
| 105 |
+
raise gr.Error(str(error)) from error
|
| 106 |
+
|
| 107 |
+
|
| 108 |
+
class Workbench(gr.Blocks):
|
| 109 |
+
"""Apply the workbench theme even when a caller launches create_app() directly."""
|
| 110 |
+
|
| 111 |
+
def launch(self, **kwargs):
|
| 112 |
+
kwargs.setdefault("theme", gr.themes.Base(
|
| 113 |
+
primary_hue="teal", secondary_hue="teal", neutral_hue="slate",
|
| 114 |
+
font=["system-ui", "sans-serif"], font_mono=["ui-monospace", "monospace"],
|
| 115 |
+
))
|
| 116 |
+
kwargs.setdefault("css_paths", Path(__file__).with_name("workbench.css"))
|
| 117 |
+
kwargs.setdefault("js", Path(__file__).with_name("workbench.js").read_text())
|
| 118 |
+
blocked = list(kwargs.pop("blocked_paths", ()) or ())
|
| 119 |
+
blocked.extend([str(Path(verifier.__file__).resolve().parent),
|
| 120 |
+
str(ROOT / "core"), str(ROOT / ".git")])
|
| 121 |
+
kwargs["blocked_paths"] = blocked
|
| 122 |
+
return super().launch(**kwargs)
|
| 123 |
+
|
| 124 |
+
|
| 125 |
+
def create_app(examples_directory=None):
|
| 126 |
+
examples = prepare_examples(examples_directory or ROOT / "build" / "demo-examples")
|
| 127 |
+
references = reference_sources()
|
| 128 |
+
with Workbench(title="Decompiler verifier", analytics_enabled=False,
|
| 129 |
+
fill_width=True, delete_cache=(3600, 86400)) as app:
|
| 130 |
+
session = gr.State(UISession())
|
| 131 |
+
ticket = gr.State(None)
|
| 132 |
+
reference_function = gr.State(None)
|
| 133 |
+
gr.Markdown("# Decompiler verifier\nCompare a C candidate with a binary function across shared random seeds.",
|
| 134 |
+
elem_id="intro")
|
| 135 |
+
# Render inputs later so the example picker can sit above setup.
|
| 136 |
+
binary = gr.File(label="Binary", type="filepath", file_count="single", render=False, elem_id="binary")
|
| 137 |
+
function = gr.Textbox(label="Function start address", placeholder="0x401000",
|
| 138 |
+
info="angr recovers the function's blocks using available symbols and control flow.", render=False)
|
| 139 |
+
candidate_symbol = gr.Textbox(label="Candidate function name", value="target", render=False)
|
| 140 |
+
candidate = gr.Code(label="Candidate C", language="c", lines=20, wrap_lines=False,
|
| 141 |
+
buttons=["copy"], render=False, elem_id="candidate-source")
|
| 142 |
+
bindings = gr.Code(label="Bindings (YAML)", language="yaml", lines=4,
|
| 143 |
+
value="globals: {}\ncallees: {}\n", render=False)
|
| 144 |
+
seed_count = gr.Number(label="Seed count", value=100, precision=0, minimum=1, render=False)
|
| 145 |
+
seed_start = gr.Textbox(label="First seed", value="0", info="Nonnegative decimal or hex integer", render=False)
|
| 146 |
+
instruction_budget = gr.Number(label="Instruction budget per run", value=100000, precision=0,
|
| 147 |
+
minimum=1, render=False)
|
| 148 |
+
compiler = gr.Dropdown(label="Candidate compiler", choices=["gcc", "clang"], value="gcc", render=False)
|
| 149 |
+
flags = gr.Textbox(label="Candidate flags", value="-O2",
|
| 150 |
+
info="Optimization/debug flags and selected C options; see docs/demo.md.", render=False)
|
| 151 |
+
interfaces = gr.Code(label="Function interfaces and explicit memory ranges (YAML)", language="yaml",
|
| 152 |
+
value="", lines=5, render=False)
|
| 153 |
+
inputs = [binary, function, candidate, bindings, candidate_symbol,
|
| 154 |
+
seed_count, seed_start, instruction_budget, compiler, flags, interfaces]
|
| 155 |
+
example_picker = gr.Examples(examples=examples, inputs=inputs, label="Examples",
|
| 156 |
+
example_labels=list(EXAMPLE_LABELS),
|
| 157 |
+
examples_per_page=20,
|
| 158 |
+
cache_examples=False, elem_id="examples")
|
| 159 |
+
with gr.Row(elem_id="setup"):
|
| 160 |
+
binary.render()
|
| 161 |
+
function.render()
|
| 162 |
+
candidate_symbol.render()
|
| 163 |
+
with gr.Accordion("Bindings", open=False):
|
| 164 |
+
bindings.render()
|
| 165 |
+
interfaces.render()
|
| 166 |
+
with gr.Accordion("Run settings", open=False):
|
| 167 |
+
with gr.Row():
|
| 168 |
+
seed_count.render()
|
| 169 |
+
seed_start.render()
|
| 170 |
+
instruction_budget.render()
|
| 171 |
+
compiler.render()
|
| 172 |
+
flags.render()
|
| 173 |
+
with gr.Row(elem_id="actions"):
|
| 174 |
+
run = gr.Button("Verify", variant="primary")
|
| 175 |
+
cancel = gr.Button("Cancel", interactive=False)
|
| 176 |
+
verdict = gr.HTML(status("Ready · Choose an example or upload a binary"), elem_id="verdict",
|
| 177 |
+
apply_default_css=False)
|
| 178 |
+
with gr.Row(elem_id="workspace") as workspace:
|
| 179 |
+
candidate.render()
|
| 180 |
+
reference = gr.Code(label="Reference C", language="c", lines=20,
|
| 181 |
+
interactive=False, wrap_lines=False, buttons=["copy"],
|
| 182 |
+
visible=False, elem_id="reference-source")
|
| 183 |
+
original_assembly = gr.Code(label="Original assembly", language=None, lines=20,
|
| 184 |
+
interactive=False, wrap_lines=False, buttons=["copy"],
|
| 185 |
+
show_line_numbers=False, elem_id="original-assembly")
|
| 186 |
+
candidate_assembly = gr.Code(label="Candidate assembly", language=None, lines=20,
|
| 187 |
+
interactive=False, wrap_lines=False, buttons=["copy"],
|
| 188 |
+
show_line_numbers=False, elem_id="candidate-assembly")
|
| 189 |
+
gr.Markdown("Compares ordered calls, non-frame memory at calls and return, typed returns, "
|
| 190 |
+
"and termination. Bound callees use declared signatures and deterministic "
|
| 191 |
+
"synthetic returns without memory effects. Frame-observing and unsupported "
|
| 192 |
+
"calls are inconclusive.", elem_id="scope")
|
| 193 |
+
with gr.Row(elem_id="results"):
|
| 194 |
+
table = gr.Dataframe(headers=HEADERS, datatype=["str"] * len(HEADERS),
|
| 195 |
+
interactive=False, label="Per-seed results", scale=2,
|
| 196 |
+
min_width=320, elem_id="seed-table", max_height=340,
|
| 197 |
+
column_widths=[90, 100, 100, 140, 120, 120, 240])
|
| 198 |
+
with gr.Column(scale=1, min_width=280):
|
| 199 |
+
gr.Markdown("### First mismatch")
|
| 200 |
+
summary = gr.HTML(mismatch_summary(None), apply_default_css=False, elem_id="mismatch-summary")
|
| 201 |
+
with gr.Accordion("Full mismatch JSON", open=False):
|
| 202 |
+
detail = gr.JSON(label="First mismatch")
|
| 203 |
+
download = gr.DownloadButton(label="Download JSON report")
|
| 204 |
+
outputs = [verdict, table, detail, download, original_assembly, candidate_assembly]
|
| 205 |
+
buttons = [run, cancel]
|
| 206 |
+
|
| 207 |
+
def verify_ui(binary, function, candidate, bindings, candidate_symbol,
|
| 208 |
+
seed_count, seed_start, instruction_budget, compiler, flags, interfaces, session, ticket):
|
| 209 |
+
for update in stream_ui(run_verification, (binary, function, candidate, bindings, candidate_symbol,
|
| 210 |
+
seed_count, seed_start, instruction_budget, compiler, flags, interfaces), session, ticket):
|
| 211 |
+
yield update[0], update[1], json_detail(update[2]), *update[3:]
|
| 212 |
+
|
| 213 |
+
def reset_ui(session):
|
| 214 |
+
reset_session(session)
|
| 215 |
+
return clear_outputs()
|
| 216 |
+
|
| 217 |
+
def load_reference(example):
|
| 218 |
+
index, values = example
|
| 219 |
+
source = references[index]
|
| 220 |
+
return (gr.update(value=source, visible=bool(source)),
|
| 221 |
+
gr.update(elem_classes=["has-reference"] if source else []), values[1])
|
| 222 |
+
|
| 223 |
+
def clear_reference():
|
| 224 |
+
return gr.update(value="", visible=False), gr.update(elem_classes=[]), None
|
| 225 |
+
|
| 226 |
+
def clear_changed_reference(function, reference_function):
|
| 227 |
+
if reference_function is not None and function != reference_function:
|
| 228 |
+
return clear_reference()
|
| 229 |
+
return (gr.skip(),) * 3
|
| 230 |
+
|
| 231 |
+
reference_outputs = [reference, workspace, reference_function]
|
| 232 |
+
|
| 233 |
+
# State inputs are private to Gradio and omitted from the public API signature.
|
| 234 |
+
verify_start = run.click(begin_ui, [session, *inputs], [verdict, *buttons, ticket],
|
| 235 |
+
queue=False, api_visibility="private", show_progress="hidden")
|
| 236 |
+
preview_event = gr.on(triggers=[], fn=show_assembly, inputs=inputs, outputs=outputs,
|
| 237 |
+
api_name="assembly", concurrency_limit=1,
|
| 238 |
+
concurrency_id="workbench", show_progress="hidden")
|
| 239 |
+
event = verify_start.then(verify_ui, [*inputs, session, ticket], outputs, api_name="verify", concurrency_limit=1,
|
| 240 |
+
concurrency_id="workbench", show_progress="hidden")
|
| 241 |
+
event.then(idle_controls, session, buttons, queue=False,
|
| 242 |
+
api_visibility="private", show_progress="hidden")
|
| 243 |
+
gr.on([binary.upload, binary.delete, binary.clear, *[component.input for component in inputs[1:]]],
|
| 244 |
+
edit_inputs, [session, *inputs], verdict,
|
| 245 |
+
queue=False, api_visibility="private", show_progress="hidden")
|
| 246 |
+
detail.change(mismatch_summary, detail, summary, queue=False,
|
| 247 |
+
api_visibility="private", show_progress="hidden")
|
| 248 |
+
example_picker.dataset.click(reset_ui, session, outputs, queue=False,
|
| 249 |
+
cancels=[event, preview_event], api_name="reset_outputs",
|
| 250 |
+
api_visibility="undocumented", show_progress="hidden")
|
| 251 |
+
example_picker.dataset.click(lambda: controls(False), outputs=buttons, queue=False,
|
| 252 |
+
api_visibility="private", show_progress="hidden")
|
| 253 |
+
example_picker.dataset.click(load_reference, example_picker.dataset, reference_outputs,
|
| 254 |
+
queue=False, api_visibility="private", show_progress="hidden")
|
| 255 |
+
gr.on([binary.upload, binary.delete, binary.clear, function.input],
|
| 256 |
+
clear_reference, outputs=reference_outputs, queue=False,
|
| 257 |
+
api_visibility="private", show_progress="hidden")
|
| 258 |
+
# Gradio 6.9 Textbox.input fires on keypress; blur also catches paste/deletion.
|
| 259 |
+
function.blur(clear_changed_reference, [function, reference_function], reference_outputs,
|
| 260 |
+
queue=False, api_visibility="private", show_progress="hidden")
|
| 261 |
+
cancel.click(cancel_session, session, verdict, cancels=[event, preview_event], queue=False,
|
| 262 |
+
api_visibility="private", show_progress="hidden").then(
|
| 263 |
+
idle_controls, session, buttons, queue=False,
|
| 264 |
+
api_visibility="private", show_progress="hidden")
|
| 265 |
+
return app.queue(max_size=16)
|
| 266 |
+
|
| 267 |
+
|
| 268 |
+
def main():
|
| 269 |
+
parser = argparse.ArgumentParser(description=__doc__)
|
| 270 |
+
parser.add_argument("--host", default="127.0.0.1")
|
| 271 |
+
parser.add_argument("--port", type=int, default=7860)
|
| 272 |
+
args = parser.parse_args()
|
| 273 |
+
create_app().launch(server_name=args.host, server_port=args.port, share=False)
|
| 274 |
+
|
| 275 |
+
|
| 276 |
+
if __name__ == "__main__":
|
| 277 |
+
main()
|
demo/examples.py
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Load public, prepared examples without access to the private test suite."""
|
| 2 |
+
|
| 3 |
+
from hashlib import sha256
|
| 4 |
+
import json
|
| 5 |
+
from pathlib import Path
|
| 6 |
+
import shutil
|
| 7 |
+
|
| 8 |
+
ROOT = Path(__file__).resolve().parents[1]
|
| 9 |
+
ASSETS = ROOT / "examples"
|
| 10 |
+
CATALOG = json.loads((ASSETS / "catalog.json").read_text())
|
| 11 |
+
EXAMPLE_NAMES = tuple(item["name"] for item in CATALOG)
|
| 12 |
+
EXAMPLE_LABELS = tuple(item["label"] for item in CATALOG)
|
| 13 |
+
ORIGINAL_EXAMPLE_NAMES = tuple(name for name in EXAMPLE_NAMES if not name.startswith("ghidra-"))
|
| 14 |
+
GHIDRA_EXAMPLE_NAMES = tuple(name for name in EXAMPLE_NAMES if name.startswith("ghidra-"))
|
| 15 |
+
ORIGINAL_EXAMPLE_LABELS = tuple(item["label"] for item in CATALOG if not item["name"].startswith("ghidra-"))
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
def example_metadata(name):
|
| 19 |
+
return next(item for item in CATALOG if item["name"] == name)
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
def ghidra_metadata(name):
|
| 23 |
+
return example_metadata(name).get("ghidra")
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def reference_sources():
|
| 27 |
+
return tuple(example_metadata(name)["reference"] for name in EXAMPLE_NAMES)
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
def prepare_examples(directory, *, include_ghidra=True):
|
| 31 |
+
directory = Path(directory).resolve()
|
| 32 |
+
directory.mkdir(parents=True, exist_ok=True)
|
| 33 |
+
rows = []
|
| 34 |
+
names = EXAMPLE_NAMES if include_ghidra else ORIGINAL_EXAMPLE_NAMES
|
| 35 |
+
for name in names:
|
| 36 |
+
item = example_metadata(name)
|
| 37 |
+
source = (ASSETS / item["binary"]).resolve()
|
| 38 |
+
if not source.is_relative_to(ASSETS.resolve()):
|
| 39 |
+
raise ValueError("example binary must be inside the public assets directory")
|
| 40 |
+
if sha256(source.read_bytes()).hexdigest() != item["binary_sha256"]:
|
| 41 |
+
raise ValueError(f"example binary checksum mismatch: {name}")
|
| 42 |
+
binary = directory / source.name
|
| 43 |
+
if source != binary:
|
| 44 |
+
shutil.copyfile(source, binary)
|
| 45 |
+
rows.append([str(binary), *item["inputs"]])
|
| 46 |
+
(directory / "examples.json").write_text(json.dumps(rows, indent=2) + "\n")
|
| 47 |
+
return rows
|
demo/presentation.py
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Presentation of existing reports; no verification decisions live here."""
|
| 2 |
+
|
| 3 |
+
from html import escape
|
| 4 |
+
from decimal import Decimal
|
| 5 |
+
from verifier import integer_text
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
STALE_SLOT = "<!--stale-->"
|
| 9 |
+
ABI_SLOT = "<!--abi-->"
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
def json_detail(value):
|
| 13 |
+
"""Display integers as exact text through JSON serialization and the browser."""
|
| 14 |
+
if isinstance(value, dict):
|
| 15 |
+
return {key: json_detail(item) for key, item in value.items()}
|
| 16 |
+
if isinstance(value, (list, tuple)):
|
| 17 |
+
return [json_detail(item) for item in value]
|
| 18 |
+
if type(value) is int:
|
| 19 |
+
return integer_text(value)
|
| 20 |
+
return value
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def code(value):
|
| 24 |
+
return f"<code>{escape(str(value))}</code>"
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
def status(label, tone="amber", progress=""):
|
| 28 |
+
return (f'<div class="run-status" role="status" aria-live="polite">'
|
| 29 |
+
f'<strong class="indicator {tone}">{escape(label)}</strong>{STALE_SLOT}'
|
| 30 |
+
f'<span class="counts">{escape(progress)}</span></div>')
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
def with_stale(value, stale):
|
| 34 |
+
marker = '<span class="indicator amber stale">Out of date</span>' if stale else ""
|
| 35 |
+
return value.replace(STALE_SLOT, marker)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
def format_bit_ranges(ranges):
|
| 39 |
+
return ", ".join(str(first) if first == last else f"{first}–{last}"
|
| 40 |
+
for first, last in ranges)
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
def abi_details(task):
|
| 44 |
+
rows = []
|
| 45 |
+
for arg in task["inputs"]:
|
| 46 |
+
location = code(arg["location"])
|
| 47 |
+
if arg["randomized"] is False:
|
| 48 |
+
location += ' <span class="muted">(not randomized)</span>'
|
| 49 |
+
rows.append(f'<tr><td>{code(arg["name"])}</td><td>{code(arg["type_name"])}</td>'
|
| 50 |
+
f'<td>{location}</td></tr>')
|
| 51 |
+
arguments = ('<table><thead><tr><th>Name</th><th>Type</th><th>Location</th></tr></thead>'
|
| 52 |
+
f'<tbody>{"".join(rows)}</tbody></table>' if rows else '<p>No arguments.</p>')
|
| 53 |
+
variadic = '<p class="muted">Includes explicitly typed variadic inputs.</p>' if task["variadic"] else ""
|
| 54 |
+
original = task.get("original_interface")
|
| 55 |
+
provenance = (f'<p>Original interface: {code(original["signature"])} · {code(original["calling_convention"])} · '
|
| 56 |
+
f'{code(original["source"])}' + (' (inferred)' if original["inferred"] else '') + '</p>') if original else ""
|
| 57 |
+
output = task["output"]
|
| 58 |
+
return (f'{ABI_SLOT}<div class="abi-details"><div><p class="section-label">Prototype</p>'
|
| 59 |
+
f'{code(task["prototype"])}{provenance}</div><div><p class="section-label">Arguments · {escape(task.get("calling_convention", ""))}</p>'
|
| 60 |
+
f'{arguments}{variadic}</div><div><p class="section-label">Return</p>'
|
| 61 |
+
f'<p>{code(output["type_name"])} → {code(output["location"])} '
|
| 62 |
+
f'({output["width"]} bits)</p></div></div>')
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
def literal_details(task):
|
| 66 |
+
bindings = task.get("literal_bindings", ())
|
| 67 |
+
if not bindings:
|
| 68 |
+
return ""
|
| 69 |
+
rows = []
|
| 70 |
+
for binding in bindings:
|
| 71 |
+
address = binding["address"]
|
| 72 |
+
detail = hex(address) if address is not None else {
|
| 73 |
+
"ambiguous": "Several original addresses match; kept local",
|
| 74 |
+
"unmatched": "No original match; kept local",
|
| 75 |
+
"skipped": "Unsupported type or source range; kept local",
|
| 76 |
+
}.get(binding["status"], "")
|
| 77 |
+
if binding.get("reason") == "binding_introduces_imports":
|
| 78 |
+
detail = "Binding would introduce library calls; kept local"
|
| 79 |
+
rows.append(f'<tr><td>{code(binding["literal"])}</td><td>{escape(binding["status"])}</td>'
|
| 80 |
+
f'<td>{escape(detail)}</td></tr>')
|
| 81 |
+
return ('<details class="literal-details"><summary>String literal bindings</summary>'
|
| 82 |
+
'<table><thead><tr><th>Literal</th><th>Status</th><th>Address / diagnostic</th></tr></thead>'
|
| 83 |
+
f'<tbody>{"".join(rows)}</tbody></table></details>')
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
def banner(report, complete=False, preview=False):
|
| 87 |
+
count = len(report.results)
|
| 88 |
+
label = ("Completed · Assembly preview" if preview else
|
| 89 |
+
f"Completed · {report.verdict.upper()}" if complete else
|
| 90 |
+
f"Running {count}/{report.task['seed_count']}")
|
| 91 |
+
tone = {"agree": "green", "mismatch": "red"}.get(report.verdict, "amber") if complete else "amber"
|
| 92 |
+
counts = report.counts
|
| 93 |
+
progress = "" if preview else (f"{counts['agree']} agree · {counts['mismatch']} mismatch · "
|
| 94 |
+
f"{counts['inconclusive']} inconclusive")
|
| 95 |
+
return status(label, tone, progress) + abi_details(report.task) + literal_details(report.task)
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
def mismatch_summary(detail):
|
| 99 |
+
if not detail:
|
| 100 |
+
return '<p class="muted">No mismatch to display.</p>'
|
| 101 |
+
diff = detail.get("difference") or {}
|
| 102 |
+
bits = format_bit_ranges((span["first"], span["last"]) for span in diff.get("bit_ranges", ()))
|
| 103 |
+
values = [("Seed", detail["seed"]), ("Location", diff.get("location", "—")),
|
| 104 |
+
("Original value", diff.get("original", "—")),
|
| 105 |
+
("Candidate value", diff.get("candidate", "—")), ("Differing bits", bits or "—")]
|
| 106 |
+
rows = []
|
| 107 |
+
for label, value in values:
|
| 108 |
+
if (label.endswith("value") and isinstance(value, str) and "width" in diff
|
| 109 |
+
and ("xor" not in diff or diff["xor"] is not None)):
|
| 110 |
+
value = int(Decimal(value))
|
| 111 |
+
if label.endswith("value") and isinstance(value, int):
|
| 112 |
+
value = hex(value)
|
| 113 |
+
elif isinstance(value, int):
|
| 114 |
+
value = integer_text(value)
|
| 115 |
+
rows.append(f'<div><dt>{escape(label)}</dt><dd>{code(value)}</dd></div>')
|
| 116 |
+
reason = detail.get("reason")
|
| 117 |
+
return (f'<dl class="mismatch-summary">{"".join(rows)}</dl>'
|
| 118 |
+
+ (f'<p>{escape(reason)}</p>' if reason else ""))
|
demo/session.py
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Private, per-browser state for displayed inputs and cancellable result streams."""
|
| 2 |
+
|
| 3 |
+
from contextlib import closing
|
| 4 |
+
from threading import RLock
|
| 5 |
+
|
| 6 |
+
from demo.presentation import ABI_SLOT, status, with_stale
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
class UISession:
|
| 10 |
+
def __init__(self):
|
| 11 |
+
self.snapshot = self.current = None
|
| 12 |
+
self.generation = 0
|
| 13 |
+
self.busy = False
|
| 14 |
+
self.display = ""
|
| 15 |
+
self.lock = RLock()
|
| 16 |
+
|
| 17 |
+
def __deepcopy__(self, memo):
|
| 18 |
+
# Each Gradio session gets its own state and synchronization primitive.
|
| 19 |
+
session = UISession()
|
| 20 |
+
session.snapshot, session.current = self.snapshot, self.current
|
| 21 |
+
session.generation, session.busy, session.display = self.generation, self.busy, self.display
|
| 22 |
+
return session
|
| 23 |
+
|
| 24 |
+
def rendered(self):
|
| 25 |
+
return with_stale(self.display, self.snapshot is not None and self.snapshot != self.current)
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
def edit_inputs(session, *values):
|
| 29 |
+
with session.lock:
|
| 30 |
+
session.current = tuple(values)
|
| 31 |
+
return session.rendered()
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
def reset_session(session):
|
| 35 |
+
with session.lock:
|
| 36 |
+
session.generation += 1
|
| 37 |
+
session.snapshot = session.current = None
|
| 38 |
+
session.busy = False
|
| 39 |
+
session.display = ""
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
def cancel_session(session):
|
| 43 |
+
with session.lock:
|
| 44 |
+
session.generation += 1
|
| 45 |
+
session.busy = False
|
| 46 |
+
_, separator, abi = session.display.partition(ABI_SLOT)
|
| 47 |
+
session.display = status("Cancelled") + separator + abi
|
| 48 |
+
return session.rendered()
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
def controls(busy):
|
| 52 |
+
import gradio as gr
|
| 53 |
+
|
| 54 |
+
return gr.update(interactive=not busy), gr.update(interactive=busy)
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
def idle_controls(session):
|
| 58 |
+
with session.lock:
|
| 59 |
+
return controls(session.busy)
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
def begin_ui(session, *values):
|
| 63 |
+
with session.lock:
|
| 64 |
+
session.generation += 1
|
| 65 |
+
session.snapshot = session.current = tuple(values)
|
| 66 |
+
session.busy = True
|
| 67 |
+
session.display = status("Building")
|
| 68 |
+
return session.rendered(), *controls(True), session.generation
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
def stream_ui(handler, values, session, ticket=None):
|
| 72 |
+
"""Keep the six API outputs while protecting this session from obsolete streams."""
|
| 73 |
+
with session.lock:
|
| 74 |
+
if ticket is not None:
|
| 75 |
+
if ticket != session.generation or not session.busy:
|
| 76 |
+
return
|
| 77 |
+
values = session.snapshot
|
| 78 |
+
else:
|
| 79 |
+
begin_ui(session, *values)
|
| 80 |
+
generation = session.generation
|
| 81 |
+
initial = session.rendered()
|
| 82 |
+
try:
|
| 83 |
+
yield initial, [], None, None, "", ""
|
| 84 |
+
with closing(handler(*values)) as iterator:
|
| 85 |
+
for update in iterator:
|
| 86 |
+
with session.lock:
|
| 87 |
+
if session.generation != generation:
|
| 88 |
+
return
|
| 89 |
+
session.display = update[0]
|
| 90 |
+
rendered = session.rendered()
|
| 91 |
+
yield (rendered, *update[1:])
|
| 92 |
+
except Exception:
|
| 93 |
+
with session.lock:
|
| 94 |
+
if session.generation == generation:
|
| 95 |
+
session.display = status("Failed · Check inputs and try again", "red")
|
| 96 |
+
rendered = session.rendered()
|
| 97 |
+
else:
|
| 98 |
+
return
|
| 99 |
+
yield rendered, [], None, None, "", ""
|
| 100 |
+
raise
|
| 101 |
+
finally:
|
| 102 |
+
with session.lock:
|
| 103 |
+
if session.generation == generation:
|
| 104 |
+
session.busy = False
|
demo/workbench.css
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.gradio-container { width: 100%; min-width: 0 !important; max-width: 1800px !important; margin: auto; }
|
| 2 |
+
#intro { margin-bottom: 0; }
|
| 3 |
+
#intro h1 { font-size: 1.65rem; letter-spacing: -.025em; }
|
| 4 |
+
#scope { font-size: .85rem; color: var(--body-text-color-subdued); }
|
| 5 |
+
#setup { align-items: stretch; }
|
| 6 |
+
#binary { min-height: 110px; }
|
| 7 |
+
#binary .wrap { min-height: 72px; }
|
| 8 |
+
#actions { gap: 8px; }
|
| 9 |
+
#actions button { flex: 0 1 160px; min-width: 160px; white-space: nowrap; }
|
| 10 |
+
#workspace { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
|
| 11 |
+
#workspace.has-reference { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
| 12 |
+
#workspace > * { min-width: 0 !important; width: 100%; }
|
| 13 |
+
#workspace > .block { min-height: 418px; }
|
| 14 |
+
#workspace .cm-editor { height: 390px; }
|
| 15 |
+
#workspace .cm-scroller { overflow: auto !important; }
|
| 16 |
+
#workspace .cm-content { white-space: pre !important; }
|
| 17 |
+
#workspace .cm-line { line-height: 1.45; }
|
| 18 |
+
#workspace .cm-gutters { line-height: 1.45; }
|
| 19 |
+
#workspace .cm-editor, #workspace .cm-scroller { font-size: 12px; }
|
| 20 |
+
#workspace .cm-scroller:focus-visible, #workspace button:focus-visible {
|
| 21 |
+
outline: 2px solid var(--color-accent); outline-offset: -2px;
|
| 22 |
+
}
|
| 23 |
+
.run-status { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-height: 44px;
|
| 24 |
+
padding: 10px 12px; border: 1px solid var(--border-color-primary); border-radius: 8px;
|
| 25 |
+
background: var(--block-background-fill); }
|
| 26 |
+
.indicator { display: inline-flex; align-items: center; gap: 7px; padding: 4px 9px;
|
| 27 |
+
border-radius: 5px; font-size: .9rem; font-weight: 600; }
|
| 28 |
+
.indicator::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
|
| 29 |
+
.green { color: #166534; background: #dcfce7; }
|
| 30 |
+
.red { color: #991b1b; background: #fee2e2; }
|
| 31 |
+
.amber { color: #854d0e; background: #fef3c7; }
|
| 32 |
+
.dark .green { color: #86efac; background: #143b2b; }
|
| 33 |
+
.dark .red { color: #fca5a5; background: #451d26; }
|
| 34 |
+
.dark .amber { color: #fde68a; background: #423519; }
|
| 35 |
+
.counts, .muted { color: var(--body-text-color-subdued); font-size: .85rem; }
|
| 36 |
+
.abi-details { display: grid; grid-template-columns: 1fr 1.4fr .7fr; gap: 24px; padding: 16px 2px 4px;
|
| 37 |
+
font-size: .85rem; color: var(--body-text-color); }
|
| 38 |
+
.abi-details > div { min-width: 0; overflow-x: auto; }
|
| 39 |
+
.section-label { font-weight: 600; margin: 0 0 6px; }
|
| 40 |
+
.abi-details table, .literal-details table { border-collapse: collapse; width: 100%; text-align: left; }
|
| 41 |
+
.abi-details th, .abi-details td, .literal-details th, .literal-details td { padding: 4px 12px 4px 0; vertical-align: top; }
|
| 42 |
+
.abi-details th, .literal-details th { font-weight: 500; color: var(--body-text-color-subdued); }
|
| 43 |
+
.abi-details code, .mismatch-summary code, .literal-details code { font-family: var(--font-mono); }
|
| 44 |
+
.literal-details { margin-top: 12px; overflow-x: auto; font-size: .85rem; }
|
| 45 |
+
.literal-details summary { cursor: pointer; color: var(--body-text-color-subdued); }
|
| 46 |
+
.abi-details p { margin-top: 0; }
|
| 47 |
+
#results { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: stretch; }
|
| 48 |
+
#results > * { min-width: 0 !important; }
|
| 49 |
+
#seed-table { overflow-x: auto !important; }
|
| 50 |
+
.mismatch-summary { margin: 0; color: var(--body-text-color); }
|
| 51 |
+
.mismatch-summary > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px;
|
| 52 |
+
padding: 9px 0; border-bottom: 1px solid var(--border-color-primary); }
|
| 53 |
+
.mismatch-summary dt { color: var(--body-text-color-subdued); font-size: .85rem; }
|
| 54 |
+
.mismatch-summary dd { margin: 0; overflow-wrap: anywhere; }
|
| 55 |
+
@media (max-width: 1099px) {
|
| 56 |
+
#workspace, #workspace.has-reference { grid-template-columns: minmax(0, 1fr); }
|
| 57 |
+
#workspace > .block { min-height: 328px; }
|
| 58 |
+
#workspace .cm-editor { height: 300px; }
|
| 59 |
+
.abi-details { grid-template-columns: minmax(0, 1fr); gap: 12px; }
|
| 60 |
+
}
|
| 61 |
+
@media (max-width: 800px) { #results { grid-template-columns: minmax(0, 1fr); } }
|
| 62 |
+
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
|
demo/workbench.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(() => {
|
| 2 |
+
// Gradio's built-in Code copy controls have empty accessible names.
|
| 3 |
+
const labelPanes = () => {
|
| 4 |
+
for (const [id, label] of [
|
| 5 |
+
["candidate-source", "Candidate C"],
|
| 6 |
+
["reference-source", "Reference C"],
|
| 7 |
+
["original-assembly", "Original assembly"],
|
| 8 |
+
["candidate-assembly", "Candidate assembly"],
|
| 9 |
+
]) {
|
| 10 |
+
const pane = document.getElementById(id);
|
| 11 |
+
if (!pane) continue;
|
| 12 |
+
const copy = pane.querySelector("button.icon-button");
|
| 13 |
+
if (copy && copy.getAttribute("aria-label") !== `Copy ${label}`) {
|
| 14 |
+
copy.setAttribute("aria-label", `Copy ${label}`);
|
| 15 |
+
copy.setAttribute("title", `Copy ${label}`);
|
| 16 |
+
}
|
| 17 |
+
const content = pane.querySelector(".cm-content");
|
| 18 |
+
if (content && content.getAttribute("aria-label") !== label) {
|
| 19 |
+
content.setAttribute("aria-label", label);
|
| 20 |
+
}
|
| 21 |
+
const scroller = pane.querySelector(".cm-scroller");
|
| 22 |
+
if (id !== "candidate-source" && scroller && scroller.tabIndex !== 0) {
|
| 23 |
+
scroller.tabIndex = 0;
|
| 24 |
+
scroller.setAttribute("aria-label", `${label} scroll area`);
|
| 25 |
+
}
|
| 26 |
+
}
|
| 27 |
+
};
|
| 28 |
+
labelPanes();
|
| 29 |
+
new MutationObserver(labelPanes).observe(document.body, {
|
| 30 |
+
childList: true, subtree: true,
|
| 31 |
+
});
|
| 32 |
+
})();
|
examples/COPYING
ADDED
|
@@ -0,0 +1,674 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
GNU GENERAL PUBLIC LICENSE
|
| 2 |
+
Version 3, 29 June 2007
|
| 3 |
+
|
| 4 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
| 5 |
+
Everyone is permitted to copy and distribute verbatim copies
|
| 6 |
+
of this license document, but changing it is not allowed.
|
| 7 |
+
|
| 8 |
+
Preamble
|
| 9 |
+
|
| 10 |
+
The GNU General Public License is a free, copyleft license for
|
| 11 |
+
software and other kinds of works.
|
| 12 |
+
|
| 13 |
+
The licenses for most software and other practical works are designed
|
| 14 |
+
to take away your freedom to share and change the works. By contrast,
|
| 15 |
+
the GNU General Public License is intended to guarantee your freedom to
|
| 16 |
+
share and change all versions of a program--to make sure it remains free
|
| 17 |
+
software for all its users. We, the Free Software Foundation, use the
|
| 18 |
+
GNU General Public License for most of our software; it applies also to
|
| 19 |
+
any other work released this way by its authors. You can apply it to
|
| 20 |
+
your programs, too.
|
| 21 |
+
|
| 22 |
+
When we speak of free software, we are referring to freedom, not
|
| 23 |
+
price. Our General Public Licenses are designed to make sure that you
|
| 24 |
+
have the freedom to distribute copies of free software (and charge for
|
| 25 |
+
them if you wish), that you receive source code or can get it if you
|
| 26 |
+
want it, that you can change the software or use pieces of it in new
|
| 27 |
+
free programs, and that you know you can do these things.
|
| 28 |
+
|
| 29 |
+
To protect your rights, we need to prevent others from denying you
|
| 30 |
+
these rights or asking you to surrender the rights. Therefore, you have
|
| 31 |
+
certain responsibilities if you distribute copies of the software, or if
|
| 32 |
+
you modify it: responsibilities to respect the freedom of others.
|
| 33 |
+
|
| 34 |
+
For example, if you distribute copies of such a program, whether
|
| 35 |
+
gratis or for a fee, you must pass on to the recipients the same
|
| 36 |
+
freedoms that you received. You must make sure that they, too, receive
|
| 37 |
+
or can get the source code. And you must show them these terms so they
|
| 38 |
+
know their rights.
|
| 39 |
+
|
| 40 |
+
Developers that use the GNU GPL protect your rights with two steps:
|
| 41 |
+
(1) assert copyright on the software, and (2) offer you this License
|
| 42 |
+
giving you legal permission to copy, distribute and/or modify it.
|
| 43 |
+
|
| 44 |
+
For the developers' and authors' protection, the GPL clearly explains
|
| 45 |
+
that there is no warranty for this free software. For both users' and
|
| 46 |
+
authors' sake, the GPL requires that modified versions be marked as
|
| 47 |
+
changed, so that their problems will not be attributed erroneously to
|
| 48 |
+
authors of previous versions.
|
| 49 |
+
|
| 50 |
+
Some devices are designed to deny users access to install or run
|
| 51 |
+
modified versions of the software inside them, although the manufacturer
|
| 52 |
+
can do so. This is fundamentally incompatible with the aim of
|
| 53 |
+
protecting users' freedom to change the software. The systematic
|
| 54 |
+
pattern of such abuse occurs in the area of products for individuals to
|
| 55 |
+
use, which is precisely where it is most unacceptable. Therefore, we
|
| 56 |
+
have designed this version of the GPL to prohibit the practice for those
|
| 57 |
+
products. If such problems arise substantially in other domains, we
|
| 58 |
+
stand ready to extend this provision to those domains in future versions
|
| 59 |
+
of the GPL, as needed to protect the freedom of users.
|
| 60 |
+
|
| 61 |
+
Finally, every program is threatened constantly by software patents.
|
| 62 |
+
States should not allow patents to restrict development and use of
|
| 63 |
+
software on general-purpose computers, but in those that do, we wish to
|
| 64 |
+
avoid the special danger that patents applied to a free program could
|
| 65 |
+
make it effectively proprietary. To prevent this, the GPL assures that
|
| 66 |
+
patents cannot be used to render the program non-free.
|
| 67 |
+
|
| 68 |
+
The precise terms and conditions for copying, distribution and
|
| 69 |
+
modification follow.
|
| 70 |
+
|
| 71 |
+
TERMS AND CONDITIONS
|
| 72 |
+
|
| 73 |
+
0. Definitions.
|
| 74 |
+
|
| 75 |
+
"This License" refers to version 3 of the GNU General Public License.
|
| 76 |
+
|
| 77 |
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
| 78 |
+
works, such as semiconductor masks.
|
| 79 |
+
|
| 80 |
+
"The Program" refers to any copyrightable work licensed under this
|
| 81 |
+
License. Each licensee is addressed as "you". "Licensees" and
|
| 82 |
+
"recipients" may be individuals or organizations.
|
| 83 |
+
|
| 84 |
+
To "modify" a work means to copy from or adapt all or part of the work
|
| 85 |
+
in a fashion requiring copyright permission, other than the making of an
|
| 86 |
+
exact copy. The resulting work is called a "modified version" of the
|
| 87 |
+
earlier work or a work "based on" the earlier work.
|
| 88 |
+
|
| 89 |
+
A "covered work" means either the unmodified Program or a work based
|
| 90 |
+
on the Program.
|
| 91 |
+
|
| 92 |
+
To "propagate" a work means to do anything with it that, without
|
| 93 |
+
permission, would make you directly or secondarily liable for
|
| 94 |
+
infringement under applicable copyright law, except executing it on a
|
| 95 |
+
computer or modifying a private copy. Propagation includes copying,
|
| 96 |
+
distribution (with or without modification), making available to the
|
| 97 |
+
public, and in some countries other activities as well.
|
| 98 |
+
|
| 99 |
+
To "convey" a work means any kind of propagation that enables other
|
| 100 |
+
parties to make or receive copies. Mere interaction with a user through
|
| 101 |
+
a computer network, with no transfer of a copy, is not conveying.
|
| 102 |
+
|
| 103 |
+
An interactive user interface displays "Appropriate Legal Notices"
|
| 104 |
+
to the extent that it includes a convenient and prominently visible
|
| 105 |
+
feature that (1) displays an appropriate copyright notice, and (2)
|
| 106 |
+
tells the user that there is no warranty for the work (except to the
|
| 107 |
+
extent that warranties are provided), that licensees may convey the
|
| 108 |
+
work under this License, and how to view a copy of this License. If
|
| 109 |
+
the interface presents a list of user commands or options, such as a
|
| 110 |
+
menu, a prominent item in the list meets this criterion.
|
| 111 |
+
|
| 112 |
+
1. Source Code.
|
| 113 |
+
|
| 114 |
+
The "source code" for a work means the preferred form of the work
|
| 115 |
+
for making modifications to it. "Object code" means any non-source
|
| 116 |
+
form of a work.
|
| 117 |
+
|
| 118 |
+
A "Standard Interface" means an interface that either is an official
|
| 119 |
+
standard defined by a recognized standards body, or, in the case of
|
| 120 |
+
interfaces specified for a particular programming language, one that
|
| 121 |
+
is widely used among developers working in that language.
|
| 122 |
+
|
| 123 |
+
The "System Libraries" of an executable work include anything, other
|
| 124 |
+
than the work as a whole, that (a) is included in the normal form of
|
| 125 |
+
packaging a Major Component, but which is not part of that Major
|
| 126 |
+
Component, and (b) serves only to enable use of the work with that
|
| 127 |
+
Major Component, or to implement a Standard Interface for which an
|
| 128 |
+
implementation is available to the public in source code form. A
|
| 129 |
+
"Major Component", in this context, means a major essential component
|
| 130 |
+
(kernel, window system, and so on) of the specific operating system
|
| 131 |
+
(if any) on which the executable work runs, or a compiler used to
|
| 132 |
+
produce the work, or an object code interpreter used to run it.
|
| 133 |
+
|
| 134 |
+
The "Corresponding Source" for a work in object code form means all
|
| 135 |
+
the source code needed to generate, install, and (for an executable
|
| 136 |
+
work) run the object code and to modify the work, including scripts to
|
| 137 |
+
control those activities. However, it does not include the work's
|
| 138 |
+
System Libraries, or general-purpose tools or generally available free
|
| 139 |
+
programs which are used unmodified in performing those activities but
|
| 140 |
+
which are not part of the work. For example, Corresponding Source
|
| 141 |
+
includes interface definition files associated with source files for
|
| 142 |
+
the work, and the source code for shared libraries and dynamically
|
| 143 |
+
linked subprograms that the work is specifically designed to require,
|
| 144 |
+
such as by intimate data communication or control flow between those
|
| 145 |
+
subprograms and other parts of the work.
|
| 146 |
+
|
| 147 |
+
The Corresponding Source need not include anything that users
|
| 148 |
+
can regenerate automatically from other parts of the Corresponding
|
| 149 |
+
Source.
|
| 150 |
+
|
| 151 |
+
The Corresponding Source for a work in source code form is that
|
| 152 |
+
same work.
|
| 153 |
+
|
| 154 |
+
2. Basic Permissions.
|
| 155 |
+
|
| 156 |
+
All rights granted under this License are granted for the term of
|
| 157 |
+
copyright on the Program, and are irrevocable provided the stated
|
| 158 |
+
conditions are met. This License explicitly affirms your unlimited
|
| 159 |
+
permission to run the unmodified Program. The output from running a
|
| 160 |
+
covered work is covered by this License only if the output, given its
|
| 161 |
+
content, constitutes a covered work. This License acknowledges your
|
| 162 |
+
rights of fair use or other equivalent, as provided by copyright law.
|
| 163 |
+
|
| 164 |
+
You may make, run and propagate covered works that you do not
|
| 165 |
+
convey, without conditions so long as your license otherwise remains
|
| 166 |
+
in force. You may convey covered works to others for the sole purpose
|
| 167 |
+
of having them make modifications exclusively for you, or provide you
|
| 168 |
+
with facilities for running those works, provided that you comply with
|
| 169 |
+
the terms of this License in conveying all material for which you do
|
| 170 |
+
not control copyright. Those thus making or running the covered works
|
| 171 |
+
for you must do so exclusively on your behalf, under your direction
|
| 172 |
+
and control, on terms that prohibit them from making any copies of
|
| 173 |
+
your copyrighted material outside their relationship with you.
|
| 174 |
+
|
| 175 |
+
Conveying under any other circumstances is permitted solely under
|
| 176 |
+
the conditions stated below. Sublicensing is not allowed; section 10
|
| 177 |
+
makes it unnecessary.
|
| 178 |
+
|
| 179 |
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
| 180 |
+
|
| 181 |
+
No covered work shall be deemed part of an effective technological
|
| 182 |
+
measure under any applicable law fulfilling obligations under article
|
| 183 |
+
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
| 184 |
+
similar laws prohibiting or restricting circumvention of such
|
| 185 |
+
measures.
|
| 186 |
+
|
| 187 |
+
When you convey a covered work, you waive any legal power to forbid
|
| 188 |
+
circumvention of technological measures to the extent such circumvention
|
| 189 |
+
is effected by exercising rights under this License with respect to
|
| 190 |
+
the covered work, and you disclaim any intention to limit operation or
|
| 191 |
+
modification of the work as a means of enforcing, against the work's
|
| 192 |
+
users, your or third parties' legal rights to forbid circumvention of
|
| 193 |
+
technological measures.
|
| 194 |
+
|
| 195 |
+
4. Conveying Verbatim Copies.
|
| 196 |
+
|
| 197 |
+
You may convey verbatim copies of the Program's source code as you
|
| 198 |
+
receive it, in any medium, provided that you conspicuously and
|
| 199 |
+
appropriately publish on each copy an appropriate copyright notice;
|
| 200 |
+
keep intact all notices stating that this License and any
|
| 201 |
+
non-permissive terms added in accord with section 7 apply to the code;
|
| 202 |
+
keep intact all notices of the absence of any warranty; and give all
|
| 203 |
+
recipients a copy of this License along with the Program.
|
| 204 |
+
|
| 205 |
+
You may charge any price or no price for each copy that you convey,
|
| 206 |
+
and you may offer support or warranty protection for a fee.
|
| 207 |
+
|
| 208 |
+
5. Conveying Modified Source Versions.
|
| 209 |
+
|
| 210 |
+
You may convey a work based on the Program, or the modifications to
|
| 211 |
+
produce it from the Program, in the form of source code under the
|
| 212 |
+
terms of section 4, provided that you also meet all of these conditions:
|
| 213 |
+
|
| 214 |
+
a) The work must carry prominent notices stating that you modified
|
| 215 |
+
it, and giving a relevant date.
|
| 216 |
+
|
| 217 |
+
b) The work must carry prominent notices stating that it is
|
| 218 |
+
released under this License and any conditions added under section
|
| 219 |
+
7. This requirement modifies the requirement in section 4 to
|
| 220 |
+
"keep intact all notices".
|
| 221 |
+
|
| 222 |
+
c) You must license the entire work, as a whole, under this
|
| 223 |
+
License to anyone who comes into possession of a copy. This
|
| 224 |
+
License will therefore apply, along with any applicable section 7
|
| 225 |
+
additional terms, to the whole of the work, and all its parts,
|
| 226 |
+
regardless of how they are packaged. This License gives no
|
| 227 |
+
permission to license the work in any other way, but it does not
|
| 228 |
+
invalidate such permission if you have separately received it.
|
| 229 |
+
|
| 230 |
+
d) If the work has interactive user interfaces, each must display
|
| 231 |
+
Appropriate Legal Notices; however, if the Program has interactive
|
| 232 |
+
interfaces that do not display Appropriate Legal Notices, your
|
| 233 |
+
work need not make them do so.
|
| 234 |
+
|
| 235 |
+
A compilation of a covered work with other separate and independent
|
| 236 |
+
works, which are not by their nature extensions of the covered work,
|
| 237 |
+
and which are not combined with it such as to form a larger program,
|
| 238 |
+
in or on a volume of a storage or distribution medium, is called an
|
| 239 |
+
"aggregate" if the compilation and its resulting copyright are not
|
| 240 |
+
used to limit the access or legal rights of the compilation's users
|
| 241 |
+
beyond what the individual works permit. Inclusion of a covered work
|
| 242 |
+
in an aggregate does not cause this License to apply to the other
|
| 243 |
+
parts of the aggregate.
|
| 244 |
+
|
| 245 |
+
6. Conveying Non-Source Forms.
|
| 246 |
+
|
| 247 |
+
You may convey a covered work in object code form under the terms
|
| 248 |
+
of sections 4 and 5, provided that you also convey the
|
| 249 |
+
machine-readable Corresponding Source under the terms of this License,
|
| 250 |
+
in one of these ways:
|
| 251 |
+
|
| 252 |
+
a) Convey the object code in, or embodied in, a physical product
|
| 253 |
+
(including a physical distribution medium), accompanied by the
|
| 254 |
+
Corresponding Source fixed on a durable physical medium
|
| 255 |
+
customarily used for software interchange.
|
| 256 |
+
|
| 257 |
+
b) Convey the object code in, or embodied in, a physical product
|
| 258 |
+
(including a physical distribution medium), accompanied by a
|
| 259 |
+
written offer, valid for at least three years and valid for as
|
| 260 |
+
long as you offer spare parts or customer support for that product
|
| 261 |
+
model, to give anyone who possesses the object code either (1) a
|
| 262 |
+
copy of the Corresponding Source for all the software in the
|
| 263 |
+
product that is covered by this License, on a durable physical
|
| 264 |
+
medium customarily used for software interchange, for a price no
|
| 265 |
+
more than your reasonable cost of physically performing this
|
| 266 |
+
conveying of source, or (2) access to copy the
|
| 267 |
+
Corresponding Source from a network server at no charge.
|
| 268 |
+
|
| 269 |
+
c) Convey individual copies of the object code with a copy of the
|
| 270 |
+
written offer to provide the Corresponding Source. This
|
| 271 |
+
alternative is allowed only occasionally and noncommercially, and
|
| 272 |
+
only if you received the object code with such an offer, in accord
|
| 273 |
+
with subsection 6b.
|
| 274 |
+
|
| 275 |
+
d) Convey the object code by offering access from a designated
|
| 276 |
+
place (gratis or for a charge), and offer equivalent access to the
|
| 277 |
+
Corresponding Source in the same way through the same place at no
|
| 278 |
+
further charge. You need not require recipients to copy the
|
| 279 |
+
Corresponding Source along with the object code. If the place to
|
| 280 |
+
copy the object code is a network server, the Corresponding Source
|
| 281 |
+
may be on a different server (operated by you or a third party)
|
| 282 |
+
that supports equivalent copying facilities, provided you maintain
|
| 283 |
+
clear directions next to the object code saying where to find the
|
| 284 |
+
Corresponding Source. Regardless of what server hosts the
|
| 285 |
+
Corresponding Source, you remain obligated to ensure that it is
|
| 286 |
+
available for as long as needed to satisfy these requirements.
|
| 287 |
+
|
| 288 |
+
e) Convey the object code using peer-to-peer transmission, provided
|
| 289 |
+
you inform other peers where the object code and Corresponding
|
| 290 |
+
Source of the work are being offered to the general public at no
|
| 291 |
+
charge under subsection 6d.
|
| 292 |
+
|
| 293 |
+
A separable portion of the object code, whose source code is excluded
|
| 294 |
+
from the Corresponding Source as a System Library, need not be
|
| 295 |
+
included in conveying the object code work.
|
| 296 |
+
|
| 297 |
+
A "User Product" is either (1) a "consumer product", which means any
|
| 298 |
+
tangible personal property which is normally used for personal, family,
|
| 299 |
+
or household purposes, or (2) anything designed or sold for incorporation
|
| 300 |
+
into a dwelling. In determining whether a product is a consumer product,
|
| 301 |
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
| 302 |
+
product received by a particular user, "normally used" refers to a
|
| 303 |
+
typical or common use of that class of product, regardless of the status
|
| 304 |
+
of the particular user or of the way in which the particular user
|
| 305 |
+
actually uses, or expects or is expected to use, the product. A product
|
| 306 |
+
is a consumer product regardless of whether the product has substantial
|
| 307 |
+
commercial, industrial or non-consumer uses, unless such uses represent
|
| 308 |
+
the only significant mode of use of the product.
|
| 309 |
+
|
| 310 |
+
"Installation Information" for a User Product means any methods,
|
| 311 |
+
procedures, authorization keys, or other information required to install
|
| 312 |
+
and execute modified versions of a covered work in that User Product from
|
| 313 |
+
a modified version of its Corresponding Source. The information must
|
| 314 |
+
suffice to ensure that the continued functioning of the modified object
|
| 315 |
+
code is in no case prevented or interfered with solely because
|
| 316 |
+
modification has been made.
|
| 317 |
+
|
| 318 |
+
If you convey an object code work under this section in, or with, or
|
| 319 |
+
specifically for use in, a User Product, and the conveying occurs as
|
| 320 |
+
part of a transaction in which the right of possession and use of the
|
| 321 |
+
User Product is transferred to the recipient in perpetuity or for a
|
| 322 |
+
fixed term (regardless of how the transaction is characterized), the
|
| 323 |
+
Corresponding Source conveyed under this section must be accompanied
|
| 324 |
+
by the Installation Information. But this requirement does not apply
|
| 325 |
+
if neither you nor any third party retains the ability to install
|
| 326 |
+
modified object code on the User Product (for example, the work has
|
| 327 |
+
been installed in ROM).
|
| 328 |
+
|
| 329 |
+
The requirement to provide Installation Information does not include a
|
| 330 |
+
requirement to continue to provide support service, warranty, or updates
|
| 331 |
+
for a work that has been modified or installed by the recipient, or for
|
| 332 |
+
the User Product in which it has been modified or installed. Access to a
|
| 333 |
+
network may be denied when the modification itself materially and
|
| 334 |
+
adversely affects the operation of the network or violates the rules and
|
| 335 |
+
protocols for communication across the network.
|
| 336 |
+
|
| 337 |
+
Corresponding Source conveyed, and Installation Information provided,
|
| 338 |
+
in accord with this section must be in a format that is publicly
|
| 339 |
+
documented (and with an implementation available to the public in
|
| 340 |
+
source code form), and must require no special password or key for
|
| 341 |
+
unpacking, reading or copying.
|
| 342 |
+
|
| 343 |
+
7. Additional Terms.
|
| 344 |
+
|
| 345 |
+
"Additional permissions" are terms that supplement the terms of this
|
| 346 |
+
License by making exceptions from one or more of its conditions.
|
| 347 |
+
Additional permissions that are applicable to the entire Program shall
|
| 348 |
+
be treated as though they were included in this License, to the extent
|
| 349 |
+
that they are valid under applicable law. If additional permissions
|
| 350 |
+
apply only to part of the Program, that part may be used separately
|
| 351 |
+
under those permissions, but the entire Program remains governed by
|
| 352 |
+
this License without regard to the additional permissions.
|
| 353 |
+
|
| 354 |
+
When you convey a copy of a covered work, you may at your option
|
| 355 |
+
remove any additional permissions from that copy, or from any part of
|
| 356 |
+
it. (Additional permissions may be written to require their own
|
| 357 |
+
removal in certain cases when you modify the work.) You may place
|
| 358 |
+
additional permissions on material, added by you to a covered work,
|
| 359 |
+
for which you have or can give appropriate copyright permission.
|
| 360 |
+
|
| 361 |
+
Notwithstanding any other provision of this License, for material you
|
| 362 |
+
add to a covered work, you may (if authorized by the copyright holders of
|
| 363 |
+
that material) supplement the terms of this License with terms:
|
| 364 |
+
|
| 365 |
+
a) Disclaiming warranty or limiting liability differently from the
|
| 366 |
+
terms of sections 15 and 16 of this License; or
|
| 367 |
+
|
| 368 |
+
b) Requiring preservation of specified reasonable legal notices or
|
| 369 |
+
author attributions in that material or in the Appropriate Legal
|
| 370 |
+
Notices displayed by works containing it; or
|
| 371 |
+
|
| 372 |
+
c) Prohibiting misrepresentation of the origin of that material, or
|
| 373 |
+
requiring that modified versions of such material be marked in
|
| 374 |
+
reasonable ways as different from the original version; or
|
| 375 |
+
|
| 376 |
+
d) Limiting the use for publicity purposes of names of licensors or
|
| 377 |
+
authors of the material; or
|
| 378 |
+
|
| 379 |
+
e) Declining to grant rights under trademark law for use of some
|
| 380 |
+
trade names, trademarks, or service marks; or
|
| 381 |
+
|
| 382 |
+
f) Requiring indemnification of licensors and authors of that
|
| 383 |
+
material by anyone who conveys the material (or modified versions of
|
| 384 |
+
it) with contractual assumptions of liability to the recipient, for
|
| 385 |
+
any liability that these contractual assumptions directly impose on
|
| 386 |
+
those licensors and authors.
|
| 387 |
+
|
| 388 |
+
All other non-permissive additional terms are considered "further
|
| 389 |
+
restrictions" within the meaning of section 10. If the Program as you
|
| 390 |
+
received it, or any part of it, contains a notice stating that it is
|
| 391 |
+
governed by this License along with a term that is a further
|
| 392 |
+
restriction, you may remove that term. If a license document contains
|
| 393 |
+
a further restriction but permits relicensing or conveying under this
|
| 394 |
+
License, you may add to a covered work material governed by the terms
|
| 395 |
+
of that license document, provided that the further restriction does
|
| 396 |
+
not survive such relicensing or conveying.
|
| 397 |
+
|
| 398 |
+
If you add terms to a covered work in accord with this section, you
|
| 399 |
+
must place, in the relevant source files, a statement of the
|
| 400 |
+
additional terms that apply to those files, or a notice indicating
|
| 401 |
+
where to find the applicable terms.
|
| 402 |
+
|
| 403 |
+
Additional terms, permissive or non-permissive, may be stated in the
|
| 404 |
+
form of a separately written license, or stated as exceptions;
|
| 405 |
+
the above requirements apply either way.
|
| 406 |
+
|
| 407 |
+
8. Termination.
|
| 408 |
+
|
| 409 |
+
You may not propagate or modify a covered work except as expressly
|
| 410 |
+
provided under this License. Any attempt otherwise to propagate or
|
| 411 |
+
modify it is void, and will automatically terminate your rights under
|
| 412 |
+
this License (including any patent licenses granted under the third
|
| 413 |
+
paragraph of section 11).
|
| 414 |
+
|
| 415 |
+
However, if you cease all violation of this License, then your
|
| 416 |
+
license from a particular copyright holder is reinstated (a)
|
| 417 |
+
provisionally, unless and until the copyright holder explicitly and
|
| 418 |
+
finally terminates your license, and (b) permanently, if the copyright
|
| 419 |
+
holder fails to notify you of the violation by some reasonable means
|
| 420 |
+
prior to 60 days after the cessation.
|
| 421 |
+
|
| 422 |
+
Moreover, your license from a particular copyright holder is
|
| 423 |
+
reinstated permanently if the copyright holder notifies you of the
|
| 424 |
+
violation by some reasonable means, this is the first time you have
|
| 425 |
+
received notice of violation of this License (for any work) from that
|
| 426 |
+
copyright holder, and you cure the violation prior to 30 days after
|
| 427 |
+
your receipt of the notice.
|
| 428 |
+
|
| 429 |
+
Termination of your rights under this section does not terminate the
|
| 430 |
+
licenses of parties who have received copies or rights from you under
|
| 431 |
+
this License. If your rights have been terminated and not permanently
|
| 432 |
+
reinstated, you do not qualify to receive new licenses for the same
|
| 433 |
+
material under section 10.
|
| 434 |
+
|
| 435 |
+
9. Acceptance Not Required for Having Copies.
|
| 436 |
+
|
| 437 |
+
You are not required to accept this License in order to receive or
|
| 438 |
+
run a copy of the Program. Ancillary propagation of a covered work
|
| 439 |
+
occurring solely as a consequence of using peer-to-peer transmission
|
| 440 |
+
to receive a copy likewise does not require acceptance. However,
|
| 441 |
+
nothing other than this License grants you permission to propagate or
|
| 442 |
+
modify any covered work. These actions infringe copyright if you do
|
| 443 |
+
not accept this License. Therefore, by modifying or propagating a
|
| 444 |
+
covered work, you indicate your acceptance of this License to do so.
|
| 445 |
+
|
| 446 |
+
10. Automatic Licensing of Downstream Recipients.
|
| 447 |
+
|
| 448 |
+
Each time you convey a covered work, the recipient automatically
|
| 449 |
+
receives a license from the original licensors, to run, modify and
|
| 450 |
+
propagate that work, subject to this License. You are not responsible
|
| 451 |
+
for enforcing compliance by third parties with this License.
|
| 452 |
+
|
| 453 |
+
An "entity transaction" is a transaction transferring control of an
|
| 454 |
+
organization, or substantially all assets of one, or subdividing an
|
| 455 |
+
organization, or merging organizations. If propagation of a covered
|
| 456 |
+
work results from an entity transaction, each party to that
|
| 457 |
+
transaction who receives a copy of the work also receives whatever
|
| 458 |
+
licenses to the work the party's predecessor in interest had or could
|
| 459 |
+
give under the previous paragraph, plus a right to possession of the
|
| 460 |
+
Corresponding Source of the work from the predecessor in interest, if
|
| 461 |
+
the predecessor has it or can get it with reasonable efforts.
|
| 462 |
+
|
| 463 |
+
You may not impose any further restrictions on the exercise of the
|
| 464 |
+
rights granted or affirmed under this License. For example, you may
|
| 465 |
+
not impose a license fee, royalty, or other charge for exercise of
|
| 466 |
+
rights granted under this License, and you may not initiate litigation
|
| 467 |
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
| 468 |
+
any patent claim is infringed by making, using, selling, offering for
|
| 469 |
+
sale, or importing the Program or any portion of it.
|
| 470 |
+
|
| 471 |
+
11. Patents.
|
| 472 |
+
|
| 473 |
+
A "contributor" is a copyright holder who authorizes use under this
|
| 474 |
+
License of the Program or a work on which the Program is based. The
|
| 475 |
+
work thus licensed is called the contributor's "contributor version".
|
| 476 |
+
|
| 477 |
+
A contributor's "essential patent claims" are all patent claims
|
| 478 |
+
owned or controlled by the contributor, whether already acquired or
|
| 479 |
+
hereafter acquired, that would be infringed by some manner, permitted
|
| 480 |
+
by this License, of making, using, or selling its contributor version,
|
| 481 |
+
but do not include claims that would be infringed only as a
|
| 482 |
+
consequence of further modification of the contributor version. For
|
| 483 |
+
purposes of this definition, "control" includes the right to grant
|
| 484 |
+
patent sublicenses in a manner consistent with the requirements of
|
| 485 |
+
this License.
|
| 486 |
+
|
| 487 |
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
| 488 |
+
patent license under the contributor's essential patent claims, to
|
| 489 |
+
make, use, sell, offer for sale, import and otherwise run, modify and
|
| 490 |
+
propagate the contents of its contributor version.
|
| 491 |
+
|
| 492 |
+
In the following three paragraphs, a "patent license" is any express
|
| 493 |
+
agreement or commitment, however denominated, not to enforce a patent
|
| 494 |
+
(such as an express permission to practice a patent or covenant not to
|
| 495 |
+
sue for patent infringement). To "grant" such a patent license to a
|
| 496 |
+
party means to make such an agreement or commitment not to enforce a
|
| 497 |
+
patent against the party.
|
| 498 |
+
|
| 499 |
+
If you convey a covered work, knowingly relying on a patent license,
|
| 500 |
+
and the Corresponding Source of the work is not available for anyone
|
| 501 |
+
to copy, free of charge and under the terms of this License, through a
|
| 502 |
+
publicly available network server or other readily accessible means,
|
| 503 |
+
then you must either (1) cause the Corresponding Source to be so
|
| 504 |
+
available, or (2) arrange to deprive yourself of the benefit of the
|
| 505 |
+
patent license for this particular work, or (3) arrange, in a manner
|
| 506 |
+
consistent with the requirements of this License, to extend the patent
|
| 507 |
+
license to downstream recipients. "Knowingly relying" means you have
|
| 508 |
+
actual knowledge that, but for the patent license, your conveying the
|
| 509 |
+
covered work in a country, or your recipient's use of the covered work
|
| 510 |
+
in a country, would infringe one or more identifiable patents in that
|
| 511 |
+
country that you have reason to believe are valid.
|
| 512 |
+
|
| 513 |
+
If, pursuant to or in connection with a single transaction or
|
| 514 |
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
| 515 |
+
covered work, and grant a patent license to some of the parties
|
| 516 |
+
receiving the covered work authorizing them to use, propagate, modify
|
| 517 |
+
or convey a specific copy of the covered work, then the patent license
|
| 518 |
+
you grant is automatically extended to all recipients of the covered
|
| 519 |
+
work and works based on it.
|
| 520 |
+
|
| 521 |
+
A patent license is "discriminatory" if it does not include within
|
| 522 |
+
the scope of its coverage, prohibits the exercise of, or is
|
| 523 |
+
conditioned on the non-exercise of one or more of the rights that are
|
| 524 |
+
specifically granted under this License. You may not convey a covered
|
| 525 |
+
work if you are a party to an arrangement with a third party that is
|
| 526 |
+
in the business of distributing software, under which you make payment
|
| 527 |
+
to the third party based on the extent of your activity of conveying
|
| 528 |
+
the work, and under which the third party grants, to any of the
|
| 529 |
+
parties who would receive the covered work from you, a discriminatory
|
| 530 |
+
patent license (a) in connection with copies of the covered work
|
| 531 |
+
conveyed by you (or copies made from those copies), or (b) primarily
|
| 532 |
+
for and in connection with specific products or compilations that
|
| 533 |
+
contain the covered work, unless you entered into that arrangement,
|
| 534 |
+
or that patent license was granted, prior to 28 March 2007.
|
| 535 |
+
|
| 536 |
+
Nothing in this License shall be construed as excluding or limiting
|
| 537 |
+
any implied license or other defenses to infringement that may
|
| 538 |
+
otherwise be available to you under applicable patent law.
|
| 539 |
+
|
| 540 |
+
12. No Surrender of Others' Freedom.
|
| 541 |
+
|
| 542 |
+
If conditions are imposed on you (whether by court order, agreement or
|
| 543 |
+
otherwise) that contradict the conditions of this License, they do not
|
| 544 |
+
excuse you from the conditions of this License. If you cannot convey a
|
| 545 |
+
covered work so as to satisfy simultaneously your obligations under this
|
| 546 |
+
License and any other pertinent obligations, then as a consequence you may
|
| 547 |
+
not convey it at all. For example, if you agree to terms that obligate you
|
| 548 |
+
to collect a royalty for further conveying from those to whom you convey
|
| 549 |
+
the Program, the only way you could satisfy both those terms and this
|
| 550 |
+
License would be to refrain entirely from conveying the Program.
|
| 551 |
+
|
| 552 |
+
13. Use with the GNU Affero General Public License.
|
| 553 |
+
|
| 554 |
+
Notwithstanding any other provision of this License, you have
|
| 555 |
+
permission to link or combine any covered work with a work licensed
|
| 556 |
+
under version 3 of the GNU Affero General Public License into a single
|
| 557 |
+
combined work, and to convey the resulting work. The terms of this
|
| 558 |
+
License will continue to apply to the part which is the covered work,
|
| 559 |
+
but the special requirements of the GNU Affero General Public License,
|
| 560 |
+
section 13, concerning interaction through a network will apply to the
|
| 561 |
+
combination as such.
|
| 562 |
+
|
| 563 |
+
14. Revised Versions of this License.
|
| 564 |
+
|
| 565 |
+
The Free Software Foundation may publish revised and/or new versions of
|
| 566 |
+
the GNU General Public License from time to time. Such new versions will
|
| 567 |
+
be similar in spirit to the present version, but may differ in detail to
|
| 568 |
+
address new problems or concerns.
|
| 569 |
+
|
| 570 |
+
Each version is given a distinguishing version number. If the
|
| 571 |
+
Program specifies that a certain numbered version of the GNU General
|
| 572 |
+
Public License "or any later version" applies to it, you have the
|
| 573 |
+
option of following the terms and conditions either of that numbered
|
| 574 |
+
version or of any later version published by the Free Software
|
| 575 |
+
Foundation. If the Program does not specify a version number of the
|
| 576 |
+
GNU General Public License, you may choose any version ever published
|
| 577 |
+
by the Free Software Foundation.
|
| 578 |
+
|
| 579 |
+
If the Program specifies that a proxy can decide which future
|
| 580 |
+
versions of the GNU General Public License can be used, that proxy's
|
| 581 |
+
public statement of acceptance of a version permanently authorizes you
|
| 582 |
+
to choose that version for the Program.
|
| 583 |
+
|
| 584 |
+
Later license versions may give you additional or different
|
| 585 |
+
permissions. However, no additional obligations are imposed on any
|
| 586 |
+
author or copyright holder as a result of your choosing to follow a
|
| 587 |
+
later version.
|
| 588 |
+
|
| 589 |
+
15. Disclaimer of Warranty.
|
| 590 |
+
|
| 591 |
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
| 592 |
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
| 593 |
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
| 594 |
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
| 595 |
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
| 596 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
| 597 |
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
| 598 |
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
| 599 |
+
|
| 600 |
+
16. Limitation of Liability.
|
| 601 |
+
|
| 602 |
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
| 603 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
| 604 |
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
| 605 |
+
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
| 606 |
+
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
| 607 |
+
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
| 608 |
+
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
| 609 |
+
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
| 610 |
+
SUCH DAMAGES.
|
| 611 |
+
|
| 612 |
+
17. Interpretation of Sections 15 and 16.
|
| 613 |
+
|
| 614 |
+
If the disclaimer of warranty and limitation of liability provided
|
| 615 |
+
above cannot be given local legal effect according to their terms,
|
| 616 |
+
reviewing courts shall apply local law that most closely approximates
|
| 617 |
+
an absolute waiver of all civil liability in connection with the
|
| 618 |
+
Program, unless a warranty or assumption of liability accompanies a
|
| 619 |
+
copy of the Program in return for a fee.
|
| 620 |
+
|
| 621 |
+
END OF TERMS AND CONDITIONS
|
| 622 |
+
|
| 623 |
+
How to Apply These Terms to Your New Programs
|
| 624 |
+
|
| 625 |
+
If you develop a new program, and you want it to be of the greatest
|
| 626 |
+
possible use to the public, the best way to achieve this is to make it
|
| 627 |
+
free software which everyone can redistribute and change under these terms.
|
| 628 |
+
|
| 629 |
+
To do so, attach the following notices to the program. It is safest
|
| 630 |
+
to attach them to the start of each source file to most effectively
|
| 631 |
+
state the exclusion of warranty; and each file should have at least
|
| 632 |
+
the "copyright" line and a pointer to where the full notice is found.
|
| 633 |
+
|
| 634 |
+
<one line to give the program's name and a brief idea of what it does.>
|
| 635 |
+
Copyright (C) <year> <name of author>
|
| 636 |
+
|
| 637 |
+
This program is free software: you can redistribute it and/or modify
|
| 638 |
+
it under the terms of the GNU General Public License as published by
|
| 639 |
+
the Free Software Foundation, either version 3 of the License, or
|
| 640 |
+
(at your option) any later version.
|
| 641 |
+
|
| 642 |
+
This program is distributed in the hope that it will be useful,
|
| 643 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 644 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 645 |
+
GNU General Public License for more details.
|
| 646 |
+
|
| 647 |
+
You should have received a copy of the GNU General Public License
|
| 648 |
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
| 649 |
+
|
| 650 |
+
Also add information on how to contact you by electronic and paper mail.
|
| 651 |
+
|
| 652 |
+
If the program does terminal interaction, make it output a short
|
| 653 |
+
notice like this when it starts in an interactive mode:
|
| 654 |
+
|
| 655 |
+
<program> Copyright (C) <year> <name of author>
|
| 656 |
+
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
| 657 |
+
This is free software, and you are welcome to redistribute it
|
| 658 |
+
under certain conditions; type `show c' for details.
|
| 659 |
+
|
| 660 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
| 661 |
+
parts of the General Public License. Of course, your program's commands
|
| 662 |
+
might be different; for a GUI interface, you would use an "about box".
|
| 663 |
+
|
| 664 |
+
You should also get your employer (if you work as a programmer) or school,
|
| 665 |
+
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
| 666 |
+
For more information on this, and how to apply and follow the GNU GPL, see
|
| 667 |
+
<https://www.gnu.org/licenses/>.
|
| 668 |
+
|
| 669 |
+
The GNU General Public License does not permit incorporating your program
|
| 670 |
+
into proprietary programs. If your program is a subroutine library, you
|
| 671 |
+
may consider it more useful to permit linking proprietary applications with
|
| 672 |
+
the library. If this is what you want to do, use the GNU Lesser General
|
| 673 |
+
Public License instead of this License. But first, please read
|
| 674 |
+
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
examples/binaries/byte-swap.elf
ADDED
|
Binary file (9.22 kB). View file
|
|
|
examples/binaries/factor
ADDED
|
Binary file (64 kB). View file
|
|
|
examples/binaries/float-identity.elf
ADDED
|
Binary file (9.22 kB). View file
|
|
|
examples/binaries/format-string.elf
ADDED
|
Binary file (9.41 kB). View file
|
|
|
examples/binaries/ghidra-byte-swap.elf
ADDED
|
Binary file (9.22 kB). View file
|
|
|
examples/binaries/ghidra-float-identity.elf
ADDED
|
Binary file (9.22 kB). View file
|
|
|
examples/binaries/ghidra-format-string.elf
ADDED
|
Binary file (9.41 kB). View file
|
|
|
examples/binaries/ghidra-hello-goodbye.elf
ADDED
|
Binary file (9.43 kB). View file
|
|
|
examples/binaries/ghidra-hello-world.elf
ADDED
|
Binary file (9.41 kB). View file
|
|
|
examples/binaries/ghidra-identical.elf
ADDED
|
Binary file (9.22 kB). View file
|
|
|
examples/binaries/ghidra-malloc.elf
ADDED
|
Binary file (9.32 kB). View file
|
|
|
examples/binaries/ghidra-nan-payload.elf
ADDED
|
Binary file (9.3 kB). View file
|
|
|
examples/binaries/ghidra-pointer-identity.elf
ADDED
|
Binary file (9.22 kB). View file
|
|
|
examples/binaries/ghidra-population-count.elf
ADDED
|
Binary file (9.22 kB). View file
|
|
|
examples/binaries/ghidra-sign-extension.elf
ADDED
|
Binary file (9.22 kB). View file
|
|
|
examples/binaries/ghidra-signed-zero.elf
ADDED
|
Binary file (9.22 kB). View file
|
|
|
examples/binaries/ghidra-struct-fields.elf
ADDED
|
Binary file (9.22 kB). View file
|
|
|
examples/binaries/ghidra-struct-indirect.elf
ADDED
|
Binary file (9.22 kB). View file
|
|
|
examples/binaries/ghidra-struct-padding.elf
ADDED
|
Binary file (9.22 kB). View file
|
|
|
examples/binaries/ghidra-tail-call.elf
ADDED
|
Binary file (9.32 kB). View file
|
|
|
examples/binaries/ghidra-transient-global.elf
ADDED
|
Binary file (9.42 kB). View file
|
|
|
examples/binaries/ghidra-unsigned-maximum.elf
ADDED
|
Binary file (9.22 kB). View file
|
|
|
examples/binaries/ghidra-void-memory.elf
ADDED
|
Binary file (9.33 kB). View file
|
|
|
examples/binaries/ghidra-wide-integer.elf
ADDED
|
Binary file (9.22 kB). View file
|
|
|
examples/binaries/hello-goodbye.elf
ADDED
|
Binary file (9.43 kB). View file
|
|
|
examples/binaries/hello-world.elf
ADDED
|
Binary file (9.41 kB). View file
|
|
|
examples/binaries/identical.elf
ADDED
|
Binary file (9.22 kB). View file
|
|
|
examples/binaries/malloc.elf
ADDED
|
Binary file (9.32 kB). View file
|
|
|
examples/binaries/nan-payload.elf
ADDED
|
Binary file (9.3 kB). View file
|
|
|
examples/binaries/pointer-identity.elf
ADDED
|
Binary file (9.22 kB). View file
|
|
|
examples/binaries/population-count.elf
ADDED
|
Binary file (9.22 kB). View file
|
|
|
examples/binaries/rotate-vs-shift.elf
ADDED
|
Binary file (9.22 kB). View file
|
|
|
examples/binaries/sign-extension.elf
ADDED
|
Binary file (9.22 kB). View file
|
|
|