wukong-csharp-mod-configure

A command line tool (wukongmods) and a local web UI for managing C# Loader mods for Black Myth: Wukong:

  • enable / disable mods and edit their settings (config.json)
  • install mods from GitHub releases (or a local .zip), update them, and remove them
  • a built-in list of known mods: Visual Dodge, Perfect Dodge Reward, Faster Leveling (C#)
  • install, update, configure (b1cs.ini) and uninstall the C# Loader itself, including the version.dll that sits in Win64 outside the CSharpLoader folder
  • doctor: checks that the loader and mods are in the right places and that settings have valid values
  • serve: a web UI on http://127.0.0.1:8765 that stays in sync with the files on disk

It needs only Python 3.8+ (standard library, no packages) and curl or wget for downloads.

Platform support

The tool is written to work on Windows, Linux and macOS (paths via pathlib, Steam library detection for each OS, curl.exe on Windows 10+). It has only been tested on macOS; Windows and Linux are untested so far, so please report problems. On Linux/macOS the game usually runs through Proton/CrossOver/Whisky; point the tool at the Win64 folder inside the Steam library that your setup uses.

Install / run

No install is needed. From a checkout:

python3 -m wukongmods --help        # Windows: py -m wukongmods --help

Or install the wukongmods command with pipx (or pip):

pipx install .
wukongmods --help

The examples below write wukongmods; replace it with python3 -m wukongmods when running from a checkout.

Choosing the game folder

The tool works on the game's Win64 folder: BlackMythWukong/b1/Binaries/Win64.

On the first run you are asked to choose it; the tool lists Black Myth: Wukong installs it finds in your Steam libraries. The choice is saved in ~/.wukongmods.json (Windows: %USERPROFILE%\.wukongmods.json). You can also give the game folder (BlackMythWukong) and the tool finds Win64 in it.

wukongmods path                      # show the saved folder
wukongmods path detect               # list installs found in Steam libraries
wukongmods path set "/path/to/BlackMythWukong/b1/Binaries/Win64"
wukongmods --win64 /other/Win64 list # use another folder for one run without saving it

WUKONGMODS_PREFS=/some/file.json stores the preferences in another file.

Commands

wukongmods list                       # loader status and installed mods
wukongmods registry                   # known mods (names and aliases)

wukongmods install visualdodge        # known mod by name or alias, latest release
wukongmods install KintaroModding/wukong_dodgecooldowns --tag v1.1
wukongmods install https://github.com/owner/repo
wukongmods install ./some_mod.zip     # local release zip
wukongmods install fasterleveling --reset-config   # reinstall with default settings
wukongmods updates                    # compare installed versions with the latest releases

wukongmods disable visualdodge        # see "Enabling and disabling" below
wukongmods enable visualdodge dodgecooldowns

wukongmods config fasterleveling                  # show settings, types, ranges and help
wukongmods config fasterleveling XpDivider=3      # change settings (validated)
wukongmods config visualdodge ReactionSeconds=0.25 FlashSeconds=0.3

wukongmods remove dodgecooldowns      # delete the mod folder (asks first; -y to skip)

wukongmods loader status
wukongmods loader install             # install or update; keeps b1cs.ini and mods
wukongmods loader install --zip B1CSharpLoader-1.2.0.zip
wukongmods loader config              # show b1cs.ini settings with help
wukongmods loader config OverlayKey=F11 Console=1
wukongmods loader uninstall           # deletes version.dll and CSharpLoader/ (mods too)
wukongmods loader uninstall --keep-mods

wukongmods doctor                     # all checks; -q only warnings/errors; --json
wukongmods serve                      # web UI on http://127.0.0.1:8765

Changes to mods and settings apply at the next game start (or Ctrl+F5 in game with Develop=1). Close the game before installing or removing files; Windows locks loaded dlls.

Enabling and disabling

  • If the mod's config.json has a boolean Enable (or Enabled) setting, as all known mods do, enable / disable set it to true / false. The dll stays in place and the mod turns itself off.
  • If there is no such setting, disable renames <Mod>.dll to <Mod>.dll.disabled, and says so. The loader only loads Mods/<Mod>/<Mod>.dll, so it skips the mod. enable renames it back.
  • disable --rename uses the rename even when the mod has an Enable setting (for example, to stop a mod that crashes while loading). enable restores a renamed dll and sets Enable=true.

Reinstalling or updating a mod keeps your settings (values for settings that still exist in the new version) and keeps a renamed dll disabled.

Mod and release layout

The tool follows the C# Loader layout:

Win64/
  version.dll                    <- part of the loader, outside CSharpLoader/
  CSharpLoader/
    b1cs.ini
    Mods/<Mod>/<Mod>.dll         <- the dll name must match the folder name
    Mods/<Mod>/config.json

Release zips can contain b1/Binaries/Win64/CSharpLoader/Mods/<Mod>/... (like the known mods), <Mod>/<Mod>.dll, or a single loose <Mod>.dll. The first .zip asset of the release is used. The tool writes a small .wukongmods.json into each folder it installs, to remember the repo and version.

Set GITHUB_TOKEN if you hit the GitHub API rate limit (60 requests/hour without a token).

Doctor

wukongmods doctor (and the Doctor panel of the web UI) checks:

  • Python version, and that curl or wget is available (Python's urllib is used otherwise)
  • the folder exists, contains b1-Win64-Shipping.exe, and is writable
  • version.dll is in Win64 (not inside CSharpLoader/), all loader files are present, Mods/ exists
  • b1cs.ini has a [Settings] section with 0/1 flags and a valid OverlayKey
  • dlls placed directly in Mods/, mod folders without a matching <Mod>.dll (wrong name, extra nested folder), both <Mod>.dll and <Mod>.dll.disabled present
  • each config.json is valid JSON; for known mods, every value has the right type and range and no settings are missing
  • the newest loader log in CSharpLoader/Logs for mods that failed to load

It exits with code 1 when there are errors.

Web UI

wukongmods serve                 # opens http://127.0.0.1:8765 in your browser
wukongmods serve --port 9000 --no-browser

The page can do everything the CLI can: change the game folder, install/update/uninstall the loader and edit b1cs.ini, enable/disable/configure/update/remove mods, install known mods or any GitHub repo, and shows the doctor results.

It re-reads the files every 3 seconds (and on Refresh), so changes made by the CLI, a text editor or a reinstall show up without reloading the page. Unsaved edits in a form are kept; the form shows a note if the file changed on disk in the meantime.

The server only listens on 127.0.0.1, never on other interfaces. Changes need a random token that is only in the served page, and requests with a foreign Host header are refused, so other websites cannot change your files through it.

Development

python3 -m unittest discover -s tests

The tests build a fake Win64 folder and synthetic release zips in a temp directory; they do not touch the network or your game. See CLAUDE.md for the code layout.

S
Description
Black Myth Wukong 相关开源项目镜像
Readme MIT
81 KiB
0 Stars 1 Watchers 0 Forks
2026-11-30 09:56:59 +08:00
Languages
Python 80.3%
HTML 19.7%