WAD、BIN、BNK、WPK文件简单处理
Project description
league-tools
WAD、BIN、BNK、WPK 文件处理工具库。
介绍
league-tools 是一个用于处理英雄联盟资源文件的 Python 库,提供对以下格式的底层解析能力:
WAD(.wad.client):资源包(模型、贴图、音频等)BIN(.bin):游戏配置与逻辑数据BNK(.bnk):Wwise SoundBank 音频元数据WPK(.wpk):Wwise 打包音频文件
音频事件映射默认推荐使用 NativeHIRC:
- 只关注事件映射所需的 HIRC 音频信息
- 直接从
events.bnk读取,速度明显快于wwiser -> XML - 更适合默认映射链和批量分析
如果你需要更完整的 BNK/HIRC 结构、XML 对照能力或调试信息,再使用 WwiserHIRC。
安装
pip install league-tools
如需基于发布分支安装最新代码:
pip install -e "git+https://github.com/Virace/league-tools@package#egg=league_tools"
使用
基础使用示例(四种核心格式):
from pathlib import Path
from league_tools import BIN, BNK, NativeHIRC, WAD, WPK
# 1) WPK:提取音频文件
wpk = WPK("path/to/audio.wpk")
wem_files = wpk.extract_files()
# 2) BNK:提取内嵌WEM
bnk = BNK("path/to/events.bnk")
bnk_wem_files = bnk.extract_files()
# 3) WAD:按已知路径提取文件
wad = WAD("path/to/archive.wad.client")
wad.extract(
["assets/sounds/vo/champions/gwen/skin01/vo_gwen_skin01_events.bnk"],
out_dir=Path("./wad_output"),
)
# 4) BIN:读取音频事件组数据
bin_file = BIN("path/to/skin.bin")
audio_groups = bin_file.data
# 5) NativeHIRC:默认推荐的 events.bnk 解析入口
hirc = NativeHIRC.from_bnk("path/to/vo_events.bnk")
日志默认关闭;上游项目可按需手动开启:
from league_tools import enable_logging, disable_logging
enable_logging()
# ... 业务逻辑 ...
disable_logging()
详细示例与格式文档:
音频映射建议
默认工作流:
from league_tools import AudioEventMapper, BIN, NativeHIRC
bin_file = BIN("path/to/skin.bin")
hirc = NativeHIRC.from_bnk("path/to/events.bnk")
mapping = AudioEventMapper(bin_file, hirc).build_mapping()
何时切到 WwiserHIRC:
- 需要完整 XML / HIRC 结构对照
- 需要调试
wwiser输出或排查版本差异 - 需要的信息超出
NativeHIRC当前只关注的音频事件映射范围
参考
- WPK 参考 Morilli/bnk-extract
- WAD 结构与部分逻辑来源于 CommunityDragon/CDTB 与 Pupix/lol-file-parser
- BNK 结构参考 Xentax Wiki
NativeHIRC的MusicSwitch/ 音乐容器读取顺序在调试阶段参考了 Neinndall/AssetsManager 的 BNK 解析实现,用于交叉校验 Wwise 145 样本的偏移处理WwiserHIRC的 XML 对照与调试流程依赖 bnnm/wwiser 提供的导出能力;本项目将其作为外部分析工具使用,运行时需由用户自行提供可执行文件
维护
- 维护者:Virace(孤独的未知数)
- 开发与测试标准:docs/development_testing.md
- 发布与维护流程:docs/release_workflow.md
- Wwise 黑箱转白箱可行性记录:docs/wwise_reverse_engineering_feasibility.md
- 许可证:GPLv3
感谢
- @Morilli(bnk-extract)
- @Pupix(lol-file-parser)
- @CommunityDragon(CDTB)
- @Neinndall(AssetsManager,提供 BNK / 音乐容器解析对照思路)
- @bnnm(wwiser,提供 BNK XML 导出与结构对照能力)
- @vgmstream(vgmstream)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file league_tools-1.1.4.tar.gz.
File metadata
- Download URL: league_tools-1.1.4.tar.gz
- Upload date:
- Size: 130.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da5040a39bcc0e56e3eca368c3f055a903cdb3c19e48648f0257452b143858e1
|
|
| MD5 |
a00ca8cbd0fd41d364165dc9a5c3dcd6
|
|
| BLAKE2b-256 |
b61d8f6cc3da7ea2eb626e369aa8b768809e1012b0d24ee83ab4ed9782f79848
|
Provenance
The following attestation bundles were made for league_tools-1.1.4.tar.gz:
Publisher:
python-publish.yml on Virace/league-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
league_tools-1.1.4.tar.gz -
Subject digest:
da5040a39bcc0e56e3eca368c3f055a903cdb3c19e48648f0257452b143858e1 - Sigstore transparency entry: 1164280756
- Sigstore integration time:
-
Permalink:
Virace/league-tools@c67e999d0eb6be1122d3dcb3dcc6ec6c9edd70e9 -
Branch / Tag:
refs/tags/v1.1.4 - Owner: https://github.com/Virace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c67e999d0eb6be1122d3dcb3dcc6ec6c9edd70e9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file league_tools-1.1.4-py3-none-any.whl.
File metadata
- Download URL: league_tools-1.1.4-py3-none-any.whl
- Upload date:
- Size: 96.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0213c06f83707658fcd7babc58e2428b000c087a8ef234b0a8ba71219e722e3d
|
|
| MD5 |
655e0fda95d827170be883ca507d57fb
|
|
| BLAKE2b-256 |
b679eef777640ca41e1cd43dc56ae880b8100d4e589b93ff8353d3773ffdc041
|
Provenance
The following attestation bundles were made for league_tools-1.1.4-py3-none-any.whl:
Publisher:
python-publish.yml on Virace/league-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
league_tools-1.1.4-py3-none-any.whl -
Subject digest:
0213c06f83707658fcd7babc58e2428b000c087a8ef234b0a8ba71219e722e3d - Sigstore transparency entry: 1164280832
- Sigstore integration time:
-
Permalink:
Virace/league-tools@c67e999d0eb6be1122d3dcb3dcc6ec6c9edd70e9 -
Branch / Tag:
refs/tags/v1.1.4 - Owner: https://github.com/Virace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c67e999d0eb6be1122d3dcb3dcc6ec6c9edd70e9 -
Trigger Event:
release
-
Statement type: