Hd2 Lua Mod

制作/修改《绝地潜兵2》「Lua 注入型」mod 的完整工作流 —— 依赖 Bingus Shared Loader、运行时用 FFI 读写游戏进程内存的那一类(如 P11-Self-Heal、CowboyBingus 系列)。离线优先:先用工具链里的明文 datalibrary + 游戏自带 typelib 把数据表解出来算出偏移,再上机做最小验证。涵盖 .patch_N 归档格式、addon 打包、只读侦察 addon 的写法、从运行时内存定位数据表、运行时补丁的「校验+备份+回读+复查」套路、以及一套能在上机前抓出致命 bug 的 lupa 离线仿真 + 变异测试法。涵盖「整表复现反推字段偏移」这套抗构建漂移的补丁校验法,以及社区明文 JSON 数据源。当用户要做 HD2 的注入型 mod、要往游戏内存里读写数据、要改武器/射弹/战备的次数与冷却/游戏参数、或要读懂 `9ba626afa44a3aa3.patch_*` 这类文件时使用。

44 stars 1 forksOther

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add MrChengl11/hd2-lua-mod-skill --skill hd2-lua-mod
Manual install
git clone --depth 1 https://github.com/MrChengl11/hd2-lua-mod-skill.git /tmp/hd2-lua-mod-skill
mkdir -p ~/.claude/skills
cp -r /tmp/hd2-lua-mod-skill/skills/hd2-lua-mod ~/.claude/skills/hd2-lua-mod

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# 绝地潜兵 2 · Lua 注入型 Mod 工作流

> 这类 mod 和普通 mod 完全不同:**不是换素材,是往游戏的 LuaJIT 虚拟机里塞 Lua 代码,
> 再用 FFI 直接读写游戏进程内存**。素材类改法(替换 `data/` 资源)对它无效。

## 0. 先离线,后上机(最重要的一条)

**游戏的数据表在磁盘上是加密的,但工具链里有一份明文镜像。**
先用它把大半的活干完,再决定要不要上机侦察 —— 上机一趟要重开游戏,成本很高。

| 明文资源 | 位置 | 用途 |
|---|---|---|
| `generated_entities.dl_bin`(45 MB) | filediver 模块缓存 `.../xypwn/filediver@<ver>/datalibrary/` | 全部实体 / 组件数据:武器、挂架、装备、库存、策略… |
| `generated_projectile_settings.dl_bin` 等 | 同上 | 射弹 / 伤害 / 爆炸 / 表面 各设置表 |
| `datalibrary/*.go` | 同上 | **每个组件每个字段的名字和注释** —— 由游戏自带 typelib 生成,比任何社区结构体权威 |
| `typelib_all.json` / `typelib_names.tsv` | 反编译产物 | 全部 ~1177 个类型的**字段偏移 / 大小 / 成员名** + 类型哈希↔名字对照 |

游戏安装目录的 `data/game/generated_*.dl_bin` **是加密的**(实测熵 7.9998 bit/byte,
45 MB 里 `LDLD` 出现 **0** 次),大小通常只比明文镜像多 48 字节。
**不要试图改磁盘文件** —— 改不出来,也不在 mod 管线里。

### 怎么拿到这些文件

FileDiver 的 `datalibrary` 用 `//go:embed` 把明文数据打包进了 Go 模块,**连 typelib 一起**:

```bash
go mod download github.com/xypwn/filediver    # 或直接 clone 源码树
# 文件在 <GOMODCACHE>/github.com/xypwn/filediver@<ver>/datalibrary/ :
#   generated_*.dl_bin        明文数据表(含 45 MB 的 generated_entities.dl_bin)
#   dl_library.dl_typelib     游戏自带的类型库
#   *.go                      每个组件的字段名与注释(由 typelib 生成)
```

再把 typelib 导成 JSON —— 用 `tools/dump_typelib/`,放进 FileDiver 源码树的 `cmd/` 下跑:

```bash
go run ./cmd/dump_typelib -o typelib_all.json    # 1177 个类型的字段偏移/大小/成员名
```

> `-o` 不是可选项:PowerShell 的 `>` 重定向会把 JSON 写成 UTF-16,Python 直接读不开。

