bannerlord-decompile
Skill1 starsChanged 14 days agoMITView on GitHub
Use when asked to decompile a Mount & Blade II Bannerlord mod, inspect what a compiled Bannerlord mod DLL does, patch or recompile a mod without its source, or look up a TaleWorlds.* API signature from the installed game assemblies. Trigger words - ilspycmd, ILSpy, BUTR reference assemblies, TaleWorlds, Bannerlord mod DLL.
In this repository30 other files it gives its agents.
- angular-crud-gotchasSkill
- aws-lightsail-container-deploySkill
- codegen-t4-templatesSkill
- csharpSkill
- delphi-code-smellsSkill
- delphi-firedacSkill
- delphiSkill
- delphi-types-and-unitsSkill
- difftasticSkill
- dockerSkill
- efcore-aspnet-reviewSkill
- git-bash-editingSkill
- github-issue-creatorSkill
- microsoft-docsSkill
- minimal-comments-and-docsSkill
- msbuildSkill
- mssqlSkill
- mstest-assertionsSkill
- mysqlSkill
- nginx-config-testingSkill
- odata-generated-gridsSkill
- postgresSkill
- powershellSkill
- react-crud-gotchasSkill
- sanitize-for-open-sourceSkill
- self-contained-deploymentSkill
- skill-writerSkill
- ui-conventionsSkill
- verify-in-running-appSkill
- winui3Skill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
If the user already has the ILSpy GUI app installed, install the matching version (check AppData\Local\Programs\ILSpy\ILSpy.exe's file …
- Very specific: line 41
Never: look for TaleWorlds.* on NuGet — it's the game's own proprietary code, never published there.
- Very specific: line 56
If the mod is split across sibling DLLs (e.g.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Bannerlord Mod Decompiling (ILSpy / ilspycmd)
Setup
dotnet tool install -g ilspycmdIf the user already has the ILSpy GUI app installed, install the matching version
(check AppData\Local\Programs\ILSpy\ILSpy.exe's file version) so output is consistent.
Decompiling
Full compilable project (one .cs file per type) — the default for recompiling:
ilspycmd "<dll>" -o "<outdir>" -pFor quick lookups without a full decompile:
ilspycmd "<dll>" -t "Fully.Qualified.TypeName" # decompile just one type
ilspycmd "<dll>" --dump-table TypeDef | grep -i Foo # RELIABLE type/nested-type existence check
ilspycmd "<dll>" --dump-table TypeRef # which external assembly a type comes from
ilspycmd "<dll>" --dump-table AssemblyRef # every assembly + version the DLL references-l c,i,s,d,e (list classes/interfaces/structs/delegates/enums) is faster to type but gave
false negatives in practice — when a -l search comes up empty and you need to be sure a type
doesn't exist, confirm with --dump-table TypeDef before concluding anything (e.g. before
telling the user an API "doesn't exist in this game version").
Getting a decompiled Bannerlord project to compile again
- Never look for
TaleWorlds.*on NuGet — it's the game's own proprietary code, never published there. Reference the BUTR community'sBannerlord.ReferenceAssemblies.Corepackage instead, pinned to the actual installed game version:Version="<gameVersion>.*-*"(e.g.1.4.8.*-*). One "Core" package bundles nearly everything a typical mod needs — confirmed to includeTaleWorlds.CampaignSystem(.ViewModelCollection),TaleWorlds.MountAndBlade,TaleWorlds.GauntletUI*,TaleWorlds.Core*,TaleWorlds.Library,TaleWorlds.TwoDimension,TaleWorlds.Localization,TaleWorlds.ObjectSystem, etc. It is not split per game module. - These reference assemblies are compile-time-only stubs (every method body is
throw null;) — fine to compile against, useless for reading real logic. To see actual behavior, decompile the real assembly from the game's ownbin\Win64_Shipping_Clientfolder instead. dotnet new install Bannerlord.Templates+dotnet new create blmodfx --name X ...scaffolds a known-good reference project fast (Harmony + reference-assemblies wiring already correct) — use the explicitcreatesubcommand; the baredotnet new blmodfx ...shorthand failed on the .NET 10 SDK. Likewisedotnet new slnon that SDK defaults to a.slnxfile, not.sln—dotnet sln x.slnx add <csproj>...still works normally.- If the mod is split across sibling DLLs (e.g.
Foo.dll+Foo.Core.dll), wire a real<ProjectReference>between their two decompiled.csprojfiles. Don't leave a<Reference><HintPath>pointing at the old original DLL — edits to the sibling project would then be silently ignored on rebuild. - Nullable/
init-accessor polyfill files (System.Diagnostics.CodeAnalysis.*,System.Runtime.CompilerServices.IsExternalInit) sometimes appear as extra loose decompiled.csfiles. Delete them before re-adding theNullable/IsExternalInitNuGet packages for<Nullable>enable</Nullable>support, or you'll get duplicate-type errors.
Fixing invalid C# that ilspycmd emits
ilspycmd's output is not always valid, compilable C# as-is — it has several systematic
decompiler artifacts. See ARTIFACTS.md for the checklist and fix pattern for each
(ref-casts, _002Ector, protected-member access through a cast, unqualified nested types, and
more) before assuming a decompile error is a real bug in the mod.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

