port baydock's changes

This commit is contained in:
GrahamKracker 2023-04-25 13:50:03 -04:00
parent 1e1fb0e27b
commit 027f890698
7 changed files with 59 additions and 11 deletions

View File

@ -1,4 +1,4 @@
# ----------- MelonLoader IL2CPP (net6) -----------
# ----------- MelonLoader IL2CPP Unhollower (net6) -----------
dotnet build src/UnityExplorer.sln -c Release_ML_Cpp_net6
$Path = "Release\UnityExplorer.MelonLoader.IL2CPP.net6preview"
# ILRepack
@ -17,6 +17,27 @@ Move-Item -Path $Path/UniverseLib.IL2CPP.Unhollower.dll -Destination $Path/UserL
Remove-Item $Path/../UnityExplorer.MelonLoader.IL2CPP.net6preview.zip -ErrorAction SilentlyContinue
7z a $Path/../UnityExplorer.MelonLoader.IL2CPP.net6preview.zip .\$Path\*
# ----------- MelonLoader IL2CPP Interop (net6) -----------
dotnet build src/UnityExplorer.sln -c Release_ML_Cpp_net6_interop
$Path = "Release\UnityExplorer.MelonLoader.IL2CPP.net6preview.interop"
# ILRepack
lib/ILRepack.exe /target:library /lib:lib/net6 /lib:lib/interop /lib:$Path /internalize /out:$Path/UnityExplorer.ML.IL2CPP.net6preview.interop.dll $Path/UnityExplorer.ML.IL2CPP.net6preview.interop.dll $Path/mcs.dll
# (cleanup and move files)
Remove-Item $Path/UnityExplorer.ML.IL2CPP.net6preview.interop.deps.json
Remove-Item $Path/Tomlet.dll
Remove-Item $Path/mcs.dll
Remove-Item $Path/Iced.dll
Remove-Item $Path/Il2CppInterop.Common.dll
Remove-Item $Path/Il2CppInterop.Runtime.dll
Remove-Item $Path/Microsoft.Extensions.Logging.Abstractions.dll
New-Item -Path "$Path" -Name "Mods" -ItemType "directory" -Force
Move-Item -Path $Path/UnityExplorer.ML.IL2CPP.net6preview.interop.dll -Destination $Path/Mods -Force
New-Item -Path "$Path" -Name "UserLibs" -ItemType "directory" -Force
Move-Item -Path $Path/UniverseLib.IL2CPP.Interop.ML.dll -Destination $Path/UserLibs -Force
# (create zip archive)
Remove-Item $Path/../UnityExplorer.MelonLoader.IL2CPP.net6preview.interop.zip -ErrorAction SilentlyContinue
7z a $Path/../UnityExplorer.MelonLoader.IL2CPP.net6preview.interop.zip .\$Path\*
# ----------- MelonLoader IL2CPP (net472) -----------
dotnet build src/UnityExplorer.sln -c Release_ML_Cpp_net472
$Path = "Release/UnityExplorer.MelonLoader.IL2CPP"

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);
}
}
}

View File

@ -19,7 +19,7 @@ namespace UnityExplorer
public static class ExplorerCore
{
public const string NAME = "UnityExplorer";
public const string VERSION = "4.9.0";
public const string VERSION = "4.9.4";
public const string AUTHOR = "Sinai";
public const string GUID = "com.sinai.unityexplorer";

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;

View File

@ -70,6 +70,12 @@ 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;

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>

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