How to Clone Software With AI, and When You Shouldn't

This month brought headlines about AI agents rebuilding big commercial apps from scratch. Dave Plummer, who wrote the original Windows Task Manager at Microsoft, wanted to see how it really works, so he ran the experiment on a program he knows inside out: Windows Calculator. He gave an AI agent the compiled program, no source code, and asked for an equivalent app written fresh in Rust. It worked, mostly. This page walks through AI software cloning step by step as he did it, what the result does and doesn't prove, and the line he draws between building from your own design and copying someone else's. For agencies and businesses, the useful part is less "clone a rival" and more "rebuild the old tools you own".

AI software cloning: an AI rebuilt Windows Calculator from the binary alone. Dave Plummer's eight-step experiment, and the line he draws between your spec and someone else's app. Not legal advice.

AI software cloning: what he tested

What he did
Target Windows Calculator (MIT licensed by Microsoft in 2019)
Input The executable and its DLLs only, no source or symbols
Tools An AI coding agent plus Ghidra, the NSA's open-source reverse engineering framework
Output A new Rust app called aicalc.exe, plus a large test suite
Result A working reconstruction, not a proven perfect copy

Why we start every build from a spec

I've built, scaled, and sold three companies, generated over $85 million in the last seven years in my own companies. The tools that lasted were the ones we designed on purpose, with the decisions written down before anyone built. That is also the cleanest legal route, and Plummer took it for his own app with a 107-page spec.

Evidence Source
10,195 functions recovered from the calculator engine Ghidra, in his run
Ideas and methods of operation are not protected by copyright 17 U.S.C. 102(b)
Windows Calculator open-sourced under MIT Microsoft, GitHub, March 2019

How to clone software with AI, step by step

Step 1: Pick a target you're allowed to study

He picked Calculator for two reasons: Microsoft published it under the MIT license, and he once ran the team that owned it. It's also deceptively deep. His on-screen menu lists the modes exactly as Calculator names them: Standard, Scientific, Graphing, Programmer and Date calculation, plus converters for Currency, Volume, Length, Weight and mass, Temperature, Energy and Area. Out loud he adds several number bases and arbitrary precision math. Many of its odd behaviors can't be guessed by clicking around, so an exact match would show the agent actually read the program.

Step 2: Give the agent the binary and a mission

The agent got the executable and its libraries, nothing else. Here is his prompt as typed on screen at about 6:56 (typos cleaned up), so you can see what a real working prompt looks like:

OK, your mission is to rewrite calc.exe in Rust, which we are going to do by decompiling the binary to the intermediate format of your choosing, then translating the logic completely and accurately to Rust, then compiling that Rust code to produce a new binary called aicalc.exe that should be functionally equivalent to the original calc.exe which was likely authored in C. So this is a C to Rust translation project without access to the source code.

I want you to iterate on the project until all of your tests pass, and the resulting binary executes and operates in the same way as the original calc, looks pixel perfect, etc.

The agent then found that calc.exe is only a launcher and asked, on screen: "The supplied calc.exe only launches the installed Calculator app. Which translation target do you want?" The two options were "Rewrite the actual Calculator app in Rust by analyzing its installed binaries" (marked Recommended) and "Translate only the supplied calc.exe launcher faithfully into Rust". He chose the first, the full application with its DLLs.

Step 3: Decompile with Ghidra

His diagram, titled "Reverse engineering", runs left to right: Original executable (.EXE), Operations analysis (LOAD, ADD, BRANCH), Reconstructed Rust (.rs), New executable (.EXE). Ghidra handles the analysis step. It turns machine code into C-like pseudocode and can't recover the original names or comments, so it guesses. Under the hood it converts each processor instruction into P-code, a small set of simple operations such as load, add, store and branch. The agent's own progress note on screen reads: "Ghidra has also finished the main UI DLL export, recovering 18,959 functions with no decompilation failures." Out loud he gives 10,195 functions for the engine library.

Step 4: Translate the state machine, not the text

The real work is following decisions. His "Calculator state transitions" diagram has four states: Entering first number (digit: append), Operator pending (operator stored), Entering second number (operator stored, digit: append) and Result displayed. An operator moves you from the first number to Operator pending, a digit starts the second number, equals shows the result, and a digit after that starts a fresh calculation. The agent rewrites those decisions in Rust: a memory read might turn into a struct field, and a knot of branches might become a single match. The code looks different and behaves the same, or close to it.

Step 5: Rebuild the interface too

Math is only half an app. His "Interface + Engine" diagram splits the original executable into Resources (Dialog layouts, Strings, Icons), Imports (references to a .DLL, other components) and Program code. The reconstruction has to rebuild both halves: the Interface and the Calculation engine. A believable rebuild gets keyboard shortcuts and the clear button right, not just addition. Anyone can lay out buttons; the years of decisions behind them are what's hard.

Step 6: Test it against the original

The agent built a harness that talks to the original engine directly. Its notes on screen, word for word: tests "cover 131,077 command classifications and 8,201 dispatch cases"; "The engine harness now works: it runs the original DLL's arithmetic engine directly and returns the display after each command. It confirms 2 + 3 = 5 without opening the UI."; and "The current standard-mode suite passes: 357 command sequences and 8,032 intermediate displays match the original engine." It found and fixed its own mistakes along the way, including differences in percent, memory recall after errors and decimal formatting. Plummer reads that as a warning sign: if it had to repair its reading of the code, it was filling gaps, and some gaps may still be wrong.

Step 7: Call it a reconstruction

His test (123 + 456) came out right, and the suite runs tens of thousands of calculations. Still, he won't call it perfect, and the agent says so too: "I'm adding a runnable aicalc.exe; the other modes and pixel comparison remain unfinished." His "What compilation can discard" diagram shows why a binary can't give you the original back. Names + comments "may disappear" into machine instructions; separate functions (caller() calls helper()) "can inline" into one combined body; and different expressions (x + x and x * 2) "can converge" into the same instructions. He also can't rule out that the model saw Calculator's public source during training.

Step 8: Decide the route: your spec, or their binary

This is where his view turns. His closing diagram, "Two routes to an application", puts it plainly. Route one runs "My requirements", "Generated code", "Compiled application", labeled "AI implements my design". Route two runs "Existing binary", "Binary analysis", "Replacement application", labeled "Clone derived from original". Writing new source isn't the same as writing an independent program, because translating a binary's analysis into Rust doesn't change its origin. US copyright law leaves ideas and methods of operation open, and courts have allowed disassembly to reach functional parts for compatibility, but that's narrow. His line: start from your own requirements, or get permission and label the result a clone. More on the law in our post on whether reverse engineering is legal.

Where AI software cloning actually helps a business

Most companies don't need to copy a rival. They need to keep their own old software alive. Three good uses:

  • Recover a tool you own when the source is lost or the developer has gone.
  • Move an old internal app to a modern language you can maintain, with the vendor's permission if it isn't yours.
  • Write the spec first for anything new, the way Plummer did for his own app, then let AI build to it. Some call this spec driven development.

The same method gets ugly fast when the owner of the original is treated as an obstacle. Big apps also depend on libraries, file formats and plugins that don't port cleanly, so a Photoshop-sized rebuild is a different problem altogether.

Worked example: an agency's old reporting tool

A 15-person agency still runs a Windows reporting app a contractor built in 2014. The source is lost; the agency owns the program.

  1. Target: they confirm in the contract that the agency owns the app.
  2. Mission: an agent gets the executable and a prompt like his, asking for a web version with the same calculations.
  3. Decompile: Ghidra recovers the functions behind the client fee math.
  4. State machine: the agent maps how a report moves from draft to approved to sent.
  5. Interface: the team lists every screen and export the account managers use.
  6. Test: last year's 300 reports run through both versions and are compared line by line.
  7. Reconstruction: four mismatches turn up in rounding; each is fixed and checked by hand.
  8. Route: a short spec is written from what they learned, and every new feature is built from the spec, not the old binary.

Want an old tool you own rebuilt, or a new one built from a spec?

We document what your current tool does, write a plain spec your team approves, and have AI build and test the new version against your real data. You confirm ownership or permission first, you sign off on the spec before any code is written, and you keep all of it. Why now: AI has made rebuilding old internal tools cheap enough to do this quarter instead of someday.

What you get Where
A spec, a rebuilt tool and a comparison test against your data AI automation

Free tools

One free, MIT-licensed skill for Claude, Codex and Grok comes with this guide: Clean Room Check (runs the four questions before you point AI at a program and names your route; writes a spec and holds back anything taken from the original's code; checks a state machine for gaps; compares the original and the rebuild case by case; and checks a clean room team). Download the skill (free zip)

FAQ

Can AI clone any app?

It can attempt small ones from the compiled program. Large apps with many libraries and file formats are much harder, and the result needs heavy testing.

Is the AI-written code new?

The text is new. Whether the program is independent work is a separate question, because it came from analyzing the original.

What is Ghidra?

A free reverse engineering framework from the NSA that turns machine code into readable pseudocode.

Is this legal advice?

No. Talk to a lawyer before rebuilding software you don't own.

Sources

What would you rebuild first if the old code were gone?

Book a call and we'll scope a spec for the tool your team can't live without.

Book a Search Strategy Call