### 还有一个明文来源:社区解好的 JSON(**先查这个**)
Read the full skill on GitHub

Details

Skill name
hd2-lua-mod
Path
skills/hd2-lua-mod/SKILL.md
License
MIT
Repo updated
25 September 2026

FAQ

What does the Hd2 Lua Mod skill do?

制作/修改《绝地潜兵2》「Lua 注入型」mod 的完整工作流 —— 依赖 Bingus Shared Loader、运行时用 FFI 读写游戏进程内存的那一类(如 P11-Self-Heal、CowboyBingus 系列)。**离线优先**:先用工具链里的明文 datalibrary + 游戏自带 typelib 把数据表解出来算出偏移,再上机做最小验证。涵盖 .patch_N 归档格式、addon 打包、只读侦察 addon 的写法、从运行时内存定位数据表、运行时补丁的「校验+备份+回读+复查」套路、以及一套能在上机前抓出致命 bug 的 lupa 离线仿真 + 变异测试法。涵盖「整表复现反推字段偏移」这套抗构建漂移的补丁校验法,以及社区明文 JSON 数据源。当用户要做 HD2 的注入型 mod、要往游戏内存里读写数据、要改武器/射弹/战备的次数与冷却/游戏参数、或要读懂 `9ba626afa44a3aa3.patch_*` 这类文件时使用。

How do I install the Hd2 Lua Mod skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add MrChengl11/hd2-lua-mod-skill --skill hd2-lua-mod. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Hd2 Lua Mod popular?

It lives in MrChengl11/hd2-lua-mod-skill, which has 44 GitHub stars and 1 forks.

Related skills

Octopus Paul Skill

43

Dxboy266/FIFA-WINNER-SKILL

蒸馏“章鱼哥”(Paul the Octopus)的认知系统,用于世界杯比赛的娱乐玄学预测与神态演绎。

Other

Fogg Habit

49

lovekeji-ai/keji-skills

基于 BJ Fogg《福格行为模型 / Tiny Habits》的对话式习惯教练。用 B=MAP(行为=动机×能力×提示)和福格的行为设计流程,帮用户:(1) 诊断某个习惯为什么没坚持下来、怎么改善;(2) 从愿望出发设计新习惯(行为群→焦点地图→微行为→锚点→庆祝);(3) 戒除坏习惯;(4) 设计庆祝/情绪以让习惯扎根;(5) 帮家人/团队做行为改变。纯对话引导,不写代码。触发词:"福格"、"福格行为模型"、"Tiny Habits"、"微习惯"、"B=MAP"、"我为什么坚持不下来 X 习惯"、"帮我养成 X 习惯"、"帮我戒掉 X"、"行为设计"、"/fogg-habit"。

Other

山东人享福的一生

44

YifeiCAO/shandong-xiangfu

用享福哥的方式回答问题。无论用户说什么事,都先说"那享福了",再用1-2句调侃+毒鸡汤简短点评。正反面都能享福,越惨越享福。纯娱乐整活风格。触发词:享福哥、享福了、用享福哥的方式回答。

Other

Fifa Winner Skill

43

Dxboy266/FIFA-WINNER-SKILL

Use when the user asks to initialize a FIFA World Cup knowledge base, collect team or player profiles, record matches, generate daily pre-match entertainment predictions, evaluate prediction accuracy, or create World Cup prediction posters. Not for betting or gambling advice.

Other

Computer Use

43

Plocr/Reasonix-computer-use

Windows 桌面自动化执行规则。使用 screen_interactor 观察与操作原生桌面应用。

Other

Drupal Contrib Mgmt

84

grasmash/drupal-claude-skills

Manages Drupal contributed modules via Composer - module updates and major-version upgrades, cweagans/composer-patches v2 (patches.lock.json, composer patches-relock, verifying patches are applied), mglaman/composer-drupal-lenient, Drupal 11 compatibility checks with upgrade_status, committing an optimized vendor/ autoloader, and contributing fixes back to drupal.org via issue forks and merge requests. Use when updating or upgrading contrib modules, applying, finding or creating patches, a patch fails or keeps regressing after composer install, resolving Composer dependency or drupal/core vers

Other

Browse the most popular Claude skills, all other skills, or write your own with the skills generator.