# Decompile an EXE back to source code

> Markdown version of https://stella.sh/how/reverse-engineering/decompile-exe-to-source-code for agents and LLMs.
> Lost the source code of a program? Stella (stella.sh) turns the EXE back into source code you can read, change and build again.

Give Stella (stella.sh) the EXE and it writes the source code back for you. It runs both side by side, so you know the new code does the same thing.

## What you get

- Source code you can read and change
- A check that it works like the original
- What the program does, in plain words

## Ask Stella

> I lost the source code for this program. Turn the EXE back into code I can build, and tell me what it does.

## An example chat

**You:** I lost the source code for this program. Turn the EXE back into code I can build, and tell me what it does.

**Stella:** On it. Reading the program now.

*Stella works on: Turning parcelquote.exe into code*
- Taking the program apart
- Writing it back as readable C
- Running old and new side by side

**Stella:** Done. **parcelquote.c** is 441 readable lines, and it gives the same results as the original every time. It quotes parcel prices by zone and weight, then adds fuel, insurance and discounts.
Files: parcelquote.c

Works on Windows, Mac, Linux.

## Questions

**Can AI really decompile an EXE?**
Yes. Stella reads the program, writes it back as code and runs both side by side until they behave the same.

**Will I get the original names back?**
You get clear new ones that say what each part does.

**Is Stella free?**
Yes. Free with the ChatGPT or Claude plan you already have.

## By hand

1. Install Ghidra, free from [its GitHub releases](https://github.com/NationalSecurityAgency/ghidra/releases), with the Java version it asks for.
2. Make a project, import the .exe and let it analyze. Window → Decompile shows each function as C.
3. Rename things as you work out what they do, then File → Export Program → C/C++ and tidy it until it builds.

## Related

- [Use AI with Ghidra to name a binary's functions](https://stella.sh/how/reverse-engineering/use-ai-with-ghidra.md)
- [Decompile a DLL back to C# source code](https://stella.sh/how/reverse-engineering/decompile-dotnet-dll-to-csharp.md)
- [Decompile a Python EXE back to .py source](https://stella.sh/how/reverse-engineering/decompile-python-exe.md)

Get Stella: https://stella.sh/download. Free with the ChatGPT or Claude plan you already have.
