{"id":50160708,"url":"https://github.com/tomusdrw/pvm-decompiler","last_synced_at":"2026-05-24T15:03:42.756Z","repository":{"id":343765499,"uuid":"1161744591","full_name":"tomusdrw/pvm-decompiler","owner":"tomusdrw","description":"Make PVM readable again!","archived":false,"fork":false,"pushed_at":"2026-03-11T21:27:06.000Z","size":1947,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-11T22:29:54.401Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://todr.me/pvm-decompiler/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomusdrw.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-19T13:20:23.000Z","updated_at":"2026-03-11T21:27:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tomusdrw/pvm-decompiler","commit_stats":null,"previous_names":["tomusdrw/pvm-decompiler"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/tomusdrw/pvm-decompiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomusdrw%2Fpvm-decompiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomusdrw%2Fpvm-decompiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomusdrw%2Fpvm-decompiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomusdrw%2Fpvm-decompiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomusdrw","download_url":"https://codeload.github.com/tomusdrw/pvm-decompiler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomusdrw%2Fpvm-decompiler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33438529,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-24T13:13:05.286Z","status":"ssl_error","status_checked_at":"2026-05-24T13:13:03.728Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-24T15:03:35.473Z","updated_at":"2026-05-24T15:03:42.750Z","avatar_url":"https://github.com/tomusdrw.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PVM Decompiler (`pvm-decompiler`)\n\nDecompiler for PVM (Polkadot Virtual Machine) bytecode that emits structured, readable pseudo-code.\n\n## Disclaimer\n\nThis project is heavily vibe-coded. Here be dragons.\n\n## Status\n\nThis project is under active development and output is best-effort. It is useful for reverse engineering and inspection, but generated pseudo-code is not guaranteed to be source-equivalent for every binary.\n\n## Documentation\n\nCanonical documentation lives in the mdBook:\n\n- https://todr.me/pvm-decompiler/\n\nUse the book for quick start, worked examples, and backend comparisons. This README is intentionally brief to avoid duplicating that content.\n\nBuild docs locally:\n\n```bash\nmdbook build\nmdbook serve -p 3000\n```\n\n## Features\n\n- Decodes SPI and raw ProgramBlob PVM binaries\n- Builds CFGs and detects function boundaries\n- Runs dataflow/liveness and expression lifting\n- Recovers high-level structures (`if/else`, loops, `switch` where possible)\n- Infers typed variable names (`u32`, `i64`, `ptr`, `bool`)\n- Resolves many direct and indirect call patterns\n- Emits progress to stderr for long-running decompiles\n\n## Install\n\n### From source\n\n```bash\ncargo build --release\n./target/release/pvm-decompiler --help\n```\n\n### Local developer install\n\n```bash\ncargo install --path .\n```\n\n## Usage\n\n```bash\n# Default pseudo-code output\npvm-decompiler path/to/program.pvm\n\n# Full LLVM pipeline: PVM -\u003e LLVM IR -\u003e C\npvm-decompiler --decompile path/to/program.pvm\n\n# Optional LLM refinement (requires OPENROUTER_API_KEY)\npvm-decompiler --decompile --refine path/to/program.pvm\n```\n\nRun `pvm-decompiler --help` for full CLI options.\n\n## Input Support\n\nThe decompiler accepts:\n\n- SPI-wrapped PVM binaries\n- raw ProgramBlob binaries\n- binaries with a metadata prefix (auto-stripped before decode)\n\n## Development\n\nPrerequisite: stable Rust (edition 2024; MSRV in `Cargo.toml`).\n\n```bash\n# Format + lint + tests\ncargo fmt -- --check\ncargo clippy -- -D warnings\ncargo test\n\n# Refresh fixtures and quality checks\n./run_examples.sh\n./scripts/check_output_quality.sh\n```\n\nOptional local hook setup:\n\n```bash\ngit config core.hooksPath .githooks\n```\n\n## Repository Docs\n\n- `ROADMAP.md`: project roadmap and milestones\n- `docs/output-baseline.md`: output quality baseline metrics\n- `docs/release-checklist.md`: pre-release verification checklist\n- `CONTRIBUTING.md`: contributor workflow and expectations\n- `CHANGELOG.md`: release and change history\n\n## Related Projects\n\n- [wasm-pvm](https://github.com/tomusdrw/wasm-pvm) — WASM to PVM compiler\n- [anan-as](https://github.com/tomusdrw/anan-as) — AssemblyScript interpreter for PVM\n- [PVM Debugger](https://github.com/fluffylabs/pvm-debugger) ([live](https://pvm.fluffylabs.dev)) — PVM debugger from FluffyLabs\n\n## Community\n\n- Code of Conduct: `CODE_OF_CONDUCT.md`\n- Contribution guide: `CONTRIBUTING.md`\n\n## License\n\nLicensed under the MIT license. See `LICENSE`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomusdrw%2Fpvm-decompiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomusdrw%2Fpvm-decompiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomusdrw%2Fpvm-decompiler/lists"}