Added changes from fork to fix MelonLoader

From here:
https://github.com/GrahamKracker/UnityExplorer
This commit is contained in:
originalnicodr committed 2023-06-29 20:03:32 -03:00
1 parent 6c31c4b77b
commit 4087982717
7 files changed
+58 -10

No files matched your search

+6
View File
@@ -27,6 +27,7 @@ namespace UnityExplorer.Config
public static ConfigElement<KeyCode> UI_MouseInspect_Keybind;
public static ConfigElement<string> CSConsole_Assembly_Blacklist;
public static ConfigElement<string> Reflection_Signature_Blacklist;
public static ConfigElement<bool> Reflection_Hide_NativeInfoPtrs;
// internal configs
internal static InternalConfigHandler InternalHandler { get; private set; }
@@ -139,6 +140,11 @@ namespace UnityExplorer.Config
"Seperate signatures with a semicolon ';'.\r\n" +
"For example, to blacklist Camera.main, you would add 'UnityEngine.Camera.main;'",
"");
Reflection_Hide_NativeInfoPtrs = new("Hide NativeMethodInfoPtr_s and NativeFieldInfoPtr_s",
"Use this to blacklist NativeMethodPtr_s and NativeFieldInfoPtrs_s from the class inspector, mainly to reduce clutter.\r\n" +
"For example, this will hide 'Class.NativeFieldInfoPtr_value' for the field 'Class.value'.",
false);
}
}
}
+1 -1
View File
@@ -25,7 +25,7 @@ namespace UnityExplorer
public string UnhollowedModulesFolder => Path.Combine(
Path.GetDirectoryName(MelonHandler.ModsDirectory),
Path.Combine("MelonLoader", "Managed"));
Path.Combine("MelonLoader", "Il2CppAssemblies"));
public ConfigHandler ConfigHandler => _configHandler;
public MelonLoaderConfigHandler _configHandler;
+7 -1
View File
@@ -70,9 +70,15 @@ namespace UnityExplorer.Runtime
public static bool IsBlacklisted(MemberInfo member)
{
if (ConfigManager.Reflection_Hide_NativeInfoPtrs.Value) {
bool isNativeInfoPtr = member.Name.StartsWith("NativeFieldInfoPtr_") || member.Name.StartsWith("NativeMethodInfoPtr_");
if (isNativeInfoPtr)
return true;
}
if (string.IsNullOrEmpty(member.DeclaringType?.Namespace))
return false;
string sig = $"{member.DeclaringType.FullName}.{member.Name}";
return currentBlacklist.Contains(sig);
+19 -7
View File
@@ -7,20 +7,27 @@
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AllowedReferenceRelatedFileExtensions>none</AllowedReferenceRelatedFileExtensions>
<DebugSymbols>false</DebugSymbols>
<DebugType>none</DebugType>
<DebugSymbols>true</DebugSymbols>
<DebugType>embedded</DebugType>
<RootNamespace>UnityExplorer</RootNamespace>
<LangVersion>10.0</LangVersion>
<Configurations>BIE_Cpp;BIE_Cpp_CoreCLR;BIE5_Mono;BIE6_Mono;ML_Cpp_net6;ML_Cpp_net472;ML_Mono;STANDALONE_Mono;STANDALONE_Cpp</Configurations>
<LangVersion>latest</LangVersion>
<Configurations>BIE_Cpp;BIE_Cpp_CoreCLR;BIE5_Mono;BIE6_Mono;ML_Cpp_net6;ML_Cpp_net6_interop;ML_Cpp_net472;ML_Mono;STANDALONE_Mono;STANDALONE_Cpp</Configurations>
</PropertyGroup>
<!-- ~~~~~ CONFIGURATIONS ~~~~~ -->
<!-- ML IL2CPP net6 -->
<!-- ML IL2CPP Unhollower net6 -->
<PropertyGroup Condition="'$(Configuration)'=='ML_Cpp_net6'">
<TargetFramework>net6</TargetFramework>
<OutputPath>..\Release\UnityExplorer.MelonLoader.IL2CPP.net6preview\</OutputPath>
<DefineConstants>CPP,ML,UNHOLLOWER</DefineConstants>
<AssemblyName>UnityExplorer.ML.IL2CPP.net6preview</AssemblyName>
</PropertyGroup>
<!-- ML IL2CPP Interop net6 -->
<PropertyGroup Condition="'$(Configuration)'=='ML_Cpp_net6_interop'">
<TargetFramework>net6</TargetFramework>
<OutputPath>..\Release\UnityExplorer.MelonLoader.IL2CPP.net6preview.interop\</OutputPath>
<DefineConstants>CPP,ML,INTEROP</DefineConstants>
<AssemblyName>UnityExplorer.ML.IL2CPP.net6preview.interop</AssemblyName>
</PropertyGroup>
<!-- ML IL2CPP net472 (TEMP) -->
<PropertyGroup Condition="'$(Configuration)'=='ML_Cpp_net472'">
<TargetFramework>net472</TargetFramework>
@@ -93,6 +100,11 @@
<PackageReference Include="Il2CppInterop.Runtime" Version="1.0.0" />
<PackageReference Include="UniverseLib.IL2CPP.Interop" Version="1.5.1" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='ML_Cpp_net6_interop'">
<PackageReference Include="Il2CppInterop.Common" Version="1.0.0" />
<PackageReference Include="Il2CppInterop.Runtime" Version="1.0.0" />
<PackageReference Include="UniverseLib.IL2CPP.Interop.ML" Version="1.5.4.1" />
</ItemGroup>
<!-- mono nuget -->
<ItemGroup Condition="'$(Configuration)'=='BIE6_Mono' or '$(Configuration)'=='BIE5_Mono' or '$(Configuration)'=='ML_Mono' or '$(Configuration)'=='STANDALONE_Mono'">
<PackageReference Include="UniverseLib.Mono" Version="1.5.1" />
@@ -114,7 +126,7 @@
</Reference>
</ItemGroup>
<!-- MelonLoader net6 -->
<ItemGroup Condition="'$(Configuration)'=='ML_Cpp_net6'">
<ItemGroup Condition="'$(Configuration)'=='ML_Cpp_net6' or '$(Configuration)'=='ML_Cpp_net6_interop'">
<Reference Include="MelonLoader">
<HintPath>..\lib\net6\MelonLoader.dll</HintPath>
<Private>False</Private>
@@ -211,7 +223,7 @@
</Reference>
</ItemGroup>
<!-- Il2Cpp Interop -->
<ItemGroup Condition="'$(Configuration)'=='BIE_Cpp_CoreCLR'">
<ItemGroup Condition="'$(Configuration)'=='BIE_Cpp_CoreCLR' or '$(Configuration)'=='ML_Cpp_net6_interop'">
<Reference Include="Il2Cppmscorlib">
<HintPath>..\lib\interop\Il2Cppmscorlib.dll</HintPath>
<Private>False</Private>
+3
View File
@@ -13,6 +13,7 @@ Global
Release_BIE6_Mono|Any CPU = Release_BIE6_Mono|Any CPU
Release_ML_Cpp_net472|Any CPU = Release_ML_Cpp_net472|Any CPU
Release_ML_Cpp_net6|Any CPU = Release_ML_Cpp_net6|Any CPU
Release_ML_Cpp_net6_interop|Any CPU = Release_ML_Cpp_net6_interop|Any CPU
Release_ML_Mono|Any CPU = Release_ML_Mono|Any CPU
Release_STANDALONE_Cpp|Any CPU = Release_STANDALONE_Cpp|Any CPU
Release_STANDALONE_Mono|Any CPU = Release_STANDALONE_Mono|Any CPU
@@ -30,6 +31,8 @@ Global
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_ML_Cpp_net472|Any CPU.Build.0 = ML_Cpp_net472|Any CPU
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_ML_Cpp_net6|Any CPU.ActiveCfg = ML_Cpp_net6|Any CPU
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_ML_Cpp_net6|Any CPU.Build.0 = ML_Cpp_net6|Any CPU
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_ML_Cpp_net6_interop|Any CPU.ActiveCfg = ML_Cpp_net6_interop|Any CPU
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_ML_Cpp_net6_interop|Any CPU.Build.0 = ML_Cpp_net6_interop|Any CPU
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_ML_Mono|Any CPU.ActiveCfg = ML_Mono|Any CPU
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_ML_Mono|Any CPU.Build.0 = ML_Mono|Any CPU
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_STANDALONE_Cpp|Any CPU.ActiveCfg = STANDALONE_Cpp|Any CPU