diff --git a/.github/workflows/publish-wasm.yml b/.github/workflows/publish-wasm.yml
new file mode 100644
index 0000000..f978232
--- /dev/null
+++ b/.github/workflows/publish-wasm.yml
@@ -0,0 +1,47 @@
+name: Publish
+
+on:
+ push:
+ paths:
+ - '.github/workflows/publish-wasm.yml'
+ - 'src/**'
+ - 'build/**'
+
+env:
+ # Disable the .NET logo in the console output.
+ DOTNET_NOLOGO: true
+ # Disable the .NET first time experience to skip caching NuGet packages and speed up the build.
+ DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
+ # Disable sending .NET CLI telemetry to Microsoft.
+ DOTNET_CLI_TELEMETRY_OPTOUT: true
+
+jobs:
+ publish-wasm:
+ name: Publish WASM
+ runs-on: ubuntu-latest
+ steps:
+ - name: Setup
+ uses: butr/actions-common-setup@v2
+ with:
+ github-token: ${{secrets.GITHUB_TOKEN}}
+
+ - name: Setup .NET 9
+ uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: 9.x.x
+
+ - name: Run _build
+ run: >-
+ dotnet build external/prism-sharp/PrismSharp.SourceGenerator/PrismSharp.SourceGenerator.csproj --configuration Release;
+ dotnet build external/prism-sharp/PrismSharp.RegExCompiler/PrismSharp.RegExCompiler.csproj --configuration Release;
+ dotnet build external/prism-sharp/PrismSharp.Core/PrismSharp.Core.csproj --configuration Release;
+
+ dotnet publish src/BUTR.CrashReport.Renderer.ImGui.WASM/BUTR.CrashReport.Renderer.ImGui.WASM.csproj --configuration Release -o "./site";
+
+ - name: Deploy to GitHub Pages
+ uses: crazy-max/ghaction-github-pages@v4
+ with:
+ target_branch: gh-pages
+ build_dir: ./site
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index a9bba08..189aa68 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -26,22 +26,36 @@ jobs:
with:
github-token: ${{secrets.GITHUB_TOKEN}}
- - name: Setup .NET 8
+ - name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
- dotnet-version: 8.x.x
+ dotnet-version: 9.x.x
- name: Run _build
run: >-
+ dotnet build external/prism-sharp/PrismSharp.SourceGenerator/PrismSharp.SourceGenerator.csproj --configuration Release;
+ dotnet build external/prism-sharp/PrismSharp.RegExCompiler/PrismSharp.RegExCompiler.csproj --configuration Release;
+ dotnet build external/prism-sharp/PrismSharp.Core/PrismSharp.Core.csproj --configuration Release;
+
dotnet pack src/BUTR.CrashReport.Models/BUTR.CrashReport.Models.csproj --configuration Release -o "./packages";
+ dotnet pack src/BUTR.CrashReport.Decompilers/BUTR.CrashReport.Decompilers.csproj --configuration Release -o "./packages";
dotnet pack src/BUTR.CrashReport/BUTR.CrashReport.csproj --configuration Release -o "./packages";
- dotnet pack src/BUTR.CrashReport.Tool/BUTR.CrashReport.Tool.csproj --configuration Release -o "./packages";
+ dotnet pack src/BUTR.CrashReport.ILMerged/BUTR.CrashReport.ILMerged.csproj --configuration Release -o "./packages";
+
dotnet pack src/BUTR.CrashReport.Renderer.Html/BUTR.CrashReport.Renderer.Html.csproj --configuration Release -o "./packages";
- dotnet pack src/BUTR.CrashReport.Renderer.ImGui/BUTR.CrashReport.Renderer.ImGui.csproj --configuration Release -o "./packages";
dotnet pack src/BUTR.CrashReport.Renderer.WinForms/BUTR.CrashReport.Renderer.WinForms.csproj --configuration Release -o "./packages";
dotnet pack src/BUTR.CrashReport.Renderer.Zip/BUTR.CrashReport.Renderer.Zip.csproj --configuration Release -o "./packages";
- dotnet pack src/BUTR.CrashReport.Bannerlord.Source/BUTR.CrashReport.Bannerlord.Source.csproj --configuration Release -o "./packages";
- dotnet pack src/BUTR.CrashReport.Bannerlord.Parser/BUTR.CrashReport.Bannerlord.Parser.csproj --configuration Release -o "./packages";
+
+ dotnet pack src/BUTR.CrashReport.Memory/BUTR.CrashReport.Memory.csproj --configuration Release -o "./packages";
+ dotnet pack src/BUTR.CrashReport.Native/BUTR.CrashReport.Native.csproj --configuration Release -o "./packages";
+ dotnet pack src/BUTR.CrashReport.CImGui/BUTR.CrashReport.CImGui.csproj --configuration Release -o "./packages";
+ dotnet pack src/BUTR.CrashReport.ImGui/BUTR.CrashReport.ImGui.csproj --configuration Release -o "./packages";
+ dotnet pack src/BUTR.CrashReport.Renderer.ImGui/BUTR.CrashReport.Renderer.ImGui.csproj --configuration Release -o "./packages";
+ dotnet pack src/BUTR.CrashReport.Renderer.ImGui.Silk.NET/BUTR.CrashReport.Renderer.ImGui.Silk.NET.csproj --configuration Release -o "./packages";
+ dotnet pack src/BUTR.CrashReport.Renderer.ImGui.Silk.NET.ILMerged/BUTR.CrashReport.Renderer.ImGui.Silk.NET.ILMerged.csproj --configuration Release -o "./packages";
+
+ dotnet pack src/BUTR.CrashReport.Renderer.Html.Tool/BUTR.CrashReport.Renderer.Html.Tool.csproj --configuration Release -o "./packages";
+ dotnet pack src/BUTR.CrashReport.Renderer.ImGui.Tool/BUTR.CrashReport.Renderer.ImGui.Tool.csproj --configuration Release -o "./packages";
shell: pwsh
- name: Push to NuGet
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..6563ef6
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,12 @@
+[submodule "external/Utf8StringInterpolation"]
+ path = external/Utf8StringInterpolation
+ url = https://github.com/Cysharp/Utf8StringInterpolation
+ branch = main
+[submodule "external/ZString"]
+ path = external/ZString
+ url = https://github.com/Cysharp/ZString
+ branch = master
+[submodule "external/prism-sharp"]
+ path = external/prism-sharp
+ url = https://github.com/BUTR/prism-sharp.git
+ branch = main
diff --git a/build/common.props b/build/common.props
index 8dbe0f0..c227162 100644
--- a/build/common.props
+++ b/build/common.props
@@ -3,8 +3,8 @@
- 7
- 14.0.0.$(GITHUB_RUN_NUMBER)
+ 0
+ 15.0.0.$(GITHUB_RUN_NUMBER)11.0enable
@@ -13,7 +13,20 @@
$(DefineConstants);BUTRCRASHREPORT_ENABLEWARNINGS;
- $(NoWarn);NU1701
+ $(NoWarn);NU1701;MSB4011
+
+ true
+ embedded
+
+ 1.91.0.1
+ 1.91.0
+ 3.4.0
+ 2.30.8
+ 2.22.0
+
+
+
+ true
diff --git a/external/.editorconfig b/external/.editorconfig
new file mode 100644
index 0000000..1b6036e
--- /dev/null
+++ b/external/.editorconfig
@@ -0,0 +1,5 @@
+root = true
+
+[*]
+generated_code = true
+ij_formatter_enabled = false
\ No newline at end of file
diff --git a/external/Directory.Build.props b/external/Directory.Build.props
new file mode 100644
index 0000000..ca893c5
--- /dev/null
+++ b/external/Directory.Build.props
@@ -0,0 +1,7 @@
+
+
+
+ false
+
+
+
diff --git a/external/Utf8StringInterpolation b/external/Utf8StringInterpolation
new file mode 160000
index 0000000..d2e5842
--- /dev/null
+++ b/external/Utf8StringInterpolation
@@ -0,0 +1 @@
+Subproject commit d2e5842bf501391065985d9c29cea75ea6c8cf6a
diff --git a/external/ZString b/external/ZString
new file mode 160000
index 0000000..f4b39aa
--- /dev/null
+++ b/external/ZString
@@ -0,0 +1 @@
+Subproject commit f4b39aad95edd3350f8f06567c9d07168ac941ec
diff --git a/external/prism-sharp b/external/prism-sharp
new file mode 160000
index 0000000..7c62d69
--- /dev/null
+++ b/external/prism-sharp
@@ -0,0 +1 @@
+Subproject commit 7c62d6989222469eb098c3485848433443b5936a
diff --git a/lib/cimgui b/lib/cimgui
new file mode 160000
index 0000000..35a4e8f
--- /dev/null
+++ b/lib/cimgui
@@ -0,0 +1 @@
+Subproject commit 35a4e8f8932c6395156ffacee288b9c30e50cb63
diff --git a/src/BUTR.CrashReport.Bannerlord.Source/BUTR.CrashReport.Bannerlord.Source.csproj b/src/BUTR.CrashReport.Bannerlord.Source/BUTR.CrashReport.Bannerlord.Source.csproj
deleted file mode 100644
index 6a76a14..0000000
--- a/src/BUTR.CrashReport.Bannerlord.Source/BUTR.CrashReport.Bannerlord.Source.csproj
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
- netstandard2.0
- 9.0
- true
- $(DefineConstants);BUTRCRASHREPORT_ENABLEWARNINGS
-
-
-
- BUTR.CrashReport.Bannerlord.Source
- BUTR.CrashReport.Bannerlord.Source
- Source code for creating the crash report model and render it as HTML
- true
- MIT
- icon.png
- https://raw.githubusercontent.com/BUTR/BUTR.CrashReport/master/assets/Icon128x128.png
- butr crash report bannerlord
-
-
-
-
- false
- false
- false
- false
- false
- false
- true
- false
- false
- true
- true
-
- obj
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/BUTR.CrashReport.Bannerlord.Source/BUTR.CrashReport.Bannerlord.Source.props b/src/BUTR.CrashReport.Bannerlord.Source/BUTR.CrashReport.Bannerlord.Source.props
deleted file mode 100644
index 7c6ffd3..0000000
--- a/src/BUTR.CrashReport.Bannerlord.Source/BUTR.CrashReport.Bannerlord.Source.props
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
- false
-
-
-
-
\ No newline at end of file
diff --git a/src/BUTR.CrashReport.Bannerlord.Source/CrashReportCreatorHelper.cs b/src/BUTR.CrashReport.Bannerlord.Source/CrashReportCreatorHelper.cs
deleted file mode 100644
index 262e3b9..0000000
--- a/src/BUTR.CrashReport.Bannerlord.Source/CrashReportCreatorHelper.cs
+++ /dev/null
@@ -1,397 +0,0 @@
-//
-// This code file has automatically been added by the "BUTR.CrashReport.Bannerlord.Source" NuGet package (https://www.nuget.org/packages/BUTR.CrashReport.Bannerlord.Source).
-// Please see https://github.com/BUTR/BUTR.CrashReport for more information.
-//
-// IMPORTANT:
-// DO NOT DELETE THIS FILE if you are using a "packages.config" file to manage your NuGet references.
-// Consider migrating to PackageReferences instead:
-// https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference
-// Migrating brings the following benefits:
-// * The "BUTR.CrashReport.Bannerlord.Source" folder and the "CrashReportCreatorHelper.cs" file don't appear in your project.
-// * The added file is immutable and can therefore not be modified by coincidence.
-// * Updating/Uninstalling the package will work flawlessly.
-//
-
-#region License
-// MIT License
-//
-// Copyright (c) Bannerlord's Unofficial Tools & Resources
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-#endregion
-
-#if !BUTRCRASHREPORT_DISABLE
-#nullable enable
-#if !BUTRCRASHREPORT_ENABLEWARNINGS
-#pragma warning disable
-#endif
-
-namespace BUTR.CrashReport.Bannerlord
-{
- using global::Bannerlord.BUTR.Shared.Helpers;
- using global::Bannerlord.ModuleManager;
-
- using global::BUTR.CrashReport.Interfaces;
- using global::BUTR.CrashReport.Models;
-
- using global::HarmonyLib;
- using global::HarmonyLib.BUTR.Extensions;
-
- using global::System;
- using global::System.Collections.Generic;
- using global::System.Diagnostics;
- using global::System.IO;
- using global::System.Linq;
- using global::System.Reflection;
- using global::System.Runtime.InteropServices;
-
- internal class CrashReportInfoHelper :
- IAssemblyUtilities,
- ICrashReportMetadataProvider,
- ILoaderPluginProvider,
- IModelConverter,
- IModuleProvider,
- IPathAnonymizer
- {
- private static readonly AccessTools.FieldRef>? GetFeatures =
- AccessTools2.StaticFieldRefAccess>("Bannerlord.BLSE.FeatureIds:Features");
-
- private static List GetPlugins()
- {
- var patches = Harmony.GetAllPatchedMethods().Select(Harmony.GetPatchInfo);
- var featurePatches = patches
- .SelectMany(x => x.Prefixes.Concat(x.Postfixes).Concat(x.Finalizers).Concat(x.Transpilers))
- .Select(x => x.PatchMethod)
- .Select(x => x.DeclaringType?.Namespace)
- .OfType()
- .Where(x => x.StartsWith("Bannerlord.BLSE.Features."))
- .Select(x => x.Substring("Bannerlord.BLSE.Features.".Length))
- .Select(x => x.Substring(0, x.IndexOf('.') is var idx and not -1 ? idx : x.Length))
- .Distinct()
- .Select(x => $"BLSE.{x}")
- .ToList();
-
- if (featurePatches.Count > 0)
- featurePatches.Add("BLSE.AssemblyResolver");
-
- return featurePatches.Select(x => new LoaderPluginInfo
- {
- Id = x,
- Version = null,
- UpdateInfo = null,
- }).OfType().ToList() ?? new();
- /*
- return GetFeatures?.Invoke().Select(x => new LoaderPluginInfo()
- {
- Id = x,
- Version = null,
- UpdateInfo = null,
- }).OfType().ToList() ?? new();
- */
- }
-
- public virtual CrashReportMetadataModel GetCrashReportMetadataModel(CrashReportInfo crashReport)
- {
- var butrLoaderVersion = GetBUTRLoaderVersion(crashReport);
- var blseVersion = GetBLSEVersion(crashReport);
- var launcherExVersion = GetLauncherExVersion(crashReport);
-
- var additionalMetdata = new List();
- if (!string.IsNullOrEmpty(launcherExVersion))
- additionalMetdata.Add(new MetadataModel { Key = "LauncherExVersion", Value = launcherExVersion });
-
- return new CrashReportMetadataModel
- {
- GameName = "Bannerlord",
- GameVersion = ApplicationVersionHelper.GameVersionStr(),
-
- LoaderPluginProviderName = !string.IsNullOrEmpty(butrLoaderVersion) ? "BUTRLoader" : !string.IsNullOrEmpty(blseVersion) ? "BLSE" : null,
- LoaderPluginProviderVersion = !string.IsNullOrEmpty(butrLoaderVersion) ? butrLoaderVersion : !string.IsNullOrEmpty(blseVersion) ? blseVersion : null,
-
- LauncherType = GetLauncherType(crashReport),
- LauncherVersion = GetLauncherVersion(crashReport),
-
- Runtime = null,
-
- OperatingSystemType = GetOperatingSystemType(),
- OperatingSystemVersion = GetOSVersion(),
-
- AdditionalMetadata = additionalMetdata,
- };
- }
-
- private static OperatingSystemType GetOperatingSystemType()
- {
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
- {
- if (OSUtilities.IsWine())
- return OperatingSystemType.WindowsOnWine;
- return OperatingSystemType.Windows;
- }
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
- return OperatingSystemType.Linux;
- if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
- return OperatingSystemType.MacOS;
- return OperatingSystemType.Unknown;
- }
-
- private static string? GetOSVersion()
- {
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
- return OSUtilities.GetOSVersionWindows();
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
- return OSUtilities.GetOSVersionLinux();
- if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
- return OSUtilities.GetOSXVersion();
- return null;
- }
-
- public virtual IEnumerable Assemblies() => AccessTools2.AllAssemblies();
-
- public IEnumerable TypesFromAssembly(Assembly assembly) => AccessTools.GetTypesFromAssembly(assembly);
-
- public virtual IModuleInfo? GetAssemblyModule(CrashReportInfo crashReport, Assembly assembly)
- {
- try
- {
- var module = !assembly.IsDynamic ? ModuleInfoHelper.GetModuleByType(AccessTools2.GetTypesFromAssembly(assembly).FirstOrDefault()) : null;
- return module is not null ? crashReport.LoadedModules.FirstOrDefault(x => x.Id == module.Id) : null;
- }
- catch (Exception e)
- {
- Trace.TraceError(e.ToString());
- return null;
- }
- }
-
- public virtual ILoaderPluginInfo? GetAssemblyPlugin(CrashReportInfo crashReport, Assembly assembly) => null;
-
- public virtual AssemblyType GetAssemblyType(AssemblyType type, CrashReportInfo crashReport, Assembly assembly)
- {
- static bool IsTWCore(Assembly assembly)
- {
- if (assembly.IsDynamic || string.IsNullOrEmpty(assembly.Location))
- return false;
- var configurationFolder = Path.GetDirectoryName(assembly.Location);
- var binFolder = Path.GetDirectoryName(configurationFolder);
- if (!string.Equals(Path.GetFileName(binFolder), "bin", StringComparison.OrdinalIgnoreCase))
- return false;
- var moduleFolder = Path.GetDirectoryName(binFolder);
- var modulesFolder = Path.GetDirectoryName(moduleFolder);
- if (string.Equals(Path.GetFileName(modulesFolder), "Modules", StringComparison.OrdinalIgnoreCase))
- return false;
-
- return true;
- }
-
- if (IsTWCore(assembly)) type |= AssemblyType.GameCore;
-
- var module = !assembly.IsDynamic ? ModuleInfoHelper.GetModuleByType(AccessTools2.GetTypesFromAssembly(assembly).FirstOrDefault()) : null;
- if (module is not null && !module.IsOfficial) type |= AssemblyType.Module;
- if (module is not null && module.IsOfficial) type |= AssemblyType.GameModule;
-
- return type;
- }
-
-
- public virtual ICollection GetLoadedModules() => ModuleInfoHelper.GetLoadedModules().Select(x => new ModuleInfo(x)).ToArray();
-
- public virtual IModuleInfo? GetModuleByType(Type? type) => ModuleInfoHelper.GetModuleByType(type) is { } moduleInfo ? new ModuleInfo(moduleInfo) : null;
-
-
- public virtual ICollection GetLoadedLoaderPlugins() => GetPlugins();
-
- public virtual ILoaderPluginInfo? GetLoaderPluginByType(Type? type)
- {
- if (type is null)
- return null;
-
- if (type.Namespace is null || !type.Namespace.StartsWith("Bannerlord.BLSE.Features."))
- return null;
-
- var id = type.Namespace.Substring("Bannerlord.BLSE.Features.".Length);
- id = id.Substring(0, id.IndexOf('.') is var idx and not -1 ? idx : id.Length);
- return new LoaderPluginInfo
- {
- Id = $"BLSE.{id}",
- Version = null,
- UpdateInfo = null,
- };
- }
-
-
- public virtual List ToModuleModels(ICollection loadedModules, ICollection assemblies)
- {
- var moduleModels = new List(loadedModules.Count);
- foreach (var module in loadedModules.OfType().Select(x => x.InternalModuleInfo))
- {
- var isManagedByVortex = File.Exists(Path.Combine(module.Path, "__folder_managed_by_vortex"));
-
- moduleModels.Add(Convert(module, isManagedByVortex, assemblies));
- }
- return moduleModels;
- }
-
- public virtual List ToLoaderPluginModels(ICollection loadedLoaderPlugins, ICollection assemblies) => loadedLoaderPlugins.OfType().Select(x => new LoaderPluginModel
- {
- Id = x.Id,
- Name = x.Id,
- Version = x.Version,
- UpdateInfo = x.UpdateInfo is not null && x.UpdateInfo.Split(':') is { Length: 2 } split ? new UpdateInfo
- {
- Provider = split[0],
- Value = split[1],
- } : null,
- Dependencies = Array.Empty(),
- Capabilities = Array.Empty(),
- AdditionalMetadata = Array.Empty(),
- }).ToList();
-
-
- public virtual bool TryHandlePath(string path, out string anonymizedPath)
- {
- anonymizedPath = string.Empty;
-
- if (path.IndexOf("Mount & Blade II Bannerlord", StringComparison.OrdinalIgnoreCase) is var idxRoot and not -1)
- {
- anonymizedPath = path.Substring(idxRoot);
- return true;
- }
-
- if (path.IndexOf("Mount & Blade II- Bannerlord", StringComparison.OrdinalIgnoreCase) is var idxRoot2 and not -1)
- {
- anonymizedPath = path.Substring(idxRoot2);
- return true;
- }
-
- return false;
- }
-
- protected static ModuleModel Convert(ModuleInfoExtendedHelper module, bool isManagedByVortex, ICollection assemblies)
- {
- var updateInfos = module.UpdateInfo.Split(';').Select(x => x.Split(':') is { Length: 2 } split ? new UpdateInfo()
- {
- Provider = split[0],
- Value = split[1],
- } : null).OfType().ToArray();
- var capabilities = new List();
- var moduleModel = new ModuleModel
- {
- Id = module.Id,
- Name = module.Name,
- Version = module.Version.ToString(),
- IsExternal = module.IsExternal,
- IsOfficial = module.IsOfficial,
- IsSingleplayer = module.IsSingleplayerModule,
- IsMultiplayer = module.IsMultiplayerModule,
- Url = !string.IsNullOrEmpty(module.Url) ? module.Url : null,
- UpdateInfo = updateInfos.FirstOrDefault(),
- DependencyMetadatas = module.DependenciesAllDistinct().Select(x => new DependencyMetadataModel
- {
- ModuleOrPluginId = x.Id,
- Type = x.IsIncompatible ? DependencyMetadataType.Incompatible : (DependencyMetadataType) x.LoadType,
- IsOptional = x.IsOptional,
- Version = !x.Version.Equals(ApplicationVersion.Empty) ? x.Version.ToString() : null,
- VersionRange = !x.VersionRange.Equals(ApplicationVersionRange.Empty) ? x.VersionRange.ToString() : null,
- AdditionalMetadata = Array.Empty(),
- }).ToArray(),
- SubModules = module.SubModules.Where(ModuleInfoHelper.CheckIfSubModuleCanBeLoaded).Select(x => new ModuleSubModuleModel
- {
- Name = x.Name,
- AssemblyId = new()
- {
- Name = x.DLLName,
- Version = null,
- PublicKeyToken = null,
- },
- Entrypoint = x.SubModuleClassType,
- AdditionalMetadata = x.Assemblies.Select(y => new MetadataModel { Key = "METADATA:Assembly", Value = y })
- .Concat(x.Tags.SelectMany(y => y.Value.Select(z => new MetadataModel { Key = y.Key, Value = z })))
- .ToArray(),
- }).ToArray(),
- Capabilities = capabilities,
- AdditionalMetadata = new MetadataModel[]
- {
- new MetadataModel { Key = "AdditionalUpdateInfos", Value = string.Join(";", updateInfos.Skip(1).Select(x => $"{x.Provider}:{x.Value}")) },
- new MetadataModel { Key = "METADATA:MANAGED_BY_VORTEX", Value = isManagedByVortex.ToString() },
- },
- };
- capabilities.AddRange(CollectionsExtensions.DistinctBy(CrashReportShared.GetModuleCapabilities(assemblies, moduleModel), x => x.Name));
- return moduleModel;
- }
-
- protected static string GetBUTRLoaderVersion(CrashReportInfo crashReport)
- {
- if (crashReport.AvailableAssemblies.FirstOrDefault(x => x.Key.Name == "Bannerlord.BUTRLoader") is { Key: { } assemblyName } )
- return assemblyName.Version?.ToString() ?? string.Empty;
- return string.Empty;
- }
- protected static string GetBLSEVersion(CrashReportInfo crashReport)
- {
- var blseMetadata = crashReport.AvailableAssemblies.FirstOrDefault(x => x.Key.Name == "Bannerlord.BLSE.Shared").Value?.GetCustomAttributes();
- return blseMetadata?.FirstOrDefault(x => x.Key == "BLSEVersion")?.Value ?? string.Empty;
- }
- protected static string GetLauncherExVersion(CrashReportInfo crashReport)
- {
- var launcherExMetadata = crashReport.AvailableAssemblies.FirstOrDefault(x => x.Key.Name == "Bannerlord.LauncherEx").Value?.GetCustomAttributes();
- return launcherExMetadata?.FirstOrDefault(x => x.Key == "LauncherExVersion")?.Value ?? string.Empty;
- }
-
- protected static string GetLauncherType(CrashReportInfo crashReport)
- {
- if (crashReport.AdditionalMetadata.TryGetValue("Parent_Process_Name", out var parentProcessName))
- {
- return parentProcessName switch
- {
- "Vortex" => "vortex",
- "BannerLordLauncher" => "bannerlordlauncher",
- "steam" => "steam",
- "GalaxyClient" => "gog",
- "EpicGamesLauncher" => "epicgames",
- "devenv" => "debuggervisualstudio",
- "JetBrains.Debugger.Worker64c" => "debuggerjetbrains",
- "explorer" => "explorer",
- "NovusLauncher" => "novus",
- "ModOrganizer" => "modorganizer",
- _ => $"unknown launcher - {parentProcessName}"
- };
- }
-
- if (!string.IsNullOrEmpty(GetBUTRLoaderVersion(crashReport)))
- return "butrloader";
-
- return "vanilla";
- }
-
- protected static string GetLauncherVersion(CrashReportInfo crashReport)
- {
- if (crashReport.AdditionalMetadata.TryGetValue("Parent_Process_File_Version", out var parentProcessFileVersion))
- return parentProcessFileVersion;
-
- if (GetBUTRLoaderVersion(crashReport) is { } bVersion && !string.IsNullOrEmpty(bVersion))
- return bVersion;
-
- return "0";
- }
- }
-}
-
-#pragma warning restore
-#nullable restore
-#endif // BUTRCRASHREPORT_DISABLE
\ No newline at end of file
diff --git a/src/BUTR.CrashReport.Bannerlord.Source/CrashReportShared.cs b/src/BUTR.CrashReport.Bannerlord.Source/CrashReportShared.cs
deleted file mode 100644
index 0e9d623..0000000
--- a/src/BUTR.CrashReport.Bannerlord.Source/CrashReportShared.cs
+++ /dev/null
@@ -1,194 +0,0 @@
-//
-// This code file has automatically been added by the "BUTR.CrashReport.Bannerlord.Source" NuGet package (https://www.nuget.org/packages/BUTR.CrashReport.Bannerlord.Source).
-// Please see https://github.com/BUTR/BUTR.CrashReport for more information.
-//
-// IMPORTANT:
-// DO NOT DELETE THIS FILE if you are using a "packages.config" file to manage your NuGet references.
-// Consider migrating to PackageReferences instead:
-// https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference
-// Migrating brings the following benefits:
-// * The "BUTR.CrashReport.Bannerlord.Source" folder and the "CrashReportShared.cs" file don't appear in your project.
-// * The added file is immutable and can therefore not be modified by coincidence.
-// * Updating/Uninstalling the package will work flawlessly.
-//
-
-#region License
-// MIT License
-//
-// Copyright (c) Bannerlord's Unofficial Tools & Resources
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-#endregion
-
-#if !BUTRCRASHREPORT_DISABLE || BUTRCRASHREPORT_ENABLE_HTML_RENDERER
-#nullable enable
-#if !BUTRCRASHREPORT_ENABLEWARNINGS
-#pragma warning disable
-#endif
-
-namespace BUTR.CrashReport.Bannerlord
-{
- using global::BUTR.CrashReport.Extensions;
- using global::BUTR.CrashReport.Models;
-
- using global::System.Collections.Generic;
- using global::System.Linq;
-
- internal static class CrashReportShared
- {
- // Inspired by SMAPI's detection
- // Still Work In Progress for more complex capabilities
- private static readonly string[] OSFileSystemTypeReferences = new[]
- {
- typeof(System.IO.File).FullName!,
- typeof(System.IO.FileStream).FullName!,
- typeof(System.IO.FileInfo).FullName!,
- typeof(System.IO.Directory).FullName!,
- typeof(System.IO.DirectoryInfo).FullName!,
- typeof(System.IO.DriveInfo).FullName!,
- typeof(System.IO.FileSystemWatcher).FullName!,
- };
- private static readonly string[] GameFileSystemTypeReferences = new[]
- {
- "TaleWorlds.Library.*File*",
- "TaleWorlds.Library.*Directory*",
- "TaleWorlds.SaveSystem.*File*",
- };
- private static readonly string[] ShellTypeReferences = new[]
- {
- typeof(System.Diagnostics.Process).FullName!,
- };
- private static readonly string[] SaveSystemTypeReferences = new[]
- {
- "TaleWorlds.Library.*Save*",
- "TaleWorlds.Core.MBSaveLoad",
- };
- private static readonly string[] SaveSystemAssemblyReferences = new[]
- {
- "TaleWorlds.SaveSystem",
- };
- private static readonly string[] GameEntitiesTypeReferences = new[]
- {
- "TaleWorlds.Core.EntitySystem*",
- };
- private static readonly string[] GameEntitiesAssemblyReferences = new[]
- {
- "TaleWorlds.ObjectSystem",
- };
- private static readonly string[] InputSystemAssemblyReferences = new[]
- {
- "TaleWorlds.InputSystem",
- };
- private static readonly string[] LocalizationSystemAssemblyReferences = new[]
- {
- "TaleWorlds.Localization",
- };
- private static readonly string[] UITypeReferences = new[]
- {
- "TaleWorlds.Library.IViewModel",
- "TaleWorlds.Library.ViewModel",
- };
- private static readonly string[] UIAssemblyReferences = new[]
- {
- "*GauntletUI*",
- };
- private static readonly string[] HttpTypeReferences = new[]
- {
- "TaleWorlds.Library.*Http*",
- "System.Net*Http.*",
- };
- private static readonly string[] AchievementSystemTypeReferences = new[]
- {
- "TaleWorlds.*Achievement*",
- };
- private static readonly string[] CampaignSystemTypeReferences = new[]
- {
- "TaleWorlds.*CampaignSystem*",
- };
- private static readonly string[] SkillSystemTypeReferences = new[]
- {
- "TaleWorlds.Core.CharacterSkills",
- "TaleWorlds.Core.DefaultSkills",
- "TaleWorlds.Core.SkillObject",
- };
- private static readonly string[] ItemSystemTypeReferences = new[]
- {
- "TaleWorlds.Core.ItemObject",
- };
- private static readonly string[] CultureSystemTypeReferences = new[]
- {
- "TaleWorlds.*Culture*",
- };
-
- public static IEnumerable GetModuleCapabilities(ICollection assemblies, ModuleModel module)
- {
- if (module.ContainsTypeReferences(assemblies, CrashReportShared.OSFileSystemTypeReferences))
- yield return new CapabilityModel("OS File System");
-
- if (module.ContainsTypeReferences(assemblies, CrashReportShared.GameFileSystemTypeReferences))
- yield return new CapabilityModel("Game File System");
-
- if (module.ContainsTypeReferences(assemblies, CrashReportShared.ShellTypeReferences))
- yield return new CapabilityModel("Shell");
-
- if (module.ContainsTypeReferences(assemblies, CrashReportShared.SaveSystemTypeReferences))
- yield return new CapabilityModel("Save System");
- if (module.ContainsAssemblyReferences(assemblies, CrashReportShared.SaveSystemAssemblyReferences))
- yield return new CapabilityModel("Save System");
-
- if (module.ContainsTypeReferences(assemblies, CrashReportShared.GameEntitiesTypeReferences))
- yield return new CapabilityModel("Game Entities");
- if (module.ContainsAssemblyReferences(assemblies, CrashReportShared.GameEntitiesAssemblyReferences))
- yield return new CapabilityModel("Game Entities");
-
- if (module.ContainsAssemblyReferences(assemblies, CrashReportShared.InputSystemAssemblyReferences))
- yield return new CapabilityModel("Input System");
-
- if (module.ContainsAssemblyReferences(assemblies, CrashReportShared.LocalizationSystemAssemblyReferences))
- yield return new CapabilityModel("Localization");
-
- if (module.ContainsTypeReferences(assemblies, CrashReportShared.UITypeReferences))
- yield return new CapabilityModel("User Interface");
- if (module.ContainsAssemblyReferences(assemblies, CrashReportShared.UIAssemblyReferences))
- yield return new CapabilityModel("User Interface");
-
- if (module.ContainsTypeReferences(assemblies, CrashReportShared.HttpTypeReferences))
- yield return new CapabilityModel("Http");
-
- if (module.ContainsTypeReferences(assemblies, CrashReportShared.AchievementSystemTypeReferences))
- yield return new CapabilityModel("Achievements");
-
- if (module.ContainsTypeReferences(assemblies, CrashReportShared.CampaignSystemTypeReferences))
- yield return new CapabilityModel("Campaign");
-
- if (module.ContainsTypeReferences(assemblies, CrashReportShared.SkillSystemTypeReferences))
- yield return new CapabilityModel("Skills");
-
- if (module.ContainsTypeReferences(assemblies, CrashReportShared.ItemSystemTypeReferences))
- yield return new CapabilityModel("Items");
-
- if (module.ContainsTypeReferences(assemblies, CrashReportShared.CultureSystemTypeReferences))
- yield return new CapabilityModel("Cultures");
- }
- }
-}
-
-#pragma warning restore
-#nullable restore
-#endif // BUTRCRASHREPORT_DISABLE
\ No newline at end of file
diff --git a/src/BUTR.CrashReport.Bannerlord.Source/HarmonyProvider.cs b/src/BUTR.CrashReport.Bannerlord.Source/HarmonyProvider.cs
deleted file mode 100644
index 6fc5cbb..0000000
--- a/src/BUTR.CrashReport.Bannerlord.Source/HarmonyProvider.cs
+++ /dev/null
@@ -1,260 +0,0 @@
-//
-// This code file has automatically been added by the "BUTR.CrashReport.Bannerlord.Source" NuGet package (https://www.nuget.org/packages/BUTR.CrashReport.Bannerlord.Source).
-// Please see https://github.com/BUTR/BUTR.CrashReport for more information.
-//
-// IMPORTANT:
-// DO NOT DELETE THIS FILE if you are using a "packages.config" file to manage your NuGet references.
-// Consider migrating to PackageReferences instead:
-// https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference
-// Migrating brings the following benefits:
-// * The "BUTR.CrashReport.Bannerlord.Source" folder and the "HarmonyProvider.cs" file don't appear in your project.
-// * The added file is immutable and can therefore not be modified by coincidence.
-// * Updating/Uninstalling the package will work flawlessly.
-//
-
-#region License
-// MIT License
-//
-// Copyright (c) Bannerlord's Unofficial Tools & Resources
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-#endregion
-
-using TaleWorlds.MountAndBlade.GauntletUI.Widgets.Multiplayer.Lobby;
-
-#if !BUTRCRASHREPORT_DISABLE
-#nullable enable
-#if !BUTRCRASHREPORT_ENABLEWARNINGS
-#pragma warning disable
-#endif
-
-namespace BUTR.CrashReport.Bannerlord
-{
- using global::BUTR.CrashReport.Interfaces;
- using global::BUTR.CrashReport.Models;
-
- using global::HarmonyLib;
- using global::HarmonyLib.BUTR.Extensions;
-
- using global::System;
- using global::System.Collections;
- using global::System.Collections.Generic;
- using global::System.Diagnostics;
- using global::System.Linq;
- using global::System.Reflection;
-
- using static global::HarmonyLib.BUTR.Extensions.AccessTools2;
-
- public class PatchProvider : IPatchProvider
- {
- private static IEnumerable GetPatches(string type, MethodBase originalMethod, IEnumerable patches) => patches.Select(x => new RuntimePatch
- {
- PatchProvider = "Harmony",
- PatchType = type,
- Original = originalMethod,
- Patch = x.PatchMethod,
- AdditionalMetadata = new List
- {
- new("Owner", x.owner),
- new("Index", x.index.ToString()),
- new("Priority", x.priority.ToString()),
- new("Before", string.Join(", ", x.before)),
- new("After", string.Join(", ", x.after)),
- },
- });
-
- public IList GetAllPatches()
- {
- var runtimePatches = new List();
-
- foreach (var originalMethod in Harmony.GetAllPatchedMethods())
- {
- var patches = Harmony.GetPatchInfo(originalMethod);
- if (patches is null) continue;
-
- runtimePatches.AddRange(GetPatches(originalMethod));
- }
-
- return runtimePatches;
- }
-
- public IList GetPatches(MethodBase originalMethod)
- {
- var patches = Harmony.GetPatchInfo(originalMethod);
- if (patches is null) return new List();
-
- var runtimePatches = new List();
- runtimePatches.AddRange(GetPatches("Prefix", originalMethod, patches.Prefixes));
- runtimePatches.AddRange(GetPatches("Postfixes", originalMethod, patches.Postfixes));
- runtimePatches.AddRange(GetPatches("Finalizers", originalMethod, patches.Finalizers));
- runtimePatches.AddRange(GetPatches("Transpilers", originalMethod, patches.Transpilers));
-
- return runtimePatches;
- }
-
- public StackFrameRuntimePatch? GetPatches(StackFrame frame)
- {
- MethodBase? executingMethod;
- var methodFromStackframeIssue = false;
- try
- {
- executingMethod = Harmony.GetMethodFromStackframe(frame);
- }
- // NullReferenceException means the method was not found. Harmony doesn't handle this case gracefully
- catch (NullReferenceException e)
- {
- Trace.TraceError(e.ToString());
- executingMethod = frame.GetMethod()!;
- }
- // The given generic instantiation was invalid.
- // From what I understand, this will occur with generic methods
- // Also when static constructors throw errors, Harmony resolution will fail
- catch (Exception e)
- {
- Trace.TraceError(e.ToString());
- methodFromStackframeIssue = true;
- executingMethod = frame.GetMethod()!;
- }
-
- return null;
- //return GetPatches(executingMethod);
- }
-
- public MethodBase GetOriginalMethod(StackFrame frame)
- {
- try
- {
- if (Harmony.GetMethodFromStackframe(frame) is MethodInfo method)
- return Harmony.GetOriginalMethod(method);
- }
- catch (Exception e)
- {
- Trace.TraceError(e.ToString());
- }
- return frame.GetMethod();
- }
-
- public IntPtr GetNativeMethodBody(MethodBase method)
- {
- try
- {
- return MonoModUtils.GetNativeMethodBody(method);
- }
- catch (Exception e)
- {
- Trace.TraceError(e.ToString());
- return IntPtr.Zero;
- }
- }
- }
-
- /*
- public class HarmonyProvider : IHarmonyProvider
- {
- public virtual IEnumerable GetAllPatchedMethods() => Harmony.GetAllPatchedMethods();
-
- public virtual global::BUTR.CrashReport.Models.HarmonyPatches? GetPatchInfo(MethodBase originalMethod)
- {
- static global::BUTR.CrashReport.Models.HarmonyPatch Convert(Patch patch, global::BUTR.CrashReport.Models.HarmonyPatchType type) => new()
- {
- Owner = patch.owner,
- Index = patch.index,
- Priority = patch.priority,
- Before = patch.before,
- After = patch.after,
- PatchMethod = patch.PatchMethod,
- Type = type,
- };
-
- var patches = Harmony.GetPatchInfo(originalMethod);
- if (patches is null) return null;
- return new()
- {
- Prefixes = patches.Prefixes.Select(x => Convert(x, Models.HarmonyPatchType.Prefix)).ToArray(),
- Postfixes = patches.Postfixes.Select(x => Convert(x, Models.HarmonyPatchType.Postfix)).ToArray(),
- Finalizers = patches.Finalizers.Select(x => Convert(x, Models.HarmonyPatchType.Finalizer)).ToArray(),
- Transpilers = patches.Transpilers.Select(x => Convert(x, Models.HarmonyPatchType.Transpiler)).ToArray(),
- };
- }
-
- public virtual HarmonyPatches? GetPatchInfo(StackFrame frame, IModuleProvider moduleProvider, ILoaderPluginProvider loaderPluginProvider)
- {
- MethodBase? executingMethod;
- var methodFromStackframeIssue = false;
- try
- {
- executingMethod = Harmony.GetMethodFromStackframe(frame);
- }
- // NullReferenceException means the method was not found. Harmony doesn't handle this case gracefully
- catch (NullReferenceException e)
- {
- Trace.TraceError(e.ToString());
- executingMethod = frame.GetMethod()!;
- }
- // The given generic instantiation was invalid.
- // From what I understand, this will occur with generic methods
- // Also when static constructors throw errors, Harmony resolution will fail
- catch (Exception e)
- {
- Trace.TraceError(e.ToString());
- methodFromStackframeIssue = true;
- executingMethod = frame.GetMethod()!;
- }
-
- var executingIdentifiableMethod = executingMethod is MethodInfo mi ? MonoModUtils.GetIdentifiable(mi) as MethodInfo ?? mi : null;
- var originalIdentifiableMethod = executingIdentifiableMethod is not null ? Harmony.GetOriginalMethod(executingIdentifiableMethod) : null;
- return originalIdentifiableMethod is not null ? GetPatchInfo(originalIdentifiableMethod) : null;
- }
-
- public virtual MethodInfo? GetExecutingMethod(StackFrame frame)
- {
- try
- {
- if (Harmony.GetMethodFromStackframe(frame) is MethodInfo method)
- return method;
- }
- catch (Exception e)
- {
- Trace.TraceError(e.ToString());
- }
- return null;
- }
-
- public virtual MethodBase? GetOriginalMethod(StackFrame frame)
- {
- try
- {
- if (Harmony.GetMethodFromStackframe(frame) is MethodInfo method)
- return Harmony.GetOriginalMethod(method);
- }
- catch (Exception e)
- {
- Trace.TraceError(e.ToString());
- }
- return null;
- }
-
- public IntPtr GetNativeMethodBody(MethodBase method) => MonoModUtils.GetNativeMethodBody(method);
- }
- */
-}
-
-#pragma warning restore
-#nullable restore
-#endif // BUTRCRASHREPORT_DISABLE
\ No newline at end of file
diff --git a/src/BUTR.CrashReport.Bannerlord.Source/LoaderPluginInfo.cs b/src/BUTR.CrashReport.Bannerlord.Source/LoaderPluginInfo.cs
deleted file mode 100644
index f616ec2..0000000
--- a/src/BUTR.CrashReport.Bannerlord.Source/LoaderPluginInfo.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// This code file has automatically been added by the "BUTR.CrashReport.Bannerlord.Source" NuGet package (https://www.nuget.org/packages/BUTR.CrashReport.Bannerlord.Source).
-// Please see https://github.com/BUTR/BUTR.CrashReport for more information.
-//
-// IMPORTANT:
-// DO NOT DELETE THIS FILE if you are using a "packages.config" file to manage your NuGet references.
-// Consider migrating to PackageReferences instead:
-// https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference
-// Migrating brings the following benefits:
-// * The "BUTR.CrashReport.Bannerlord.Source" folder and the "LoaderPluginInfo.cs" file don't appear in your project.
-// * The added file is immutable and can therefore not be modified by coincidence.
-// * Updating/Uninstalling the package will work flawlessly.
-//
-
-#region License
-// MIT License
-//
-// Copyright (c) Bannerlord's Unofficial Tools & Resources
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-#endregion
-
-#if !BUTRCRASHREPORT_DISABLE
-#nullable enable
-#if !BUTRCRASHREPORT_ENABLEWARNINGS
-#pragma warning disable
-#endif
-
-namespace BUTR.CrashReport.Bannerlord
-{
- using global::BUTR.CrashReport.Models;
-
- internal class LoaderPluginInfo : ILoaderPluginInfo
- {
- ///
- public string Id { get; set; } = string.Empty;
-
- ///
- public string? Version { get; set; }
-
- ///
- public string? UpdateInfo { get; set; }
- }
-}
-
-#pragma warning restore
-#nullable restore
-#endif // BUTRCRASHREPORT_DISABLE
\ No newline at end of file
diff --git a/src/BUTR.CrashReport.Bannerlord.Source/ModuleInfo.cs b/src/BUTR.CrashReport.Bannerlord.Source/ModuleInfo.cs
deleted file mode 100644
index 156e48b..0000000
--- a/src/BUTR.CrashReport.Bannerlord.Source/ModuleInfo.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// This code file has automatically been added by the "BUTR.CrashReport.Bannerlord.Source" NuGet package (https://www.nuget.org/packages/BUTR.CrashReport.Bannerlord.Source).
-// Please see https://github.com/BUTR/BUTR.CrashReport for more information.
-//
-// IMPORTANT:
-// DO NOT DELETE THIS FILE if you are using a "packages.config" file to manage your NuGet references.
-// Consider migrating to PackageReferences instead:
-// https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference
-// Migrating brings the following benefits:
-// * The "BUTR.CrashReport.Bannerlord.Source" folder and the "ModuleInfo.cs" file don't appear in your project.
-// * The added file is immutable and can therefore not be modified by coincidence.
-// * Updating/Uninstalling the package will work flawlessly.
-//
-
-#region License
-// MIT License
-//
-// Copyright (c) Bannerlord's Unofficial Tools & Resources
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-#endregion
-
-#if !BUTRCRASHREPORT_DISABLE
-#nullable enable
-#if !BUTRCRASHREPORT_ENABLEWARNINGS
-#pragma warning disable
-#endif
-
-namespace BUTR.CrashReport.Bannerlord
-{
- using global::Bannerlord.BUTR.Shared.Helpers;
-
- using global::BUTR.CrashReport.Models;
-
- using global::System.Collections.Generic;
- using global::System.Linq;
-
- internal class ModuleInfo : IModuleInfo
- {
- public ModuleInfoExtendedHelper InternalModuleInfo { get; }
-
- public string Id => InternalModuleInfo.Id;
- public string Version => InternalModuleInfo.Version.ToString();
- public string UpdateInfo => InternalModuleInfo.UpdateInfo;
-
- public IEnumerable SubModules => InternalModuleInfo.SubModules.Select(x => new ModuleSubModuleInfo(x));
-
- public ModuleInfo(ModuleInfoExtendedHelper internalModuleInfo) => InternalModuleInfo = internalModuleInfo;
- }
-}
-
-#pragma warning restore
-#nullable restore
-#endif // BUTRCRASHREPORT_DISABLE
\ No newline at end of file
diff --git a/src/BUTR.CrashReport.Bannerlord.Source/ModuleSubModuleInfo.cs b/src/BUTR.CrashReport.Bannerlord.Source/ModuleSubModuleInfo.cs
deleted file mode 100644
index f698950..0000000
--- a/src/BUTR.CrashReport.Bannerlord.Source/ModuleSubModuleInfo.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// This code file has automatically been added by the "BUTR.CrashReport.Bannerlord.Source" NuGet package (https://www.nuget.org/packages/BUTR.CrashReport.Bannerlord.Source).
-// Please see https://github.com/BUTR/BUTR.CrashReport for more information.
-//
-// IMPORTANT:
-// DO NOT DELETE THIS FILE if you are using a "packages.config" file to manage your NuGet references.
-// Consider migrating to PackageReferences instead:
-// https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference
-// Migrating brings the following benefits:
-// * The "BUTR.CrashReport.Bannerlord.Source" folder and the "ModuleSubModuleInfo.cs" file don't appear in your project.
-// * The added file is immutable and can therefore not be modified by coincidence.
-// * Updating/Uninstalling the package will work flawlessly.
-//
-
-#region License
-// MIT License
-//
-// Copyright (c) Bannerlord's Unofficial Tools & Resources
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-#endregion
-
-#if !BUTRCRASHREPORT_DISABLE
-#nullable enable
-#if !BUTRCRASHREPORT_ENABLEWARNINGS
-#pragma warning disable
-#endif
-
-namespace BUTR.CrashReport.Bannerlord
-{
- using global::Bannerlord.ModuleManager;
- using global::BUTR.CrashReport.Models;
-
- using global::System.Linq;
-
- internal class ModuleSubModuleInfo : IModuleSubModuleInfo
- {
- public SubModuleInfoExtended InternalSubModuleInfo { get; }
-
- public string AssemblyFile => InternalSubModuleInfo.DLLName;
- public string[] Dependencies => InternalSubModuleInfo.Assemblies.ToArray();
-
- public ModuleSubModuleInfo(SubModuleInfoExtended internalSubModuleInfo) => InternalSubModuleInfo = internalSubModuleInfo;
- }
-}
-
-#pragma warning restore
-#nullable restore
-#endif // BUTRCRASHREPORT_DISABLE
\ No newline at end of file
diff --git a/src/BUTR.CrashReport.Bannerlord.Source/MonoModProvider.cs b/src/BUTR.CrashReport.Bannerlord.Source/MonoModProvider.cs
deleted file mode 100644
index 75ee1a0..0000000
--- a/src/BUTR.CrashReport.Bannerlord.Source/MonoModProvider.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-// This code file has automatically been added by the "BUTR.CrashReport.Bannerlord.Source" NuGet package (https://www.nuget.org/packages/BUTR.CrashReport.Bannerlord.Source).
-// Please see https://github.com/BUTR/BUTR.CrashReport for more information.
-//
-// IMPORTANT:
-// DO NOT DELETE THIS FILE if you are using a "packages.config" file to manage your NuGet references.
-// Consider migrating to PackageReferences instead:
-// https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference
-// Migrating brings the following benefits:
-// * The "BUTR.CrashReport.Bannerlord.Source" folder and the "MonoModProvider.cs" file don't appear in your project.
-// * The added file is immutable and can therefore not be modified by coincidence.
-// * Updating/Uninstalling the package will work flawlessly.
-//
-
-#region License
-// MIT License
-//
-// Copyright (c) Bannerlord's Unofficial Tools & Resources
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-#endregion
-
-#if !BUTRCRASHREPORT_DISABLE
-#nullable enable
-#if !BUTRCRASHREPORT_ENABLEWARNINGS
-#pragma warning disable
-#endif
-
-namespace BUTR.CrashReport.Bannerlord
-{
- /*
- using global::BUTR.CrashReport.Interfaces;
- using global::BUTR.CrashReport.Models;
-
- using global::HarmonyLib;
- using global::HarmonyLib.BUTR.Extensions;
-
- using global::System;
- using global::System.Collections;
- using global::System.Collections.Generic;
- using global::System.Diagnostics;
- using global::System.Linq;
- using global::System.Reflection;
-
- using static global::HarmonyLib.BUTR.Extensions.AccessTools2;
-
- public class MonoModProvider : IMonoModProvider
- {
- public virtual IEnumerable GetAllPatchedMethods() => Harmony.GetAllPatchedMethods();
-
- public virtual MonoModPatches? GetPatchInfo(StackFrame frame, IModuleProvider moduleProvider, ILoaderPluginProvider loaderPluginProvider)
- {
- return null;
- }
-
- public virtual MethodInfo? GetExecutingMethod(StackFrame frame)
- {
- return null;
- }
-
- public virtual MethodBase? GetOriginalMethod(StackFrame frame)
- {
- return null;
- }
-
- public virtual MonoModPatches? GetPatchInfo(MethodBase originalMethod) => MonoModUtils.GetPatches(originalMethod);
-
- public IntPtr GetNativeMethodBody(MethodBase method) => MonoModUtils.GetNativeMethodBody(method);
- }
- */
-}
-
-#pragma warning restore
-#nullable restore
-#endif // BUTRCRASHREPORT_DISABLE
\ No newline at end of file
diff --git a/src/BUTR.CrashReport.Bannerlord.Source/MonoModUtils.cs b/src/BUTR.CrashReport.Bannerlord.Source/MonoModUtils.cs
deleted file mode 100644
index 5e9838b..0000000
--- a/src/BUTR.CrashReport.Bannerlord.Source/MonoModUtils.cs
+++ /dev/null
@@ -1,252 +0,0 @@
-//
-// This code file has automatically been added by the "BUTR.CrashReport.Bannerlord.Source" NuGet package (https://www.nuget.org/packages/BUTR.CrashReport.Bannerlord.Source).
-// Please see https://github.com/BUTR/BUTR.CrashReport for more information.
-//
-// IMPORTANT:
-// DO NOT DELETE THIS FILE if you are using a "packages.config" file to manage your NuGet references.
-// Consider migrating to PackageReferences instead:
-// https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference
-// Migrating brings the following benefits:
-// * The "BUTR.CrashReport.Bannerlord.Source" folder and the "MonoModProvider.cs" file don't appear in your project.
-// * The added file is immutable and can therefore not be modified by coincidence.
-// * Updating/Uninstalling the package will work flawlessly.
-//
-
-#region License
-// MIT License
-//
-// Copyright (c) Bannerlord's Unofficial Tools & Resources
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-#endregion
-
-#if !BUTRCRASHREPORT_DISABLE
-#nullable enable
-#if !BUTRCRASHREPORT_ENABLEWARNINGS
-#pragma warning disable
-#endif
-
-namespace BUTR.CrashReport.Bannerlord
-{
- using global::BUTR.CrashReport.Interfaces;
- using global::BUTR.CrashReport.Models;
-
- using global::HarmonyLib;
- using global::HarmonyLib.BUTR.Extensions;
-
- using global::System;
- using global::System.Collections;
- using global::System.Collections.Generic;
- using global::System.Diagnostics;
- using global::System.Linq;
- using global::System.Reflection;
-
- using static global::HarmonyLib.BUTR.Extensions.AccessTools2;
-
- internal static class MonoModUtils
- {
- private static readonly AccessTools.FieldRef