diff --git a/UnityEditorPackage/Runtime/UnityExplorer.STANDALONE.Mono.dll b/UnityEditorPackage/Runtime/UnityExplorer.STANDALONE.Mono.dll index 36b9630..90d0e81 100644 Binary files a/UnityEditorPackage/Runtime/UnityExplorer.STANDALONE.Mono.dll and b/UnityEditorPackage/Runtime/UnityExplorer.STANDALONE.Mono.dll differ diff --git a/UnityEditorPackage/Runtime/UniverseLib.Mono.dll b/UnityEditorPackage/Runtime/UniverseLib.Mono.dll index cf356cc..4cfb1a5 100644 Binary files a/UnityEditorPackage/Runtime/UniverseLib.Mono.dll and b/UnityEditorPackage/Runtime/UniverseLib.Mono.dll differ diff --git a/build.ps1 b/build.ps1 index 4572df7..4da82c7 100644 --- a/build.ps1 +++ b/build.ps1 @@ -12,7 +12,7 @@ Remove-Item $Path/UnhollowerBaseLib.dll New-Item -Path "$Path" -Name "Mods" -ItemType "directory" -Force Move-Item -Path $Path/UnityExplorer.ML.IL2CPP.net6preview.dll -Destination $Path/Mods -Force New-Item -Path "$Path" -Name "UserLibs" -ItemType "directory" -Force -Move-Item -Path $Path/UniverseLib.IL2CPP.dll -Destination $Path/UserLibs -Force +Move-Item -Path $Path/UniverseLib.IL2CPP.Unhollower.dll -Destination $Path/UserLibs -Force # (create zip archive) Remove-Item $Path/../UnityExplorer.MelonLoader.IL2CPP.net6preview.zip -ErrorAction SilentlyContinue 7z a $Path/../UnityExplorer.MelonLoader.IL2CPP.net6preview.zip .\$Path\* @@ -30,7 +30,7 @@ Remove-Item $Path/UnhollowerBaseLib.dll New-Item -Path "$Path" -Name "Mods" -ItemType "directory" -Force Move-Item -Path $Path/UnityExplorer.ML.IL2CPP.dll -Destination $Path/Mods -Force New-Item -Path "$Path" -Name "UserLibs" -ItemType "directory" -Force -Move-Item -Path $Path/UniverseLib.IL2CPP.dll -Destination $Path/UserLibs -Force +Move-Item -Path $Path/UniverseLib.IL2CPP.Unhollower.dll -Destination $Path/UserLibs -Force # (create zip archive) Remove-Item $Path/../UnityExplorer.MelonLoader.IL2CPP.zip -ErrorAction SilentlyContinue 7z a $Path/../UnityExplorer.MelonLoader.IL2CPP.zip .\$Path\* @@ -64,11 +64,32 @@ Remove-Item $Path/UnhollowerBaseLib.dll New-Item -Path "$Path" -Name "plugins" -ItemType "directory" -Force New-Item -Path "$Path" -Name "plugins/sinai-dev-UnityExplorer" -ItemType "directory" -Force Move-Item -Path $Path/UnityExplorer.BIE.IL2CPP.dll -Destination $Path/plugins/sinai-dev-UnityExplorer -Force -Move-Item -Path $Path/UniverseLib.IL2CPP.dll -Destination $Path/plugins/sinai-dev-UnityExplorer -Force +Move-Item -Path $Path/UniverseLib.IL2CPP.Unhollower.dll -Destination $Path/plugins/sinai-dev-UnityExplorer -Force # (create zip archive) Remove-Item $Path/../UnityExplorer.BepInEx.IL2CPP.zip -ErrorAction SilentlyContinue 7z a $Path/../UnityExplorer.BepInEx.IL2CPP.zip .\$Path\* +# ----------- BepInEx IL2CPP CoreCLR ----------- +dotnet build src/UnityExplorer.sln -c Release_BIE_CoreCLR +$Path = "Release/UnityExplorer.BepInEx.IL2CPP.CoreCLR" +# ILRepack +lib/ILRepack.exe /target:library /lib:lib/net472 /lib:lib/net6/ /lib:lib/interop/ /lib:$Path /internalize /out:$Path/UnityExplorer.BIE.IL2CPP.CoreCLR.dll $Path/UnityExplorer.BIE.IL2CPP.CoreCLR.dll $Path/mcs.dll $Path/Tomlet.dll +# (cleanup and move files) +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 +Remove-Item $Path/UnityExplorer.BIE.IL2CPP.CoreCLR.deps.json +New-Item -Path "$Path" -Name "plugins" -ItemType "directory" -Force +New-Item -Path "$Path" -Name "plugins/sinai-dev-UnityExplorer" -ItemType "directory" -Force +Move-Item -Path $Path/UnityExplorer.BIE.IL2CPP.CoreCLR.dll -Destination $Path/plugins/sinai-dev-UnityExplorer -Force +Move-Item -Path $Path/UniverseLib.IL2CPP.Interop.dll -Destination $Path/plugins/sinai-dev-UnityExplorer -Force +# (create zip archive) +Remove-Item $Path/../UnityExplorer.BepInEx.IL2CPP.CoreCLR.zip -ErrorAction SilentlyContinue +7z a $Path/../UnityExplorer.BepInEx.IL2CPP.CoreCLR.zip .\$Path\* + # ----------- BepInEx 5 Mono ----------- dotnet build src/UnityExplorer.sln -c Release_BIE5_Mono $Path = "Release/UnityExplorer.BepInEx5.Mono" diff --git a/lib/interop/Il2CppSystem.Core.dll b/lib/interop/Il2CppSystem.Core.dll new file mode 100644 index 0000000..7b47d09 Binary files /dev/null and b/lib/interop/Il2CppSystem.Core.dll differ diff --git a/lib/interop/Il2Cppmscorlib.dll b/lib/interop/Il2Cppmscorlib.dll new file mode 100644 index 0000000..3be8346 Binary files /dev/null and b/lib/interop/Il2Cppmscorlib.dll differ diff --git a/lib/interop/UnityEngine.AssetBundleModule.dll b/lib/interop/UnityEngine.AssetBundleModule.dll new file mode 100644 index 0000000..b1c3925 Binary files /dev/null and b/lib/interop/UnityEngine.AssetBundleModule.dll differ diff --git a/lib/interop/UnityEngine.AudioModule.dll b/lib/interop/UnityEngine.AudioModule.dll new file mode 100644 index 0000000..1cb15dc Binary files /dev/null and b/lib/interop/UnityEngine.AudioModule.dll differ diff --git a/lib/interop/UnityEngine.CoreModule.dll b/lib/interop/UnityEngine.CoreModule.dll new file mode 100644 index 0000000..8188a2e Binary files /dev/null and b/lib/interop/UnityEngine.CoreModule.dll differ diff --git a/lib/interop/UnityEngine.IMGUIModule.dll b/lib/interop/UnityEngine.IMGUIModule.dll new file mode 100644 index 0000000..7099ba9 Binary files /dev/null and b/lib/interop/UnityEngine.IMGUIModule.dll differ diff --git a/lib/interop/UnityEngine.PhysicsModule.dll b/lib/interop/UnityEngine.PhysicsModule.dll new file mode 100644 index 0000000..1f050bb Binary files /dev/null and b/lib/interop/UnityEngine.PhysicsModule.dll differ diff --git a/lib/interop/UnityEngine.TextRenderingModule.dll b/lib/interop/UnityEngine.TextRenderingModule.dll new file mode 100644 index 0000000..9d8a909 Binary files /dev/null and b/lib/interop/UnityEngine.TextRenderingModule.dll differ diff --git a/lib/interop/UnityEngine.UI.dll b/lib/interop/UnityEngine.UI.dll new file mode 100644 index 0000000..8ef1d71 Binary files /dev/null and b/lib/interop/UnityEngine.UI.dll differ diff --git a/lib/interop/UnityEngine.UIModule.dll b/lib/interop/UnityEngine.UIModule.dll new file mode 100644 index 0000000..005469f Binary files /dev/null and b/lib/interop/UnityEngine.UIModule.dll differ diff --git a/lib/interop/UnityEngine.dll b/lib/interop/UnityEngine.dll new file mode 100644 index 0000000..5726b28 Binary files /dev/null and b/lib/interop/UnityEngine.dll differ diff --git a/src/ExplorerBehaviour.cs b/src/ExplorerBehaviour.cs index e453262..50fd53a 100644 --- a/src/ExplorerBehaviour.cs +++ b/src/ExplorerBehaviour.cs @@ -1,6 +1,10 @@ using UnityExplorer.UI; #if CPP +#if UNHOLLOWER using UnhollowerRuntimeLib; +#else +using Il2CppInterop.Runtime.Injection; +#endif #endif namespace UnityExplorer diff --git a/src/ExplorerCore.cs b/src/ExplorerCore.cs index 11f6fb3..05195af 100644 --- a/src/ExplorerCore.cs +++ b/src/ExplorerCore.cs @@ -19,7 +19,7 @@ namespace UnityExplorer public static class ExplorerCore { public const string NAME = "UnityExplorer"; - public const string VERSION = "4.8.2"; + public const string VERSION = "4.9.0"; public const string AUTHOR = "Sinai"; public const string GUID = "com.sinai.unityexplorer"; @@ -77,7 +77,9 @@ namespace UnityExplorer { // check master toggle if (InputManager.GetKeyDown(ConfigManager.Master_Toggle.Value)) + { UIManager.ShowMenu = !UIManager.ShowMenu; + } } diff --git a/src/Loader/BepInEx/ExplorerBepInPlugin.cs b/src/Loader/BepInEx/ExplorerBepInPlugin.cs index 7110146..ab9ad33 100644 --- a/src/Loader/BepInEx/ExplorerBepInPlugin.cs +++ b/src/Loader/BepInEx/ExplorerBepInPlugin.cs @@ -6,7 +6,6 @@ using UnityExplorer.Config; using UnityExplorer.Loader.BIE; #if CPP using BepInEx.IL2CPP; -using UnhollowerRuntimeLib; #endif namespace UnityExplorer @@ -29,8 +28,14 @@ namespace UnityExplorer #else => Log; #endif - - public string UnhollowedModulesFolder => Path.Combine(Paths.BepInExRootPath, "unhollowed"); + const string IL2CPP_LIBS_FOLDER = +#if UNHOLLOWER + "unhollowed" +#else + "interop" +#endif + ; + public string UnhollowedModulesFolder => Path.Combine(Paths.BepInExRootPath, IL2CPP_LIBS_FOLDER); public ConfigHandler ConfigHandler => _configHandler; private BepInExConfigHandler _configHandler; diff --git a/src/Tests/TestClass.cs b/src/Tests/TestClass.cs index aa6be7a..9fa0faf 100644 --- a/src/Tests/TestClass.cs +++ b/src/Tests/TestClass.cs @@ -1,8 +1,13 @@ using System.Collections; #if CPP +#if INTEROP +using Il2CppInterop.Runtime.InteropTypes.Arrays; +using Il2CppInterop.Runtime; +#else using UnhollowerRuntimeLib; using UnhollowerBaseLib; #endif +#endif namespace UnityExplorer.Tests { @@ -253,7 +258,7 @@ namespace UnityExplorer.Tests } ExplorerCore.Log($"IL2CPP 9: Il2Cpp struct array of ints"); - IL2CPP_structArray = new UnhollowerBaseLib.Il2CppStructArray(5); + IL2CPP_structArray = new Il2CppStructArray(5); IL2CPP_structArray[0] = 0; IL2CPP_structArray[1] = 1; IL2CPP_structArray[2] = 2; @@ -261,7 +266,7 @@ namespace UnityExplorer.Tests IL2CPP_structArray[4] = 4; ExplorerCore.Log($"IL2CPP 10: Il2Cpp reference array of boxed objects"); - IL2CPP_ReferenceArray = new UnhollowerBaseLib.Il2CppReferenceArray(3); + IL2CPP_ReferenceArray = new Il2CppReferenceArray(3); IL2CPP_ReferenceArray[0] = new Il2CppSystem.Int32 { m_value = 5 }.BoxIl2CppObject(); IL2CPP_ReferenceArray[1] = null; IL2CPP_ReferenceArray[2] = (Il2CppSystem.String)"whats up"; diff --git a/src/UI/Panels/FreeCamPanel.cs b/src/UI/Panels/FreeCamPanel.cs index 93ec9e6..cd781b2 100644 --- a/src/UI/Panels/FreeCamPanel.cs +++ b/src/UI/Panels/FreeCamPanel.cs @@ -1,6 +1,12 @@ using UniverseLib.Input; using UniverseLib.UI; using UniverseLib.UI.Models; +#if UNHOLLOWER +using UnhollowerRuntimeLib; +#endif +#if INTEROP +using Il2CppInterop.Runtime.Injection; +#endif namespace UnityExplorer.UI.Panels { @@ -324,7 +330,7 @@ namespace UnityExplorer.UI.Panels #if CPP static FreeCamBehaviour() { - UnhollowerRuntimeLib.ClassInjector.RegisterTypeInIl2Cpp(); + ClassInjector.RegisterTypeInIl2Cpp(); } public FreeCamBehaviour(IntPtr ptr) : base(ptr) { } diff --git a/src/UI/Widgets/TimeScaleWidget.cs b/src/UI/Widgets/TimeScaleWidget.cs index 42c636f..4854ed1 100644 --- a/src/UI/Widgets/TimeScaleWidget.cs +++ b/src/UI/Widgets/TimeScaleWidget.cs @@ -1,6 +1,12 @@ using HarmonyLib; using UniverseLib.UI; using UniverseLib.UI.Models; +#if UNHOLLOWER +using IL2CPPUtils = UnhollowerBaseLib.UnhollowerUtils; +#endif +#if INTEROP +using IL2CPPUtils = Il2CppInterop.Common.Il2CppInteropUtils; +#endif namespace UnityExplorer.UI.Widgets { @@ -90,7 +96,7 @@ namespace UnityExplorer.UI.Widgets { MethodInfo target = typeof(Time).GetProperty("timeScale").GetSetMethod(); #if CPP - if (UnhollowerBaseLib.UnhollowerUtils.GetIl2CppMethodInfoPointerFieldForGeneratedMethod(target) == null) + if (IL2CPPUtils.GetIl2CppMethodInfoPointerFieldForGeneratedMethod(target) == null) return; #endif ExplorerCore.Harmony.Patch(target, diff --git a/src/UI/Widgets/UnityObjects/AudioClipWidget.cs b/src/UI/Widgets/UnityObjects/AudioClipWidget.cs index 6be17cb..2a20a03 100644 --- a/src/UI/Widgets/UnityObjects/AudioClipWidget.cs +++ b/src/UI/Widgets/UnityObjects/AudioClipWidget.cs @@ -5,6 +5,15 @@ using UnityExplorer.Inspectors; using UniverseLib.UI; using UniverseLib.UI.Models; using UniverseLib.UI.ObjectPool; +#if CPP +#if INTEROP +using Il2CppInterop.Runtime; +using Il2CppInterop.Runtime.InteropTypes.Arrays; +#else +using UnhollowerRuntimeLib; +using UnhollowerBaseLib; +#endif +#endif namespace UnityExplorer.UI.Widgets { @@ -146,7 +155,7 @@ namespace UnityExplorer.UI.Widgets AudioPlayerObject.hideFlags = HideFlags.HideAndDontSave; AudioPlayerObject.transform.position = new(int.MinValue, int.MinValue); // move it as far away as possible #if CPP - Source = AudioPlayerObject.AddComponent(UnhollowerRuntimeLib.Il2CppType.Of()).TryCast(); + Source = AudioPlayerObject.AddComponent(Il2CppType.Of()).TryCast(); #else Source = AudioPlayerObject.AddComponent(); #endif @@ -265,7 +274,7 @@ namespace UnityExplorer.UI.Widgets } } - #region SavWav +#region SavWav // Copyright (c) 2012 Calvin Rien // http://the.darktable.com @@ -320,7 +329,7 @@ namespace UnityExplorer.UI.Widgets static void ConvertAndWrite(FileStream fileStream, AudioClip clip) { #if CPP - UnhollowerBaseLib.Il2CppStructArray samples = new float[clip.samples * clip.channels]; + Il2CppStructArray samples = new float[clip.samples * clip.channels]; AudioClip.GetData(clip, samples, clip.samples, 0); #else float[] samples = new float[clip.samples * clip.channels]; @@ -396,6 +405,6 @@ namespace UnityExplorer.UI.Widgets stream.Seek(0, SeekOrigin.Begin); } - #endregion +#endregion } } \ No newline at end of file diff --git a/src/UnityExplorer.csproj b/src/UnityExplorer.csproj index d59cf96..aa7594a 100644 --- a/src/UnityExplorer.csproj +++ b/src/UnityExplorer.csproj @@ -11,21 +11,21 @@ none UnityExplorer 10.0 - BIE_Cpp;BIE5_Mono;BIE6_Mono;ML_Cpp_net6;ML_Mono;STANDALONE_Mono;STANDALONE_Cpp;ML_Cpp_net472 + BIE_Cpp;BIE_Cpp_CoreCLR;BIE5_Mono;BIE6_Mono;ML_Cpp_net6;ML_Cpp_net472;ML_Mono;STANDALONE_Mono;STANDALONE_Cpp net6 ..\Release\UnityExplorer.MelonLoader.IL2CPP.net6preview\ - CPP,ML + CPP,ML,UNHOLLOWER UnityExplorer.ML.IL2CPP.net6preview net472 ..\Release\UnityExplorer.MelonLoader.IL2CPP\ - CPP,ML + CPP,ML,UNHOLLOWER UnityExplorer.ML.IL2CPP @@ -39,9 +39,16 @@ net472 ..\Release\UnityExplorer.BepInEx.IL2CPP\ - CPP,BIE,BIE6 + CPP,BIE,BIE6,UNHOLLOWER UnityExplorer.BIE.IL2CPP + + + net6 + ..\Release\UnityExplorer.BepInEx.IL2CPP.CoreCLR\ + CPP,BIE,BIE6,INTEROP + UnityExplorer.BIE.IL2CPP.CoreCLR + net35 @@ -56,18 +63,18 @@ MONO,BIE,BIE5 UnityExplorer.BIE5.Mono - + net35 ..\Release\UnityExplorer.Standalone.Mono\ MONO,STANDALONE UnityExplorer.STANDALONE.Mono - + net472 ..\Release\UnityExplorer.Standalone.IL2CPP\ - CPP,STANDALONE + CPP,STANDALONE,UNHOLLOWER UnityExplorer.STANDALONE.IL2CPP @@ -79,11 +86,16 @@ - + + + + + + - + @@ -134,7 +146,7 @@ - + ..\lib\net472\BepInEx.Core.dll False @@ -155,7 +167,7 @@ False - + ..\lib\unhollowed\Il2Cppmscorlib.dll @@ -198,4 +210,47 @@ False + + + + ..\lib\interop\Il2Cppmscorlib.dll + False + + + ..\lib\interop\Il2CppSystem.Core.dll + False + + + ..\lib\interop\UnityEngine.dll + False + + + ..\lib\interop\UnityEngine.AudioModule.dll + False + + + ..\lib\interop\UnityEngine.CoreModule.dll + False + + + ..\lib\interop\UnityEngine.PhysicsModule.dll + False + + + ..\lib\interop\UnityEngine.TextRenderingModule.dll + False + + + ..\lib\interop\UnityEngine.UI.dll + False + + + ..\lib\interop\UnityEngine.UIModule.dll + False + + + ..\lib\interop\UnityEngine.IMGUIModule.dll + False + + \ No newline at end of file diff --git a/src/UnityExplorer.sln b/src/UnityExplorer.sln index 7c87ed1..ef2e7e6 100644 --- a/src/UnityExplorer.sln +++ b/src/UnityExplorer.sln @@ -8,6 +8,7 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Release_BIE_Cpp|Any CPU = Release_BIE_Cpp|Any CPU + Release_BIE_CoreCLR|Any CPU = Release_BIE_CoreCLR|Any CPU Release_BIE5_Mono|Any CPU = Release_BIE5_Mono|Any CPU Release_BIE6_Mono|Any CPU = Release_BIE6_Mono|Any CPU Release_ML_Cpp_net472|Any CPU = Release_ML_Cpp_net472|Any CPU @@ -19,6 +20,8 @@ Global GlobalSection(ProjectConfigurationPlatforms) = postSolution {B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_BIE_Cpp|Any CPU.ActiveCfg = BIE_Cpp|Any CPU {B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_BIE_Cpp|Any CPU.Build.0 = BIE_Cpp|Any CPU + {B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_BIE_CoreCLR|Any CPU.ActiveCfg = BIE_Cpp_CoreCLR|Any CPU + {B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_BIE_CoreCLR|Any CPU.Build.0 = BIE_Cpp_CoreCLR|Any CPU {B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_BIE5_Mono|Any CPU.ActiveCfg = BIE5_Mono|Any CPU {B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_BIE5_Mono|Any CPU.Build.0 = BIE5_Mono|Any CPU {B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_BIE6_Mono|Any CPU.ActiveCfg = BIE6_Mono|Any CPU