REAを使ってOpenAIのCodexをクローンした
著者がOpenAIのオープンソースCodexのインストール済みファイルのみ(ソースなし)をClaude Codeに与え、非対話型CLIエンジンをPythonで再構築させるビデオデモ。REAとGhidraを必須ツールとする。得られたクローンは416/422の隠しチェック(98.6%)に合格し、テストキット、REA、Codexリポジトリのリンクが含まれる。
この事例について
著者はリバースエンジニアリングのワークフローを示す:インストール済みのCodexファイルをスキャンし、本物のCodexを応答させ、隠しテストを定義し、Claude CodeにPythonでプログラムを再構築させる。最初はREAとGhidraなしで、次にそれらを必須として行う。CodexはApache-2.0オープンソースであり、偽のAIサーバーを使用して非対話型のcodex execモードのみを再現したこと、294 MBのバイナリの完全なGhidra分析はタイムアウトしたため、切り出した15 MBの部分のみをREAで開いたことを注記する。隠しテストキットリポジトリとREA GitHubプロジェクトへのリンクが提供される。
セットアップ
インストール方法は元のソースをご確認ください。
原文 / 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


