Skip to content

fix: prepatcher case insensitive - #53

Open
hazre wants to merge 1 commit into
masterfrom
hazre/fix/prepatcher-case-insensitive
Open

hazre wants to merge 1 commit into
masterfrom
hazre/fix/prepatcher-case-insensitive

Conversation

@hazre

@hazre hazre commented Nov 25, 2026

Copy link
Copy Markdown
Member

I noticed prefatcher mods don't work for me correctly because I use a NTFS drive for my games on Linux, which renames all files to be lowercase, since Windows is case insensitive. I looked into it and it seems like this is actually a bug in BepInEx intended to be case insensitive but someone forgot about it.

BepInEx#111

PatcherContext.AvailableAssemblies is keyed by the on-disk file name with an
ordinal comparer, while patchers declare their target as a name such as
Game.dll. An assembly stored as game.dll - a case-preserving file system, or a
game folder that lost its casing - never matched, so the patch was skipped
without a log line. The patcher stayed loaded but inert and DumpedAssemblies
stayed empty.

Case-insensitivity is the documented intent, not a preference:

* 990b85d "Ignore case in TargetDLLs assembly names" (2020) made the
  bookkeeping copies ignore case, but the lookup kept reading the ordinal
  dictionary.
* BepInEx#111 is labelled bug and enhancement: "Preloader does
  case-sensitive checks when working with assembly filenames. This breaks
  especially on Linux where filenames are case-sensitive."

Key the patcher context dictionaries case-insensitively so the lookup honours
that intent.
@hazre
hazre requested a review from a team November 25, 2026 17:14
@github-actions

Copy link
Copy Markdown

Download the artifacts for this pull request:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant