# GoonFi V2: byte-identical Rust recompilation of a Solana program

> OtterSec researchers describe an agent pipeline that reconstructed Rust source for the closed-source GoonFi V2 Solana program until a rebuild with the original toolchain reproduced the deployed ELF. Per-function instruction scoring, a deterministic merge judge and bans on assembly and other score-gaming constructs steered the agents; matching function order and panic-location paths closed the last differences. The article and a companion repository document the method and a verification script, while the internal tooling and agent transcripts remain unpublished.

- Type: Case study
- Targets: Binary
- Category: Independent reconstruction cases
- Relationship: Independent reconstruction project
- Sources reviewed: 2026-10-18
- Added to the catalog: 2026-11-09
- Original resource: <https://osec.io/blog/goonfi-decompilation/>
- Catalog page: <https://awesomerea.org/resources/goonfi-v2-rust-recompilation-case/>
- Record JSON: <https://awesomerea.org/resources/goonfi-v2-rust-recompilation-case/record.json>
- Chinese version: [简体中文](https://awesomerea.org/zh/resources/goonfi-v2-rust-recompilation-case/index.md)

## Requirements & limits

- The target is GoonFi V2 as deployed at slot 448984043; the live program was upgraded on 2026-10-06, so verification uses the earlier ELF.
- The reconstruction uses the deployed binary, program IDL and on-chain transactions. The core agent harness, merge judge and transcripts are unpublished.
- build.sh requires Linux x86-64 and downloads Solana platform-tools v1.48 (rustc 1.84.1-dev, LLVM 19.1.7). VERIFY.sh needs an Alchemy archive key or another archival RPC to recover the original ELF from deploy-transaction writes and compare it byte for byte.
- The companion repository names no license for its reconstructed source; rights to the original closed-source program remain with its owner.

## Primary sources

1. <https://osec.io/blog/goonfi-decompilation/>
2. <https://github.com/renato-osec/goonfi-v2-decompiled/blob/381cc31945474ba6b5b56b32a8cad5266602d612/README.md>
3. <https://github.com/renato-osec/goonfi-v2-decompiled/blob/381cc31945474ba6b5b56b32a8cad5266602d612/build.sh>
4. <https://github.com/renato-osec/goonfi-v2-decompiled/blob/381cc31945474ba6b5b56b32a8cad5266602d612/VERIFY.sh>
5. <https://github.com/renato-osec/goonfi-v2-decompiled/blob/381cc31945474ba6b5b56b32a8cad5266602d612/verify_onchain.py>
6. <https://github.com/renato-osec/goonfi-v2-decompiled/blob/381cc31945474ba6b5b56b32a8cad5266602d612/Cargo.toml>
7. <https://x.com/pashov/status/2111066785890054605>

## More in Native binaries

- [HyperCard 1.2.2: a static recompilation of the classic Mac app](https://awesomerea.org/resources/hypercard-122-recomp-case/index.md) · Case study
- [openbst: a C reimplementation of BeSTspeech](https://awesomerea.org/resources/openbst-bestspeech-case/index.md) · Case study
- [OpenTV: a portable C rebuild of Centigram TruVoice](https://awesomerea.org/resources/opentv-truvoice-case/index.md) · Case study
- [L&H TruVoice: a portable C rebuild of tv_enua.dll](https://awesomerea.org/resources/lh-truvoice-decomp-case/index.md) · Case study
- [Microsoft Anna: a bit-exact C rebuild of the TTS20 engine](https://awesomerea.org/resources/ms-anna-tts-case/index.md) · Case study
- [OneCore TTS: a C rebuild of David, Zira and Mark](https://awesomerea.org/resources/onecore-david-zira-mark-case/index.md) · Case study

## About this entry

The description was reviewed against primary sources.
Original editorial content: MIT. Linked projects, papers and assets retain their own rights and licenses.
