exe-hanizer
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "exe-hanizer" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-304c58c196909017655f4d881c7156973fc22f29237e5b8641688b83eef7ad11. Verify the upstream source and version against https://skillhub.cn/skills/user_c25333c5/exe-hanizer before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Windows PE executable (.exe) interface localization tool. Parses English text resources in PE resource sections such as string tables, menus, and dialogs, automatically translates them into Chinese and writes them back. Supports two modes: directly modify the exe to produce a localized build, or generate a JSON localization patch file for later application. Use when extracting translatable strings from a PE file or localizing an English Windows program interface into Chinese.
Introduction source: third_party · user_c25333c5 · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Software, accounts and paid services
- Translation pending; see source documentation.
- Limits and differences
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: exe-hanizer
description: >
Windows PE 可执行文件 (exe) 界面汉化工具。解析 exe 资源段中的字符串表、
菜单、对话框等英文文本资源,自动翻译为中文并写回。支持两种模式:
(1) 直接修改 exe 生成汉化版;(2) 生成 JSON 汉化补丁文件供后续应用。
Use this skill when users ask to translate / localize / 汉化 / Chinese-ify
an English Windows exe program interface, or when they need to extract
translatable strings from a PE file.EXE Hanizer - Windows PE 程序汉化
将英文 Windows 程序 (exe) 的界面资源自动翻译为简体中文。
前置依赖
执行前确保已安装 pefile 和翻译库:
pip install pefile googletrans==4.0.0rc1
若 Google 翻译不可用,回退到 MyMemory 免费 API(无需额外安装,使用 requests)。
快速使用
模式一:直接汉化 exe
python scripts/hanize.py <目标exe路径> --mode direct --output <输出exe路径>
输出一个已汉化的 exe 副本。例如:
python scripts/hanize.py D:/tools/english_tool.exe --mode direct --output D:/tools/english_tool_zh.exe
模式二:生成汉化补丁
python scripts/hanize.py <目标exe路径> --mode patch --output <补丁.json路径>
生成 JSON 补丁文件,包含所有原始文本和翻译结果,方便人工校对后应用。
仅提取资源(不翻译)
python scripts/hanize.py <目标exe路径> --extract-only --output <导出.json路径>
翻译后端
| 后端 | 参数 | 说明 |
|---|---|---|
--backend google (默认) |
质量好,需 googletrans |
|
| MyMemory | --backend mymemory |
免费 API,无需额外依赖 |
工作流程
- 解析:用
pefile解析 exe 的资源段 (.rsrc) - 提取:遍历 RT_STRING(字符串表)、RT_MENU(菜单)、RT_DIALOG(对话框),筛选含英文字母的可翻译文本
- 翻译:批量调用翻译 API 将英文转为简体中文
- 写入:
- direct 模式:复制 exe,用
pefile.set_bytes_at_rva()将翻译后的 UTF-16LE 数据写回资源段 - patch 模式:生成 JSON 补丁文件
- direct 模式:复制 exe,用
约束与注意事项
执行时务必遵守:
- 首先验证文件是 PE 格式:检查 MZ 头,非 PE 文件直接拒绝
- 字符串长度截断:翻译后的 UTF-16LE 字节数不得超过原文长度。若超出,取原文长度的截断值(按字符截断,保证 UTF-16LE 完整编码)
- 保留格式化占位符:
%s、%d、%02d、%.2f等必须原样保留在译文中 - 保留转义序列:
\n、\r\n、\t、\\等必须原样保留 - 保留快捷键标记:
&File→文件(&F)风格 - 只处理英文资源:通过语言 ID 过滤(0x0409 美式英语)
- 操作不可逆时提醒用户备份原始 exe
程序化调用
在 Python 中直接使用模块:
from scripts.pe_extractor import extract_all
from scripts.translator import translate
from scripts.patcher import patch_exe_directly, generate_patch_file
# 提取资源
data = extract_all("D:/app/tool.exe")
print(f"找到 {data.total_count} 条可翻译文本")
# 翻译
originals = data.all_originals
translated = translate(originals, backend="google")
data.apply_translations(translated)
# 直接汉化
patch_exe_directly("D:/app/tool.exe", data, "D:/app/tool_zh.exe")
# 或生成补丁
generate_patch_file("D:/app/tool.exe", data, "D:/app/tool_zh_patch.json")
参考文档
- PE 资源段结构详解:references/pe_resources.md
Current listing version
1.0.0
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决特定用户群体(需要汉化英文软件的用户)的实际需求
- 提供两种实用模式:直接汉化exe和生成JSON补丁文件
Highlights
- 触发词精准完整,覆盖多种变体(translate/localize/汉化/Chinese-ify)
- 边界清晰,明确针对Windows exe程序界面
Areas to improve
-
缺少明确的Phase/步骤划分和出口条件说明 Reported severity: Minor
文档结构良好,但缺少类似Phase 1/2/3的明确步骤划分和每个阶段的出口条件说明
Recommendation: 建议增加明确的Phase划分和每个阶段的出口条件,提升执行流程的清晰度
Highlights
- 文档结构清晰,包含前置依赖、快速使用、工作流程等完整章节
- 提供了端到端的使用示例和程序化调用方式
Highlights
- 工具来源明确(pefile, googletrans, requests),参数说明清晰
- 覆盖了主要异常情况(非PE文件拒绝、字符串长度截断、保留格式化占位符等)
- 不可逆操作有提醒用户备份的机制
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Install or fetch external dependencies
Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.
Mentioned in main document · lines 21
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Translation pending; see source documentation.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.