Spaces:
Sleeping

decompilai / README.md
ejschwartz's picture
Build DecompilAI Gradio Space
f51c192
|
Raw History Blame Contribute Delete
2.1 kB
---
title: DecompilAI
emoji: 🔍
colorFrom: indigo
colorTo: blue
sdk: docker
app_port: 7860
fullWidth: true
---
# DecompilAI
Select an example, inspect the original and candidate C, then click **Check behavior**. DecompilAI compares the functions on 2,000 generated inputs with seed 1. When it finds a difference, the result shows a counterexample and what each function did. The JSON report contains the full checker output. Agreement covers the valid inputs tried.
The clamp examples come from [DecompilAI](https://github.com/Shreyas652/DecompilAI), pinned at `69cba22981778b46ee672f550eb6a8bbaaae9213`. Rotate versus shift, population count, `upper`, and `my_putchar_count` are standalone C adaptations of cases from [Decompiler verifier](https://huggingface.co/spaces/ejschwartz/decompile-verify). The last two exercise in-place buffer writes and standard output, respectively.
## Run the workbench locally
```sh
docker build --platform linux/amd64 -t decompilai-space .
docker run --rm --platform linux/amd64 -p 127.0.0.1:7860:7860 decompilai-space
```
Open <http://127.0.0.1:7860>. The same Dockerfile runs on Hugging Face CPU hardware without secrets.
If a local TLS proxy intercepts GitHub and the build fails certificate verification, add `--secret id=git_ca,src=/path/to/your/trusted-ca-bundle.pem` to the build command.
## Check your own C locally
Put `orig.c` and `cand.c` in a dedicated `inputs` directory. Define the same function name and signature in both files. DecompilAI compiles and executes both inputs, so run the checker in a separate container with networking disabled and mount only the inputs. [Upstream security guidance](https://github.com/Shreyas652/DecompilAI/blob/main/SECURITY.md)
```sh
docker run --rm --platform linux/amd64 --network none \
--mount "type=bind,source=$PWD/inputs,target=/data,readonly" \
decompilai-space python -m decompilai.check \
--orig /data/orig.c --cand /data/cand.c --func func0
```
See [DecompilAI usage](https://github.com/Shreyas652/DecompilAI/blob/main/docs/USAGE.md) for supported types, options, and result fields.