mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
4 files changed
+12
-17
No files matched your search
@@ -250,19 +250,6 @@ namespace BepInEx.Preloader.Core
|
||||
PatcherPlugins.Clear();
|
||||
}
|
||||
|
||||
private static string GetAssemblyName(string fullName)
|
||||
{
|
||||
// We need to manually parse full name to avoid issues with encoding on mono
|
||||
try
|
||||
{
|
||||
return new AssemblyName(fullName).Name;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return fullName;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Applies patchers to all assemblies in the given directory and loads patched assemblies into memory.
|
||||
/// </summary>
|
||||
@@ -316,7 +303,8 @@ namespace BepInEx.Preloader.Core
|
||||
|
||||
foreach (var resolvedAss in AppDomain.CurrentDomain.GetAssemblies())
|
||||
{
|
||||
var name = GetAssemblyName(resolvedAss.FullName);
|
||||
var name = Utility.TryParseAssemblyName(resolvedAss.FullName, out var assName) ? assName.Name : resolvedAss.FullName;
|
||||
|
||||
// Report only the first type that caused the assembly to load, because any subsequent ones can be false positives
|
||||
if (!resolvedAssemblies.ContainsKey(name))
|
||||
resolvedAssemblies[name] = assemblyPatcher.TypeName;
|
||||
|
||||
Reference in new issue
Block a user