# Civ 1 period accurate decompilation

I've used LLMs to decompile Civ 1 and put the reconstructed C source on GitHub, along with a technical book and story. The reconstructed source builds with what i'm pretty sure is the original Microsoft C compiler and toolchain. It produces a byte-for-byte match with the original executable, aside…

- **Page:** https://magpie.gallery/i/civ-1-period-accurate-decompilation-cacs
- **Type:** Link to an idea elsewhere
- **Category:** Games
- **Tags:** decompilation, civilization, retro, source-code, llm

## Source

Web · crc32: Civ 1 period accurate decompilation

- **Original:** https://news.ycombinator.com/item?id=50163253

> I've used LLMs to decompile Civ 1 and put the reconstructed C source on GitHub, along with a technical book and story. The reconstructed source builds with what i'm pretty sure is the original Microsoft C compiler and toolchain. It produces a byte-for-byte match with the original executable, aside from a four-byte correction for what appears to be a patch applied after linking. So it should be pretty close to how the original game was made; although it can't be said that this is the "original source code". I've also used that source to create a modern build of the game, in the `reciv` repository. Like most people, I'm in two minds about the benefits and downsides of LLMs. This work also builds on OpenCiv1, which probably deserves most of the credit - not only did I direct the LLM to use that work; but it was almost certainly in the training data. Qualms aside - I couldn't resist having a look inside one of my all-time favourite games. There's a few attempts at Civ 1 including recent LLM ones. But i'm not aware of any that publicise the resulting source code. https://github.com/sjmelia/civd

## GitHub projects

- https://github.com/sjmelia/civd

## Rules for reuse

- Build your own version: don't copy another product's code, look, icons, colours or copy.
- The original belongs to its author; Magpie only links to it.
- The original content's copyright belongs to its creator. Magpie doesn't download or re-upload it; we only show the link and the official preview.
