{"id":19526339,"url":"https://github.com/philzook58/pcode2c","last_synced_at":"2025-04-26T10:31:12.673Z","repository":{"id":213635849,"uuid":"730756918","full_name":"philzook58/pcode2c","owner":"philzook58","description":"Convert low ghidra pcode to verifiable C","archived":false,"fork":false,"pushed_at":"2024-09-13T18:17:00.000Z","size":1667,"stargazers_count":21,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-04T11:36:45.303Z","etag":null,"topics":["binary-analysis","c","ghidra","verification"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/philzook58.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-12T15:54:02.000Z","updated_at":"2025-03-11T07:41:28.000Z","dependencies_parsed_at":"2023-12-22T04:26:26.638Z","dependency_job_id":"227ef156-b464-4f26-bc54-12862e68e968","html_url":"https://github.com/philzook58/pcode2c","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"da535b0623fd7db1d28c79f563e4a742bcab2a6f"},"previous_names":["philzook58/pcode2c"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philzook58%2Fpcode2c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philzook58%2Fpcode2c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philzook58%2Fpcode2c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philzook58%2Fpcode2c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/philzook58","download_url":"https://codeload.github.com/philzook58/pcode2c/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250972723,"owners_count":21516414,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["binary-analysis","c","ghidra","verification"],"created_at":"2024-11-11T01:09:35.210Z","updated_at":"2025-04-26T10:31:12.071Z","avatar_url":"https://github.com/philzook58.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pcode2c\n\nWIP: Do not expect this to work for you yet.\n\npcode2c is a Ghidra translator script from low pcode to a [specialized C interpreter](https://www.gtoal.com/sbt/) for the purposes of running the resulting code through off the shelf verifiers (for example [CBMC](https://github.com/diffblue/cbmc)). The resulting C has a direct mapping to the underlying assembly.\n\nC is a useful intermediate because it enables using powerful off the shelf verifiers and can be directly compared (with a little muscle grease) against decompilaton or source.\n\nThis enables soundly answering questions about the relationship between high level source and binary in a relatively easy manner that no other method I know of can do.\n\nBlog posts:\n- [PCode2C: Steps Towards Translation Validation with Ghidra and CBMC](https://www.philipzucker.com/pcode2c/)\n- [DWARF Verification via Ghidra and CBMC](https://www.philipzucker.com/pcode2c-dwarf/)\n## Installation\n\n```bash\npython3 -m pip install -e .\n```\n\n## Usage\n\n```bash\npython3 -m pcode2c ./examples/min/mymin.o \u003e tmp.c\ngcc -I _templates -c tmp.c \n```\n\n## Ghidra Plugin Installation\n\n- Open up Ghidra on a binary\n- Click on `Window \u003e Script Manager` in the toolbar\n- Manage Script Directories button in top right of Script Manager window (looks like a checklist)\n- Find the `./scripts` directory and add it\n- Click Refresh Script List in script manager\n- There is now a PCode2C folder in the script manager. Go to it and click\n\n## Example\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilzook58%2Fpcode2c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilzook58%2Fpcode2c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilzook58%2Fpcode2c/lists"}