ddmitv/dig-or-die-mods

GitHub: ddmitv/dig-or-die-mods

对游戏 Dig or Die 的逆向工程项目,包含 BepInEx 插件、游戏内部结构文档、世界模拟算法分析和存档文件处理工具。

Stars: 2 | Forks: 0

# Dig or Die 模组 对游戏 [Dig or Die](https://store.steampowered.com/app/315460/Dig_or_Die/) 的逆向工程项目。 它包括: - 用于改善游戏体验的 BepInEx 插件。 - 游戏内部结构的文档。 - 世界模拟算法的逆向工程。 - 用于处理存档文件的工具。 所有可用的插件都可以在 `plugins/` 文件夹中找到。 每个插件都包含一个 `REAMDE.md` 用于描述其功能。 请查看 [Wiki 页面](https://github.com/ddmitv/dig-or-die-mods/wiki) 以获取有关游戏内部结构和其他内容的文档。 # 插件安装 首先,你需要安装 BepInEx,它是一个补丁/插件框架。 你可以按照 [自动安装 BepInEx](#automatic-bepinex-installation) 或 [手动安装 BepInEx](#manual-bepinex-installation) 中指定的说明进行操作。然后 [下载插件 .dll](#download-plugin-dll)。 ## 自动安装 BepInEx 打开 PowerShell。 1. **开始菜单方法:** - 右键点击开始菜单。 - 选择 `Windows PowerShell`(对于 Windows 10)或 `Terminal`(对于 Windows 11)。 2. **搜索并启动方法:** - 按下 Windows 键。 - 输入 `PowerShell` 或 `Terminal`(对于 Windows 11)。 - 左键点击 `Windows PowerShell` 搜索结果以启动 PowerShell。 复制以下命令,将其粘贴到 PowerShell 控制台中并按 `Enter`。 ``` irm "https://raw.githubusercontent.com/ddmitv/dig-or-die-mods/main/Install-BepInEx.ps1" | iex ``` 如果遇到错误,请按照错误消息中提供的说明进行操作,或者手动安装 BepInEx。 ## 手动安装 BepInEx 你可以按照 [BepInEx 官方安装指南](https://docs.bepinex.dev/articles/user_guide/installation/index.html) 进行操作, 但以下说明是专门针对 Dig or Die 的。 1. **下载 BepInEx** \ 从 [BepInEx GitHub 发布页](https://github.com/BepInEx/BepInEx/releases) 获取 **32位** (`x86`) Windows BepInEx **5.4.23 或更高版本**。 2. **安装 BepInEx** \ 将下载的 `.zip` 内容解压到你游戏所在的 **`DigOrDie.exe` 所在的** 目录中。 3. **首次启动** \ **通过 Steam** 运行游戏。直接运行可执行文件 `DigOrDie.exe` 将无法工作。 4. **初始设置** \ 等待 `BepInEx/config` 文件夹及其他文件夹出现,然后关闭游戏。 5. **配置 BepInEx** \ 在文本编辑器中打开 `BepInEx/config/BepInEx.cfg` 并在接近末尾处找到: [Preloader.Entrypoint] ## 要目标的程序集的本地文件名。 # 设置类型:String # 默认值:UnityEngine.dll Assembly = UnityEngine.dll ## 要在 entrypoint 程序集中搜索 entrypoint 方法的类型的名称。 # 设置类型:String # 默认值:Application Type = Application ## 在指定的 entrypoint 程序集和类型中要 hook 并从中加载 Chainloader 的方法的名称。 # 设置类型:String # 默认值:.cctor Method = .cctor 将 `Type = Application` 修改为 `Type = MonoBehaviour`。 ## 下载插件 .dll 你可以从 [Github Releases](https://github.com/ddmitv/dig-or-die-mods/releases) 页面下载这些插件(或者自己编译它们,参见[构建插件](#building-plugins))。 将插件 `.dll`(例如 `precise_clock.dll`)放入 `Dig or Die/BepInEx/plugins` 文件夹中。 **通过 Steam** 运行游戏。插件现在应该已激活。 ## 插件配置 许多插件都有其配置文件,你可以在 `BepInEx/config` 下进行编辑。 相应的配置文件会在与其关联的插件首次启动游戏时被使用后出现。 要将配置重置为默认值,请删除配置文件,下次启动游戏时插件将重新创建它。 ## 推荐插件 - [Configuration Manager](https://github.com/BepInEx/BepInEx.ConfigurationManager)。通过游戏内 GUI 轻松编辑插件配置。 - [`BepInEx.Debug` Demystify Exceptions](https://github.com/BepInEx/BepInEx.Debug#demystifyexceptions)。在日志中提供更清晰的异常消息。 - [Runtime Unity Editor](https://github.com/ManlyMarco/RuntimeUnityEditor)。游戏内的检查器和调试工具。 ## 卸载 - 卸载/禁用特定插件:\ 从 `BepInEx/plugins` 文件夹中删除其 `.dll` 文件。 - 完全卸载 BepInEx:\ 删除这些文件/文件夹: - `BepInEx/` - `winhttp.dll` - `doorstop_config.ini` - `.doorstop_version` - `changelog.txt` - 临时禁用模组:\ 将 `winhttp.dll` 重命名为 `winhttp.dll.off`。重新改回原名即可重新启用。 # 构建插件 ## 前置条件 - 通过 Steam 安装的 **Dig or Die**(默认位置:`C:\Program Files (x86)\Steam\steamapps\common\Dig or Die\`) - **.NET SDK**(支持 C# 12.0 的版本) - [Git](https://github.com/git/git)(可选,你可以直接下载项目的 `.zip` 压缩包) ## 构建项目 克隆仓库: ``` git clone https://github.com/ddmitv/dig-or-die-mods.git cd dig-or-die-mods ``` 构建所需的插件(在项目根目录中运行): ``` dotnet build plugins/{plugin name} ``` 如果构建成功,它们将被自动复制到游戏文件夹的 `BepInEx/plugins` 中。 # 修改存档文件 从 [Github Releases](https://github.com/ddmitv/dig-or-die-mods/releases) 页面下载 `save-tool.exe`(或者自己编译它)。 `save-tool` 是一个用于压缩和解压存档文件的命令行工具。 你需要通过命令行运行它。使用 `--help` 列出所有可用的选项。 1. 安装 [ImHex](https://github.com/WerWolv/ImHex/blob/master/INSTALL.md) 并阅读有关[模式编辑器](https://docs.werwolv.net/imhex/views/pattern-editor)的内容。 2. 找到所需的 `.save` 文件:\ 它们位于 `C:\Users\%USERNAME%\Documents\Dig or Die\{your steam id}\Saves\{world name}\`。 3. 使用 `save-tool` 解压存档文件:\ 运行 `save-tool.exe -d {path to .save file}`。扩展名为 `.uncompressed-save` 的文件应该会出现在 `.save` 文件所在的位置。 4. 在 ImHex 中打开生成的 `.uncompressed-save` 文件。 5. 在 ImHex 中打开或将仓库根文件夹中的模式文件 `dod-save.hexpat` 拖放进去。 6. 在**模式编辑器** (Pattern editor) 视图中执行模式。 7. 在**模式数据** (Pattern Data) 视图或直接在 **Hex 编辑器**中修改任何你想要的数据并保存。 8. 使用 `save-tool` 压缩回修改后的未压缩存档文件:\ 运行 `save-tool.exe -c {path to .uncompressed-save file}`。这将为旧存档创建备份并替换原始的 `.save` 文件。 9. 在游戏中打开你的存档文件。
标签:AI合规, BepInEx, Dig or Die, DNS解析, IPv6, PowerShell, Steam游戏, x86, 世界模拟算法, 云资产清单, 代码分析, 凭证管理, 多人体追踪, 存档工具, 开源项目, 插件开发, 框架注入, 游戏Mod, 游戏修改, 游戏结构文档, 算法还原, 网络安全研究, 自动化安装, 逆向工程