{"id":50998785,"url":"https://github.com/thedavidweng/cod4-cn-patch","last_synced_at":"2026-06-20T12:03:11.528Z","repository":{"id":360080614,"uuid":"1248618644","full_name":"thedavidweng/cod4-cn-patch","owner":"thedavidweng","description":"Call of Duty 4 Chinese Localization Patch","archived":false,"fork":false,"pushed_at":"2026-06-14T01:27:32.000Z","size":5894,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-14T03:14:06.793Z","etag":null,"topics":["call-of-duty","chinese","gaming","localization","modding","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thedavidweng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-24T21:54:52.000Z","updated_at":"2026-06-14T01:27:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/thedavidweng/cod4-cn-patch","commit_stats":null,"previous_names":["thedavidweng/cod4-cn-patch"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thedavidweng/cod4-cn-patch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thedavidweng%2Fcod4-cn-patch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thedavidweng%2Fcod4-cn-patch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thedavidweng%2Fcod4-cn-patch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thedavidweng%2Fcod4-cn-patch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thedavidweng","download_url":"https://codeload.github.com/thedavidweng/cod4-cn-patch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thedavidweng%2Fcod4-cn-patch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34568743,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["call-of-duty","chinese","gaming","localization","modding","python"],"created_at":"2026-06-20T12:03:10.672Z","updated_at":"2026-06-20T12:03:11.522Z","avatar_url":"https://github.com/thedavidweng.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# COD4:MW 中文补丁现代化跨平台安装器\n\n[![Mentioned in Awesome Game Translations](https://awesome.re/mentioned-badge.svg)](https://github.com/thedavidweng/awesome-game-translations)\n\n![预览](preview.png)\n\n**声明：本安装器是基于2009年游侠汉化组原汉化补丁成果的现代化版本，所有汉化数据均直接复用自2009年原版发行包，未做任何修改。本安装器仅将原版的 decompressor/replace/compressor 私有 EXE 工具链替换为跨平台的 Python zlib 标准库实现。**\n\n基于游侠网 / 使命召唤中文站 2009 年汉化补丁制作的**纯 Python 现代化安装器**，兼容 Windows、Linux（含 SteamOS）及 macOS。\n\n## 原汉化组人员名单（2009）\n\n| 职责 | 人员 |\n|---|---|\n| 总监 | lijingxing（游侠汉化组） |\n| 技术 | 070（游侠汉化组兼使命召唤中文站）、sunwayking（游侠汉化组）、falser |\n| 翻译 | digmouse、kb1999、Panzerwillow、softboy（游侠汉化组） |\n| 测试 | Happymars、Loper、speedypanda、arj1984、杜达耶夫、wblllqbnb3、viscap、237252994、momo、unlucky（使命召唤中文站测试组）；digmouse、klarc（游侠汉化组） |\n| 鸣谢 | 中国主视角站（图标汉化包）、aintnomeinteam（遗失CSV文件） |\n| **新版安装脚本** | **[David](https://github.com/thedavidweng)** |\n\n## 与原版的区别\n\n| 特性 | 原版 (2009) | 本版 (modern) |\n|---|---|---|\n| 运行平台 | 仅限 Windows | **Windows / Linux / SteamOS / macOS** |\n| 技术依赖 | 3 个私有二进制 EXE | **纯 Python 3 标准库** |\n| 附带推广 | 有 | **无** |\n| 防病毒误报 | 老旧 EXE 常被误报 | **开源脚本，零误报** |\n| 启动图替换 | 强制替换 BMP | **手动选择，自动匹配 BMP/PNG** |\n\n\u003e **修复老补丁报错**：原版补丁在某些系统上安装后游戏会报错 **\"Couldn't load image\"**。本安装器已修复该问题，已在 **Windows 11** 上完整测试通过。\n\n## 技术原理\n\n原版使用 2009 年的私有二进制工具链：\n1. `decompressor.exe` —— 解压 `.ff` FastFile（已确认使用 zlib 1.2.3）\n2. `replace.exe` —— 在 dump 的十六进制偏移处写入 patch payload\n3. `compressor.exe` —— 用 zlib 重新压缩\n\n本版完全替代为：**Python `zlib` 模块** 做解压/压缩，纯字节操作做偏移写入。patch payload（`.bin` 文件）全部复用原版汉化数据，汉化效果**100% 一致**。\n\n## 安装要求\n\n- **Python 3.6 或更高版本**\n- **原版 COD4 已升级到 1.7 版本**（完整光盘版安装）\n- **约 3GB 磁盘剩余空间**（用于备份和临时文件）\n\n\u003e SteamOS / Linux 通常已预装 Python 3。Windows 用户如未安装，可从 [python.org](https://python.org) 下载。\n\n## 快速开始（推荐：双击启动）\n\n### 下载补丁\n\n1. 在本仓库页面点击绿色的 **\u003c\u003e Code** 按钮\n2. 点击 **Download ZIP**\n3. 将下载的 `cod4-cn-patch-main.zip` 在 COD4 **游戏根目录** 解压\n\n### Windows\n\n1. 打开解压出的 `cod4-cn-patch-main/` 文件夹\n2. 将其中的 `Windows双击安装中文补丁.bat`、`cod4_cn_patch.py` 和 `patches/` 放到 COD4 **游戏根目录**\n3. **双击 `Windows双击安装中文补丁.bat`**\n4. 在弹出的 CMD 窗口中查看原汉化组人员名单，然后选择菜单操作\n\n### macOS\n\n1. 打开解压出的 `cod4-cn-patch-main/` 文件夹\n2. 将其中的 `macOS双击安装中文补丁.command`、`cod4_cn_patch.py` 和 `patches/` 放到 COD4 **游戏根目录**\n3. **双击 `macOS双击安装中文补丁.command`**\n4. 在终端窗口中选择菜单操作\n\n\u003e 首次运行时系统可能提示\"无法打开\"，请前往 **系统设置 → 隐私与安全性** 中允许，或按住 Control 键点按文件选择\"打开\"。\n\n### Linux / SteamOS\n\n1. 打开解压出的 `cod4-cn-patch-main/` 文件夹\n2. 将其中的 `Linux双击安装中文补丁.sh`、`cod4_cn_patch.py` 和 `patches/` 放到 COD4 **游戏根目录**\n3. **双击 `Linux双击安装中文补丁.sh`**（取决于桌面环境，或右键选择\"作为程序运行\"）\n4. 在终端窗口中选择菜单操作\n\n\u003e Steam Deck 桌面模式下，在文件管理器 (Dolphin) 中右键 `.sh` 文件即可看到 \"Run in Konsole\" 选项。\n\n## 安装过程预览\n\n选择 **[I] 安装中文补丁** 后，首先扫描游戏目录并提示：\n\n```\n  检测到游戏启动画面: cod.png\n  是否替换为中文版？\n  [Y] 是 — 使用中文启动图（推荐）\n  [N] 否 — 保留原版启动图\n\n  请选择 [Y/N] (默认 Y):\n```\n\n然后显示阶段进度：\n\n```\n[*] 发现 22 个 .ff 文件需要汉化，共 145 处 patch\n\n[1/4] 替换基础文件...\n  [\u003e] 已替换: cod.bmp\n  [\u003e] 已替换: localization.txt\n  [OK] 完成\n\n[2/4] 安装中文字体资源...\n  [\u003e] 已安装: localized_chinese_iw15.iwd\n  [\u003e] 已停用: localized_english_iw15.iwd -\u003e localized_english_iw15.iwd.disabled\n  [OK] 完成\n\n[3/4] 准备 22 个游戏数据文件...\n  [\u003e] 已复制: zone/english/common.ff\n  ...\n  [OK] 完成\n\n[4/4] 写入汉化补丁 (共 22 个文件)...\n  [#-----------------------------]   4.5% (1/22) ac130.ff           199KB -\u003e 200KB  (1p)\n  [##----------------------------]   9.1% (2/22) airlift.ff         199KB -\u003e 200KB  (8p)\n  ...\n  [##############################] 100.0% (22/22) village_defend.ff 199KB -\u003e 200KB  (10p)\n  [OK] 完成\n\n============================================================\n  [OK] 安装完成！游戏已切换为中文版。\n============================================================\n```\n\n## 文件结构\n\n```\nCall of Duty 4/\n├── iw3sp.exe              ← 游戏主程序\n├── main/\n├── zone/\n├── Windows双击安装中文补丁.bat     ← Windows 双击启动器\n├── macOS双击安装中文补丁.command   ← macOS 双击启动器\n├── Linux双击安装中文补丁.sh         ← Linux/SteamOS 双击启动器\n├── cod4_cn_patch.py       ← 核心安装器（纯 Python）\n├── README.md\n└── patches/\n    ├── cod1.bmp           ← 中文启动图 (原版)\n    ├── cod1.png           ← 中文启动图 (转换格式)\n    ├── localization.cn    ← 中文语言配置\n    ├── main/\n    │   └── localized_chinese_iw15.iwd   ← 中文字体纹理\n    └── zone/\n        └── chinese/\n            └── *.bin      ← 145 个 .ff patch payload\n```\n\n## 命令行使用（高级用户）\n\n如果习惯命令行，也可以直接运行 Python 脚本：\n\n```bash\n# 进入交互式菜单（等同于双击启动，会显示人员名单和菜单）\npython3 cod4_cn_patch.py\n\n# 直接安装（默认替换启动图）\npython3 cod4_cn_patch.py install\n\n# 直接卸载\npython3 cod4_cn_patch.py uninstall\n\n# 查看状态\npython3 cod4_cn_patch.py status\n\n# 指定游戏目录\npython3 cod4_cn_patch.py install --game-dir ~/Games/COD4\n```\n\n## 安全机制\n\n- **原子备份**：任何文件被修改前都会自动复制到 `.cod4cn_bak/`\n- **失败回滚**：安装过程中任何步骤出错，自动撤销已完成的操作\n- **重复安装保护**：检测到 `.cod4cn_bak/` 存在时会阻止重复安装，避免备份嵌套\n- **偏移校验**：每个 patch 写入前检查偏移是否在 dump 范围内，防止溢出\n- **进度可见**：每个 .ff 文件处理时实时显示百分比、文件大小变化和 patch 数量\n- **手动选择是否替换启动图**：安装时扫描游戏目录中现有的启动图格式，询问用户是否替换。预置了 `cod1.bmp`（Windows）和 `cod1.png`（macOS/SteamOS）两种格式，无需在目标系统上安装图像转换工具\n- **可选跳过启动图**：用户可选择 [N] 保留原版启动图，仅汉化文字和字体资源\n\n## 已知限制\n\n1. **联机兼容性**：汉化修改了 `.ff` 文件的哈希值，部分开启文件校验（`sv_pure`）的多人服务器可能拒绝连接。建议仅用于单人战役或局域网对战。\n2. **高压硬盘版不确定有效**：本补丁基于完整光盘版设计，对网络上流传的高压精简版兼容性未知。\n3. **`.ff` 压缩比差异**：重新压缩后的 `.ff` 文件大小可能与原版略有不同（zlib 默认级别），但不影响游戏读取。\n\n## 致谢\n\n汉化内容版权归原汉化组所有：\n- 总监：lijingxing（游侠汉化组）\n- 技术：070、sunwayking、falser\n- 翻译：digmouse、kb1999、Panzerwillow、softboy\n- 测试：Happymars、Loper、speedypanda 等\n- 来源：[游侠网](http://www.ali213.net) / 使命召唤中文站\n\n本安装器仅提供**现代化跨平台封装**，未修改任何汉化数据内容。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthedavidweng%2Fcod4-cn-patch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthedavidweng%2Fcod4-cn-patch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthedavidweng%2Fcod4-cn-patch/lists"}