|
|
本帖最后由 smile417 于 2025-12-1 15:16 编辑
转自n网:https://www.nexusmods.com/borderlands4/mods/47
A Python utility to decrypt/encrypt Borderlands 4 saves. Comes with experimental item editing.
用于解密/加密《无主之地 4》存档的 Python 实用程序。附带实验性项目编辑功能。
Borderlands 4 Save Encrypter and Decrypter (with Item Editing Capabilities)
《无主之地 4》保存加密器和解密器(具有物品编辑功能)
Note: I am not responsible for any saves you mess up while editing! Always remember to backup your saves before editing. Also, read the important notes section at the bottom. Numbered saves (1.sav, 2.sav, 3.sav, etc.) are whole saves with inventory, stats, etc. Cosmetics and game settings are in profile.sav.
注意:对于您在编辑时搞砸的任何保存,我概不负责!请务必记住在编辑之前备份您的保存。另外,请阅读底部的重要说明部分。编号保存(1.sav、2.sav、3.sav 等)是包含库存、统计数据等的完整保存。化妆品和游戏设置 profile.sav。
If people want to work on a list of mapping numeric IDs in decrypted saves to more detailed descriptions that can be put in a table, feel free to experiment and leave a comment or make a Github issue and I will update the README and the description here!
如果人们想在解密保存中处理映射数字 ID 列表,以将更详细的描述放入表格中,请随时尝试并发表评论或制作 Github 问题,我将在此处更新自述文件和描述!
Github Repo: https://github.com/glacierpiece/borderlands-4-save-utility
Github 存储库:https://github.com/glacierpiece/borderlands-4-save-utility(stars appreciated) (星级赞赏)
A tool (written in Python) to decrypt and encrypt Borderlands 4 save files for editing. Feel free to use this code in any way you see fit, just credit me! Enjoy.
一个工具(用 Python 编写),用于解密和加密《无主之地 4》保存文件以供编辑。请随意以您认为合适的任何方式使用此代码,请归功于我!享受。
Requirements: 任职要求 :
Installation (venv recommended)
安装( 推荐 venv)
Extract the zip, then install the requirements:
解压 zip,然后安装需求:
pip install -r requirements.txt
Usage: 用法 :
To see detailed usage information with examples:
要查看包含示例的详细使用信息,请执行以下作:
python blcrypt.py decrypt --help
python blcrypt.py encrypt --help
Decrypt a Save File
解密保存文件
Convert a *.sav file to editable YAML:
将 *.sav 文件转换为可编辑的 YAML:
python blcrypt.py decrypt -in 1.sav -out save.yaml -id YOUR_STEAM_ID
Edit the YAML as desired:
根据需要编辑 YAML:
Open save.yaml in any text editor and modify the values you want to change. Be mindful of indentation since this is a YAML file.
在任何文本编辑器中打开 save.yaml 并修改要更改的值。请注意缩进,因为这是一个 YAML 文件。
Encrypt a Save File
加密保存文件
Convert the edited YAML back to a *.sav file:
将编辑后的 YAML 转换回 *.sav 文件:
python blcrypt.py encrypt -in save.yaml -out 1.sav -id YOUR_STEAM_ID
Save Decrypt/Encrypt with Item Serial Decoding/Encoding (EXPERIMENTAL)
使用项目串行解码/编码保存解密/加密(实验性)
Step 1: Decrypt with Item Serial Decoding
第 1 步:使用项目串行解码解密
This will decode item serials and add an editable _DECODED_ITEMS section to your YAML file.
这将解码项目序列号,并将可 编辑的 _DECODED_ITEMS 部分添加到 YAML 文件中。
Important: The output contains the complete save file as YAML plus the decoded items section.
重要: 输出包含完整的保存文件作为 YAML 以及解码项部分。
python blcrypt.py decrypt -in 1.sav -out save.yaml -id YOUR_STEAM_ID --decode-serials
The generated YAML will include your complete save file plus a _DECODED_ITEMS section like this:
生成的 YAML 将包括完整的 保存文件 以及如下 所示的_DECODED_ITEMS 部分:
_DECODED_ITEMS:
inventory.items[0].serial:
original_serial: "@Ugr..."
item_type: "r"
category: "weapon"
confidence: "high"
stats:
primary_stat: 1234 # Weapon damage - edit this!
secondary_stat: 5678# Secondary stats - edit this!
rarity: 12# Rarity level - edit this!
manufacturer: 123 # Manufacturer ID - edit this!
item_class: 123 # Weapon class - edit this!
Step 2: Edit Item Stats
第 2 步:编辑物品统计信息
Modify the values in the _DECODED_ITEMS section:
修改_DECODED_ITEMS 部分中的值:
- primary_stat: Main weapon damage/equipment power
primary_stat:主武器伤害/装备威力 - secondary_stat: Secondary weapon/equipment stats
secondary_stat:辅助武器/装备统计数据 - rarity: Item rarity level (affects item quality - common, uncommon, rare, etc.)
rarity:物品稀有度等级(影响物品质量 - 普通、不常见、稀有等) - manufacturer: Weapon/equipment manufacturer
制造商 :武器/设备制造商 - item_class: Specific weapon/equipment type
item_class:特定武器/装备类型 - level: Item level (when available)
level:项目级别(如果可用)
Step 3: Encrypt with Item Serial Encoding
第 3 步:使用项目串行编码进行加密
This will read the complete YAML file, apply your changes from _DECODED_ITEMS back to the item serials, remove the _DECODED_ITEMS section, and encrypt the complete save file to be used in game:
这将读取完整的 YAML 文件,将您从 _DECODED_ITEMS 更改应用 回物品序列号,删除 _DECODED_ITEMS 部分,并加密要在游戏中使用的完整保存文件:
python blcrypt.py encrypt -in save.yaml -out 1_modified.sav -id YOUR_STEAM_ID --encode-serials
Supported Item Types: 支持的项目类型:
The decoder can handle multiple item categories with different confidence levels:
解码器可以处理具有不同置信度的多个项目类别:
- Weapons (@Ugr): High confidence decoding of damage, rarity, manufacturer
武器 (@Ugr): 伤害、稀有度、制造商的高置信度解码 - Equipment (@Uge): High/medium confidence decoding of stats and properties
装备 (@Uge): 统计数据和属性的高/中置信度解码 - Equipment Alt (@Ugd): High/medium confidence for alternative equipment types
设备 Alt (@Ugd): 备选设备类型的高/中置信度 - Special Items (@Ugw, @Ugu, @Ugf, @Ug!): Low confidence generic decoding
特殊项目 (@Ugw、@Ugu、@Ugf、@Ug!): 低置信度通用解码
Items with "high" confidence are most reliable for editing. "Medium" and "low" confidence items may work but are less predictable for now, I'll get to it when I get to it.
具有“高”置信度的项对于编辑来说最可靠。“中”和“低”置信度项目可能有效,但目前不太可预测,我会在遇到它时再谈。
Complete Workflow Example
完整的工作流程示例
Basic Save Editing 基本保存编辑
For basic save editing without modifying item stats:
对于不修改项目统计信息的基本保存编辑:
# 1. Decrypt save file to YAML
python blcrypt.py decrypt -in 1.sav -out save.yaml -id 76561198XXXXXXXXX
# 2. Edit save.yaml in any text editor
# 3. Encrypt back to save file
python blcrypt.py encrypt -in save.yaml -out 1.sav -id 76561198XXXXXXXXX
# 4. Replace your original save file with 1.sav
Advanced Save Editing with Item Serial Modification (EXPERIMENTAL)
使用项目序列修改进行高级保存编辑(实验性)
# 1. Decrypt save file with item serial decoding
python blcrypt.py decrypt -in 1.sav -out save.yaml -id 76561198XXXXXXXXX --decode-serials
# 2. Edit the _DECODED_ITEMS section in save.yaml to modify weapon damage, rarity, etc.
# 3. Encrypt back with item serial encoding
python blcrypt.py encrypt -in save.yaml -out .sav -id 76561198XXXXXXXXX --encode-serials
# 4. Replace your original save file with the new 1.sav
Sharing Saves 共享存档
You can share saves with anyone as long as you know the original Steam ID of the encrypted save - decrypt with the original Steam ID, find your steam ID, make edits, then encrypt with your Steam ID.
只要您知道加密存档的原始 Steam ID,您就可以与任何人共享存档 - 使用原始 Steam ID 解密,找到您的 Steam ID,进行编辑,然后使用您的 Steam ID 进行加密。
Important Notes 重要事项
***Backup your save files before using this tool!***
使用此工具之前备份您的保存文件!
Your Steam ID is the 17-digit number that starts with 7656119...
您的 Steam ID 是以 7656119 开 头的 17 位数字 ......- On Windows, you can find this ID as the folder location:
在 Windows 上,您可以找到此 ID 作为文件夹位置:
C:\Users\{username}\Documents\My Games\Borderlands 4\Saved\SaveGames The folder name in here is the ID to use.
C:\Users\{username}\Documents\My Games\Borderlands 4\Saved\SaveGames 此处的文件夹名称是要使用的 ID。 - The Steam ID MUST match the original save file owner (you can share/use saves with anyone if they have your Steam ID or you have theirs)
Steam ID 必须 与原始存档文件所有者匹配(如果任何人拥有您的 Steam ID 或您拥有他们的 Steam ID,您可以与任何人共享/使用存档) - If you get PKCS7 or zlib errors, verify your Steam ID is correct
如果您收到 PKCS7 或 zlib 错误,请验证您的 Steam ID 是否正确 - Encrypt/decrypt the NUMBERED or PROFILE saves depending on what you want to edit (1.sav, 2.sav, etc. vs. Profile.sav). #.sav (numbered) is the full save. Profile.sav has cosmetics.
根据您要编辑的内容(1.sav、2.sav 等与 Profile.sav )加密/解密 NUMBERED 或 PROFILE 保存。#.sav (编号)是完整保存。 Profile.sav 有化妆品。 - When editing item stats (in NUMBERED saves), keep values within reasonable ranges first
编辑项目统计信息(在 NUMBERED 保存中)时,请首先将值保持在合理范围内 - High confidence items are most reliable for stat modifications
高 置信度项目对于统计数据修改最可靠 - The _DECODED_ITEMS section is automatically removed during encryption
_DECODED_ITEMS 部分在加密期间自动删除 - Open an issue on Githubor leave a comment if you're having trouble and maybe I or someone else will assist/troubleshoot
如果您遇到问题,请在 Github上提出问题或发表评论,也许我或其他人会协助/排除故障
Command Summary 命令摘要
# Basic decrypt/encrypt (no item modification)
python blcrypt.py decrypt -in 1.sav -id 76561198XXXXXXXXX
python blcrypt.py encrypt -in 1.yaml -id 76561198XXXXXXXXX
# Advanced: Decode item serials for editing
python blcrypt.py decrypt -in 1.sav -id 76561198XXXXXXXXX --decode-serials
# Advanced: Encode modified item serials back to save
python blcrypt.py encrypt -in 1.yaml -id 76561198XXXXXXXXX --encode-serials
Troubleshooting 故障 排除
- "PKCS7 padding error": Wrong Steam ID
“PKCS7 填充错误”:Steam ID 错误 - "zlib decompression error": Wrong Steam ID or corrupted file
“zlib 解压错误”:Steam ID 错误或文件损坏 - File size not multiple of 16: File may be corrupted or not a valid BL4 save file
文件大小不是 16 的倍数:文件可能已损坏或不是有效的 BL4 保存文件
Unzip and use python utility.
解压缩并使用 python 实用程序。
|
评分
-
1
查看全部评分
-
|