---
title: "我使用 REA 複製了 OpenAI 的 Codex"
url: "https://reamcp.dev/zh-tw/cases/i-used-rea-to-clone-openai-s-codex-925c9e"
source: "https://www.youtube.com/watch?v=pX8Sy8Rd44U"
source_type: "youtube"
author: "SoftsWeb"
author_handle: "softsweb"
stars: 0
category: "應用功能重現"
categories: ["app-recreation"]
tags: ["agentic-reverse-engineering", "cli", "codex", "ghidra", "open-source", "rea"]
added: "2026-10-16T02:16:00.497Z"
updated: "2026-10-15T10:19:44.000Z"
locale: "zh-tw"
content_locale: "zh-tw"
---

# 我使用 REA 複製了 OpenAI 的 Codex

一個影片示範，作者只給 Claude Code 提供 OpenAI 開源 Codex 的已安裝檔案（無原始碼），並讓它用 Python 重建非互動式 CLI 引擎，使 REA 和 Ghidra 成為必需工具。得到的複製品通過了 416/422 個隱藏檢查（98.6%），並附有測試套件、REA 和 Codex 儲存庫連結。

## Description

作者展示了一個逆向工程工作流程：掃描已安裝的 Codex 檔案，讓真實的 Codex 回應，定義隱藏測試，然後讓 Claude Code 用 Python 重建程式，首先不使用、然後強制使用 REA 和 Ghidra。指出 Codex 是 Apache-2.0 開源軟體，僅使用虛假 AI 伺服器重現了非互動式 codex exec 模式，並且對 294 MB 二進位檔的完整 Ghidra 分析逾時，因此僅用 REA 開啟了一個切出的 15 MB 片段。提供了隱藏測試套件儲存庫和 REA GitHub 專案的連結。

## Original README

I Used REA to Clone OpenAI's Codex

I gave Claude Code only the files that OpenAI's Codex installs on a computer, with no source code at all, and asked it to rebuild the program in Python while a hidden test I wrote beforehand decided if the copy was good enough. REA, the open source reverse engineering tool, is the one it was supposed to use.

The first copy scored 99% on my easy test and only 75.4% on a much harder one, so I made REA and Ghidra mandatory. The second copy passed 416 of 422 checks (98.6%) and the whole AI bill for both rounds was about $16.80. Everything on screen is replayed from the real logs and results.

0:00 Two terminals, one secret
1:08 The one rule that makes it fair
1:44 Step 1: what is inside the file
2:29 Step 2: making the real Codex talk
3:31 Step 3: the hidden test
4:12 Step 4: the first copy
4:50 Step 5: a much harder test
5:32 Step 6: Ghidra and REA get their turn
6:43 The verdict
7:40 What this really means

Links
Test kit from this video (the hidden test, the fake AI server and the AI's notes): https://github.com/softsweb/codex-clone-hidden-test-kit
REA on GitHub: https://github.com/morluto/rea
Codex on GitHub (open source, Apache-2.0): https://github.com/openai/codex

Notes and honesty
- Codex is open source (Apache-2.0), that is why I picked it. I did not do this to Cursor or Claude Code because their terms forbid it.
- I only copied Codex's non-interactive mode (codex exec). The copy has no screen and no model, it is only the engine, and I used a fake AI server so the test cost nothing.
- Not tested: the real sandbox (it does not start on my computer), the interactive screen, resume and review commands, and a real model.
- The full Ghidra analysis of the 294 MB program never finished (every call timed out after 330 seconds), so I show exactly which parts worked: a carved 15 MB piece of the file that REA could open.
- Remaining misses (6 checks of 422): the real program rejects a tiny image that the copy accepts, the copy does not count tokens used by a goal, it lacks the codex-path folder in PATH, and it does not print the applied patch.
- Only analyze software you are allowed to test. I am not a lawyer and this is not legal advice.
- This video is not sponsored.

#REA #Codex #ClaudeCode #ReverseEngineering #OpenSource
