[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-107574":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":14,"forks30d":14,"starsTrendScore":18,"compositeScore":19,"rankGlobal":8,"rankLanguage":8,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":8,"pushedAt":24,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":14,"starSnapshotCount":14,"syncStatus":28,"lastSyncTime":29,"discoverSource":30},107574,"fnv_decomp","momusdigital\u002Ffnv_decomp","momusdigital",null,"C++",580,111,15,5,0,10,84,390,62,97.14,"Other",false,"main",[],"2026-11-19 04:14:56","2026-11-23 14:14:19","# FNV decompilation\n\nThe decompilation of FNV, the Steam release for PC (version 1.4.0.525): C++ source code rebuilt function by function\nfrom the game's executable. Built with the compilers the game was built with, every function listed in\n`build\u002Funits.json` compiles to the same bytes as the original.\n\nThe project was spearheaded on [fnvdecomp.com](https:\u002F\u002Ffnvdecomp.com), where a frozen version of the community\nproject stays online.\n\n- **What it is for.** The modding community has kept working on FNV for more than a decade. This repository is meant\n  for that community: for research, modding and game preservation, and only those purposes.\n- **Source code only.** It contains no game files, no assets, no executables and nothing you can play, and nothing\n  of the game is distributed here.\n- **You need the game.** To use any of this you need to own the Steam version of FNV (1.4.0.525).\n- **Trademarks** belong to their holders, listed under [Legal](#legal). This project is not affiliated with or\n  endorsed by any of them.\n\n## Contributing\n\nPull requests are welcome from anyone. Most of what is left is readability: many functions still have placeholder\nnames (`FUN_00xxxxxx`), vague names or no comment, and all of that can be improved without changing a single byte of\nthe output.\n\n### The automatic check\n\nEvery pull request gets an automatic check, called `match`. It runs on GitHub's machines, involves no part of the\ngame, and has to pass before a pull request can be merged:\n\n1. It finds the translation units your change can affect: the files you changed and every unit that includes them.\n2. It builds each of those units twice, from `main` and with your change, with the Microsoft compilers the game was\n   built with.\n3. Every function has to come out identical: the same code bytes, and every call and data reference resolving to\n   the same original address through `build\u002Funits.json`, exception-handling code included. `main` matches the game\n   byte for byte, so a change that passes still does.\n\nWhat to expect:\n\n- **Passes:** renaming functions, parameters, variables, types and fields; adding or improving comments;\n  reformatting. A change only to comments, spacing or blank lines passes without a build.\n- **Fails:** anything that changes what a function compiles to. The check lists the functions that differ by\n  address; see what differs with your own copy of the game:\n  `python3 tools\u002Fbuild_and_match.py --image \u003Cyour FalloutNV.exe> --only \u003Cunit>`.\n- **Needs a maintainer:** changes outside `src\u002F`, `include\u002F`, the names in `build\u002Funits.json` and Markdown files\n  (the tools, the rest of the build recipe, the workflow). The check fails on these; open an issue instead. Changes\n  to the tools and the workflow are made by the repository owner and verified against the game.\n\n### Review and merging\n\nA pull request is merged when the check passes and two reviewers have approved it:\n\n- Nobody can skip the check, the repository owner included.\n- Two approvals are needed. An approval is dropped when new commits arrive, and the last push has to be approved by\n  someone other than the person who made it.\n- The pull request has to be up to date with `main`. If `main` moves first, use \"Update branch\" and the check runs\n  again on the combined code.\n\nAfter every change to `main`, the whole of `main` is also built against the game's executable on the project's own\nmachine. That build proves `main` still matches the game byte for byte, not only that it compiles the same as\nbefore.\n\n### Renaming a function\n\n`build\u002Funits.json` lists every function by its original address and its decorated (mangled) name. When you rename a\nfunction, put its new decorated name at the same address, in every unit that lists it; otherwise the check reports\nthe old name as unbound. Adding a declaration or a string literal can renumber the compiler's string labels\n(`$SG...`) that `build\u002Funits.json` names; the check says so when that is the cause.\n\nA unit may also give an address it refers to a further name, as long as `build\u002Funits.json` already has that address.\nIdentical code that the linker folded has one address and several names, for example one template instantiated for\nseveral types. An address that `build\u002Funits.json` does not have yet needs a maintainer. Exception-handling code\nresolves names through the whole of `build\u002Funits.json`, so when a pull request changes any names there, the check\nalso rebuilds every unit with exception-handling code. That adds a few minutes.\n\n### Never include any part of the game\n\nNo executable, no bytes copied from it, no object files built from this code, no game data. A pull request that\ncontains any of it is closed.\n\n### Running the check yourself\n\nWith the compilers set up (see \"What you need\"), commit your change, then compare it with `main`:\n\n    git fetch origin\n    git worktree add --detach ..\u002Ffnv-main origin\u002Fmain      # main, to compare against\n    git worktree add --detach ..\u002Ffnv-scratch HEAD          # a scratch checkout the check builds in\n    python3 tools\u002Fcompare_builds.py plan ..\u002Ffnv-main . --out ..\u002Fplan.json --max-shards 1\n    python3 tools\u002Fcompare_builds.py shard ..\u002Ffnv-scratch \"$(git rev-parse origin\u002Fmain)\" \"$(git rev-parse HEAD)\" \\\n        --plan ..\u002Fplan.json --shard 0 --out ..\u002Fresult.json\n    python3 tools\u002Fcompare_builds.py report --plan ..\u002Fplan.json ..\u002Fresult.json\n\nWhen `plan` reports no units to build, skip `shard` and run `report` without `..\u002Fresult.json`.\n\n## Status\n\n- Functions in scope: 70,611 of 70,611 match byte for byte.\n- Bytes in scope: 11,537,067 of 11,537,067.\n\n\"In scope\" leaves out code the compiler and linker generate on their own (runtime stubs, thunks, padding) and a small\nlist of entries in the executable that are not functions.\n\n## What this is, and what it is not\n\n- It is a reference: readable C++ that shows how the game works, and that reproduces the original machine code.\n- It is not a port, a source port or a replacement executable. Building it gives you object files to compare, not a\n  game.\n- It does not contain, and will not accept, tools or instructions for getting around the game's copy protection.\n- It does not contain any part of the game's executable or data files. Addresses, function sizes and a few SHA-256\n  fingerprints are the only facts about the executable in this repository.\n\n## Names and comments\n\nThe function comments were written by machine: Qwen 27B proposed them from the matched code, and Codex Luna and\nClaude Sonnet reviewed them. The text is kept as reviewed. Many function, parameter and variable names were proposed by\nmachine as well. Every such change was rebuilt and compared, so none of it changes a single byte of the output. The comments describe\nwhat the code appears to do and can be wrong; the machine code is the authority. Corrections are welcome.\n\n## What you need\n\n1. **The game.** A legally owned copy of FNV for PC, version 1.4.0.525 (on Steam, app 22380, base game\n   or Ultimate Edition).\n2. **The plain executable of that version, from your own copy.** The comparison reads the original machine code. The\n   Steam file as installed does not work: its code is encrypted on disk. This repository does not supply the\n   executable, any part of it, or any way to produce it. Never share yours.\n3. **Python 3.10 or newer.**\n4. **Microsoft's compilers**, from Microsoft's own downloads (none are included here):\n   - Visual C++ 2008 Express Edition with SP1 (cl 15.00.30729.01): almost every unit.\n   - Visual C++ 2008 Express Edition, original release (cl 15.00.21022.08): the units `build\u002Funits.json` marks\n     `\"compiler\": \"rtm\"` (the game itself was built with this one).\n   - Visual C++ 2005 SP1 (cl 14.00.50727.762), from the Windows SDK for Windows Vista (February 2007 Update): the\n     units marked `\"compiler\": \"vc8\"`.\n\n   On Windows, install them. On Linux and macOS they run under Wine; see \"Compilers without Windows\" below.\n\n## Build and compare\n\n    export FNV_MSVC9_ROOT=\u002Fpath\u002Fto\u002Fmsvc9          # folder with VC\u002F and SDK\u002F (2008 SP1)\n    export FNV_MSVC9_RTM_ROOT=\u002Fpath\u002Fto\u002Fmsvc9rtm   # 2008 original release\n    export FNV_MSVC8_ROOT=\u002Fpath\u002Fto\u002Fmsvc8          # 2005 SP1\n    export FNV_MSVC9_PREFIX=\u002Fpath\u002Fto\u002Fwineprefix   # not needed on Windows\n\n    python3 tools\u002Fbuild_and_match.py --image \u002Fpath\u002Fto\u002Fyour\u002FFalloutNV.exe\n\nThe image is checked first against a few fingerprints; nothing runs on any other file. Every unit is then compiled\nand every function compared, relocations included. The result is a count of matching functions and bytes, and a list\nof anything that does not match. `--only \u003Ctext>` builds the units whose path contains the text, `--jobs N` sets how\nmany compile at once, and `--out results.json` writes the per-unit results (addresses and counts only, never bytes of\nyour executable).\n\nA full run compiles about 2,988 units; expect it to take a while.\n\n## Layout\n\n| Path | What it holds |\n|---|---|\n| `src\u002F` | The game's code and the libraries linked into it, as C++ translation units. |\n| `include\u002F` | Shared headers. |\n| `third_party\u002Fzlib-1.2.1\u002F` | zlib 1.2.1 under its own licence, with the game's changes to `inflate.c`; see `third_party\u002FREADME.md`. |\n| `patches\u002F` | The game's changes to `inflate.c` as a diff against the official zlib file. |\n| `build\u002Funits.json` | The build recipe: for each unit its source, compiler, flags and the functions it must reproduce. |\n| `build\u002Fimage_check.json` | SHA-256 fingerprints of a few functions, used to recognise the right executable. |\n| `tools\u002F` | The compiler wrapper, the COFF\u002FPE comparison, `build_and_match.py` and `compare_builds.py` (the pull request check, see [Contributing](#contributing)). |\n| `.github\u002F` | The automatic check on pull requests. |\n\nSome units appear in more than one variant (for example `*_ob1_variant.cpp`): the original was built with different\noptimisation settings in different places, and each variant reproduces the functions built with its settings.\n\n## Compilers without Windows\n\nThe compilers run under Wine (tested on Ubuntu 24.04 with Wine 9). No installer is needed: unpack the Express ISO\nwith 7-Zip, cabextract and msitools, and point `FNV_MSVC9_ROOT` at a folder holding `VC\u002F` and `SDK\u002F`:\n\n    ISO=VS2008ExpressWithSP1ENUX1504728.iso; R=$PWD\u002Fmsvc9\n    7z x -y -otc \"$ISO\" VCExpress\n    cabextract -q -d tc\u002Fixp tc\u002FVCExpress\u002FIxpvc.exe && (cd tc\u002Fixp && msiextract -C ..\u002Fvcx vs_setup.msi >\u002Fdev\u002Fnull)\n    V=\"tc\u002Fvcx\u002FProgram Files\u002FMicrosoft Visual Studio 9.0\"; mkdir -p \"$R\"\n    cp -r \"$V\u002FVC:Vc7\" \"$R\u002FVC\"\n    for f in mspdb80.dll msobj80.dll mspdbcore.dll mspdbsrv.exe; do find \"$V\u002FCommon7\" -iname \"$f\" -exec cp {} \"$R\u002FVC\u002Fbin\u002F\" \\; ; done\n    cabextract -q -d tc\u002Fsdkx tc\u002FVCExpress\u002FWCU\u002FWinSDK\u002FWinSDK_Build.exe\n    (cd tc\u002Fsdkx && msiextract -C ..\u002Fsdko VistaClientHeadersLibs-x86.msi >\u002Fdev\u002Fnull)\n    S=\"tc\u002Fsdko\u002FSOURCEDIR\u002FProgram Files\u002FMicrosoft SDKs:.\u002FWindows:.\u002Fv6.0A:.\"; mkdir -p \"$R\u002FSDK\"\n    cp -r \"$S\u002FInclude\" \"$R\u002FSDK\u002FInclude\"; cp -r \"$S\u002FLib\" \"$R\u002FSDK\u002FLib\"\n\nThe original-release ISO (`VS2008ExpressENUX1397868.iso`) unpacks the same way into its own folder; reuse the SP1\n`SDK\u002F` folder for it. For Visual C++ 2005 SP1, unpack the `WinSDKCompiler-x86.msi` of the Windows SDK for Windows Vista\n(February 2007 Update) and copy its `Bin`, `INCLUDE` and `LIB` folders to `VC\u002Fbin`, `VC\u002Finclude` and `VC\u002Flib`, reuse\nthe SP1 `SDK\u002F` folder, and put the VC 2005 runtime DLLs next to `cl.exe` as the private assembly it asks for.\n\n## Credits\n\nThis was a community effort, coordinated on [fnvdecomp.com](https:\u002F\u002Ffnvdecomp.com). Contributors who chose to be named are listed in\n`CREDITS.md` and as co-authors of the first commit.\n\n## Legal\n\nFallout, Fallout: New Vegas, Bethesda, Bethesda Softworks and\nZeniMax are trademarks or registered trademarks of ZeniMax Media Inc., a Microsoft company, in the U.S. and\u002For other\ncountries. The game was developed by Obsidian Entertainment and published by Bethesda Softworks. Steam is a trademark\nof Valve Corporation. The libraries linked into the game belong to their owners: Gamebryo (Gamebase Co., Ltd.), Havok\n(Microsoft), SpeedTree (Interactive Data Visualization, Inc., part of Unity) and FaceGen (Singular Inversions Inc.);\nzlib is by Jean-loup Gailly and Mark Adler. All other trademarks belong to their respective holders. This project is\nnot affiliated with or endorsed by any of them.\n\nYou need your own legally obtained copy of the game, and you are responsible for following its licence terms and the\nlaw where you live.\n\nIf you hold rights in this material and want something changed or removed, write to contact@fnvdecomp.com. We will\nrespond promptly and comply.\n\nNo licence is granted for this repository; see `LICENSE`. `third_party\u002F` keeps its own licence.\n","这是一个《辐射：新维加斯》（Fallout: New Vegas，PC版1.4.0.525）的逆向工程与源码重建项目，通过逐函数反编译游戏可执行文件，重建出功能等价、机器码完全一致的C++源代码。项目采用原游戏所用的Microsoft编译器构建，所有函数均经字节级验证（基于build\u002Funits.json映射），确保二进制一致性。它不包含任何游戏资源或可执行文件，仅面向拥有正版游戏的MOD社区，用于技术研究、MOD开发和电子游戏保存。",2,"2026-11-24 04:32:17","CREATED_QUERY"]