├── .gitignore ├── LICENSE ├── README.md ├── ares_logger.sln ├── ares_logger ├── Properties │ └── AssemblyInfo.cs ├── ares_logger.csproj ├── main │ ├── config │ │ ├── config.cs │ │ └── config_handler.cs │ ├── core.cs │ ├── funcs │ │ └── logging.cs │ ├── handler │ │ ├── domain_handler.cs │ │ └── main_domain.cs │ ├── patches │ │ ├── download_mgr.cs │ │ ├── network_mgr.cs │ │ └── on_event.cs │ ├── sdk │ │ ├── Assembly-CSharp │ │ │ ├── AssetBundleDownloadManager.cs │ │ │ ├── NetworkManager.cs │ │ │ ├── VRC │ │ │ │ ├── Core │ │ │ │ │ ├── APIUser.cs │ │ │ │ │ ├── ApiAvatar.cs │ │ │ │ │ ├── ApiModel.cs │ │ │ │ │ ├── ApiWorld.cs │ │ │ │ │ ├── ApiWorldInstance.cs │ │ │ │ │ └── VRCNetworkingClient.cs │ │ │ │ └── Player.cs │ │ │ ├── VRCNetworkBehaviour.cs │ │ │ └── VRCPlayer.cs │ │ ├── IL2CPP │ │ │ ├── CPP2IL.cs │ │ │ ├── CastUtils.cs │ │ │ ├── IL2CPP.cs │ │ │ ├── Import.cs │ │ │ ├── Objects │ │ │ │ ├── IL2Assembly.cs │ │ │ │ ├── IL2Class.cs │ │ │ │ ├── IL2ClassType.cs │ │ │ │ ├── IL2Field.cs │ │ │ │ ├── IL2Method.cs │ │ │ │ ├── IL2Object.cs │ │ │ │ ├── IL2Param.cs │ │ │ │ └── IL2Property.cs │ │ │ └── System │ │ │ │ ├── Action.cs │ │ │ │ ├── Array.cs │ │ │ │ ├── Boolean.cs │ │ │ │ ├── Byte.cs │ │ │ │ ├── Collections │ │ │ │ ├── Generic │ │ │ │ │ ├── Dictionary.cs │ │ │ │ │ └── List.cs │ │ │ │ └── Hashtable.cs │ │ │ │ ├── Delegate.cs │ │ │ │ ├── IO │ │ │ │ ├── File.cs │ │ │ │ ├── MemoryStream.cs │ │ │ │ └── Stream.cs │ │ │ │ ├── Int32.cs │ │ │ │ ├── Object.cs │ │ │ │ ├── Reflection │ │ │ │ ├── Assembly.cs │ │ │ │ ├── MemberInfo.cs │ │ │ │ ├── MethodBase.cs │ │ │ │ ├── MethodBody.cs │ │ │ │ ├── MethodInfo.cs │ │ │ │ ├── Module.cs │ │ │ │ ├── MonoMethod.cs │ │ │ │ ├── ParameterInfo.cs │ │ │ │ └── RuntimeMethodInfo.cs │ │ │ │ ├── Runtime │ │ │ │ └── Serialization │ │ │ │ │ └── Formatters │ │ │ │ │ └── Binary │ │ │ │ │ └── BinaryFormatter.cs │ │ │ │ ├── RuntimeMethodHandle.cs │ │ │ │ ├── RuntimeType.cs │ │ │ │ ├── String.cs │ │ │ │ ├── Text │ │ │ │ └── Encoding.cs │ │ │ │ └── Type.cs │ │ ├── Photon │ │ │ ├── EventData.cs │ │ │ └── LoadBalancingClient.cs │ │ ├── UnhollowerBaseLib │ │ │ └── Runtime │ │ │ │ └── Il2CppStructs.cs │ │ ├── UnityEngine.CoreModule │ │ │ └── UnityEngine │ │ │ │ ├── Application.cs │ │ │ │ ├── AsyncOperation.cs │ │ │ │ ├── Behaviour.cs │ │ │ │ ├── Camera.cs │ │ │ │ ├── Color.cs │ │ │ │ ├── Color32.cs │ │ │ │ ├── Component.cs │ │ │ │ ├── Coroutine.cs │ │ │ │ ├── DrivenTransformProperties.cs │ │ │ │ ├── Events │ │ │ │ ├── UnityAction.cs │ │ │ │ ├── UnityEvent.cs │ │ │ │ └── UnityEventBase.cs │ │ │ │ ├── Experimental │ │ │ │ └── Rendering │ │ │ │ │ └── GraphicsFormat.cs │ │ │ │ ├── GameObject.cs │ │ │ │ ├── Graphics.cs │ │ │ │ ├── HideFlags.cs │ │ │ │ ├── Input.cs │ │ │ │ ├── KeyCode.cs │ │ │ │ ├── LayerMask.cs │ │ │ │ ├── LightShadows.cs │ │ │ │ ├── LightType.cs │ │ │ │ ├── LineRenderer.cs │ │ │ │ ├── Material.cs │ │ │ │ ├── Mathf.cs │ │ │ │ ├── MeshFilter.cs │ │ │ │ ├── MeshRenderer.cs │ │ │ │ ├── MonoBehaviour.cs │ │ │ │ ├── Object.cs │ │ │ │ ├── PrimitiveType.cs │ │ │ │ ├── Quaternion.cs │ │ │ │ ├── Ray.cs │ │ │ │ ├── Rect.cs │ │ │ │ ├── RectTransform.cs │ │ │ │ ├── RenderTexture.cs │ │ │ │ ├── RenderTextureFormat.cs │ │ │ │ ├── RenderTextureReadWrite.cs │ │ │ │ ├── Renderer.cs │ │ │ │ ├── Resources.cs │ │ │ │ ├── SceneManagement │ │ │ │ ├── LoadSceneMode.cs │ │ │ │ ├── LoadSceneParameters.cs │ │ │ │ ├── LocalPhysicsMode.cs │ │ │ │ ├── Scene.cs │ │ │ │ ├── SceneManager.cs │ │ │ │ ├── SceneManagerAPIInternal.cs │ │ │ │ ├── SceneUtility.cs │ │ │ │ └── UnloadSceneOptions.cs │ │ │ │ ├── Screen.cs │ │ │ │ ├── ScriptableObject.cs │ │ │ │ ├── SendMessageOptions.cs │ │ │ │ ├── Shader.cs │ │ │ │ ├── Sprite.cs │ │ │ │ ├── SpriteMeshType.cs │ │ │ │ ├── SpriteRenderer.cs │ │ │ │ ├── Texture.cs │ │ │ │ ├── Texture2D.cs │ │ │ │ ├── TextureFormat.cs │ │ │ │ ├── Time.cs │ │ │ │ ├── Transform.cs │ │ │ │ ├── UnityString.cs │ │ │ │ ├── Vector2.cs │ │ │ │ ├── Vector3.cs │ │ │ │ ├── Vector3Ex.cs │ │ │ │ ├── Vector4.cs │ │ │ │ ├── WaitForSeconds.cs │ │ │ │ └── YieldInstruction.cs │ │ └── patch.cs │ └── util │ │ ├── avatar.cs │ │ ├── clipboard.cs │ │ ├── console.cs │ │ ├── downloader.cs │ │ ├── hook.cs │ │ ├── json.cs │ │ ├── log_sys.cs │ │ └── world.cs └── packages.config ├── clr_loader ├── clr_loader.sln ├── clr_loader.vcxproj ├── dllmain.cpp ├── framework.h ├── host.h ├── include │ └── MinHook.h ├── minhook │ ├── buffer.c │ ├── buffer.h │ ├── hde │ │ ├── hde32.c │ │ ├── hde32.h │ │ ├── hde64.c │ │ ├── hde64.h │ │ ├── pstdint.h │ │ ├── table32.h │ │ └── table64.h │ ├── hook.c │ ├── trampoline.c │ └── trampoline.h ├── pch.cpp └── pch.h └── face_injector_v2 ├── api ├── api.h ├── drvutils.h ├── shellcode.h ├── utilit.h └── xor.h ├── define └── stdafx.h ├── driver ├── defines.h ├── driver.cpp └── driver.h ├── face_injector_v2.vcxproj ├── inject ├── injector.h └── utils.h └── main.cpp /README.md: -------------------------------------------------------------------------------- 1 | # A.R.E.S Logger 2 | [![HitCount](https://hits.dwyl.com/notunixian/ares_logger.svg?style=flat-square)](http://hits.dwyl.com/notunixian/ares_logger) 3 | 4 | a "new" version of the [ares logger](https://github.com/Dean2k/ARESLogger) that was unfortunately (as well as all other melonloader mods) taken away as a result of EAC/EOS being implementented into VRChat. 5 | 6 | ## download latest version [here](https://github.com/notunixian/ares_logger/releases/latest) 7 | 8 | ### info 9 | this project is intended to run with my [clr loader](https://github.com/notunixian/clr-loader), and a built version of the clr loader will be included in the releases. 10 | 11 | this project also requires a working injecter, you can use my [fork of face injector](https://github.com/notunixian/face-injector-v2) which works on the latest windows version including developer branches. (a built version of this will also be included in the releases) 12 | 13 | ### credits 14 | * [LargestBoi](https://github.com/LargestBoi) - originally got me started on this and created the original logger 15 | * [ShrekamusChrist](https://github.com/Dean2k) - helped me understand ares api and created the original logger 16 | * [BlazeBest](https://github.com/BlazeBest) - majority of SDK classes 17 | * _1234/hacker (github?) - providing me with a config class that was 1000x better than the one i had, much thanks. 18 | 19 | 20 | -------------------------------------------------------------------------------- /ares_logger.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.2.32630.192 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ares_logger", "ares_logger\ares_logger.csproj", "{986164B1-A473-496D-B5AA-4BB274E5634D}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clr_loader", "clr_loader\clr_loader.vcxproj", "{CC14121F-F8CD-4D34-8DF7-1A46B72FC840}" 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "face_injector_v2", "face_injector_v2\face_injector_v2.vcxproj", "{A0EDD2AC-09C4-46E4-88D7-9B369952317C}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Debug|x64 = Debug|x64 16 | Debug|x86 = Debug|x86 17 | Release|Any CPU = Release|Any CPU 18 | Release|x64 = Release|x64 19 | Release|x86 = Release|x86 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {986164B1-A473-496D-B5AA-4BB274E5634D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {986164B1-A473-496D-B5AA-4BB274E5634D}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {986164B1-A473-496D-B5AA-4BB274E5634D}.Debug|x64.ActiveCfg = Debug|Any CPU 25 | {986164B1-A473-496D-B5AA-4BB274E5634D}.Debug|x64.Build.0 = Debug|Any CPU 26 | {986164B1-A473-496D-B5AA-4BB274E5634D}.Debug|x86.ActiveCfg = Debug|Any CPU 27 | {986164B1-A473-496D-B5AA-4BB274E5634D}.Debug|x86.Build.0 = Debug|Any CPU 28 | {986164B1-A473-496D-B5AA-4BB274E5634D}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {986164B1-A473-496D-B5AA-4BB274E5634D}.Release|Any CPU.Build.0 = Release|Any CPU 30 | {986164B1-A473-496D-B5AA-4BB274E5634D}.Release|x64.ActiveCfg = Release|Any CPU 31 | {986164B1-A473-496D-B5AA-4BB274E5634D}.Release|x64.Build.0 = Release|Any CPU 32 | {986164B1-A473-496D-B5AA-4BB274E5634D}.Release|x86.ActiveCfg = Release|Any CPU 33 | {986164B1-A473-496D-B5AA-4BB274E5634D}.Release|x86.Build.0 = Release|Any CPU 34 | {CC14121F-F8CD-4D34-8DF7-1A46B72FC840}.Debug|Any CPU.ActiveCfg = Debug|x64 35 | {CC14121F-F8CD-4D34-8DF7-1A46B72FC840}.Debug|Any CPU.Build.0 = Debug|x64 36 | {CC14121F-F8CD-4D34-8DF7-1A46B72FC840}.Debug|x64.ActiveCfg = Debug|x64 37 | {CC14121F-F8CD-4D34-8DF7-1A46B72FC840}.Debug|x64.Build.0 = Debug|x64 38 | {CC14121F-F8CD-4D34-8DF7-1A46B72FC840}.Debug|x86.ActiveCfg = Debug|Win32 39 | {CC14121F-F8CD-4D34-8DF7-1A46B72FC840}.Debug|x86.Build.0 = Debug|Win32 40 | {CC14121F-F8CD-4D34-8DF7-1A46B72FC840}.Release|Any CPU.ActiveCfg = Release|x64 41 | {CC14121F-F8CD-4D34-8DF7-1A46B72FC840}.Release|Any CPU.Build.0 = Release|x64 42 | {CC14121F-F8CD-4D34-8DF7-1A46B72FC840}.Release|x64.ActiveCfg = Release|x64 43 | {CC14121F-F8CD-4D34-8DF7-1A46B72FC840}.Release|x64.Build.0 = Release|x64 44 | {CC14121F-F8CD-4D34-8DF7-1A46B72FC840}.Release|x86.ActiveCfg = Release|Win32 45 | {CC14121F-F8CD-4D34-8DF7-1A46B72FC840}.Release|x86.Build.0 = Release|Win32 46 | {A0EDD2AC-09C4-46E4-88D7-9B369952317C}.Debug|Any CPU.ActiveCfg = Debug|x64 47 | {A0EDD2AC-09C4-46E4-88D7-9B369952317C}.Debug|Any CPU.Build.0 = Debug|x64 48 | {A0EDD2AC-09C4-46E4-88D7-9B369952317C}.Debug|x64.ActiveCfg = Debug|x64 49 | {A0EDD2AC-09C4-46E4-88D7-9B369952317C}.Debug|x64.Build.0 = Debug|x64 50 | {A0EDD2AC-09C4-46E4-88D7-9B369952317C}.Debug|x86.ActiveCfg = Debug|Win32 51 | {A0EDD2AC-09C4-46E4-88D7-9B369952317C}.Debug|x86.Build.0 = Debug|Win32 52 | {A0EDD2AC-09C4-46E4-88D7-9B369952317C}.Release|Any CPU.ActiveCfg = Release|x64 53 | {A0EDD2AC-09C4-46E4-88D7-9B369952317C}.Release|Any CPU.Build.0 = Release|x64 54 | {A0EDD2AC-09C4-46E4-88D7-9B369952317C}.Release|x64.ActiveCfg = Release|x64 55 | {A0EDD2AC-09C4-46E4-88D7-9B369952317C}.Release|x64.Build.0 = Release|x64 56 | {A0EDD2AC-09C4-46E4-88D7-9B369952317C}.Release|x86.ActiveCfg = Release|Win32 57 | {A0EDD2AC-09C4-46E4-88D7-9B369952317C}.Release|x86.Build.0 = Release|Win32 58 | EndGlobalSection 59 | GlobalSection(SolutionProperties) = preSolution 60 | HideSolutionNode = FALSE 61 | EndGlobalSection 62 | GlobalSection(ExtensibilityGlobals) = postSolution 63 | SolutionGuid = {A16E32B2-3119-4399-A985-4498B177321A} 64 | EndGlobalSection 65 | EndGlobal 66 | -------------------------------------------------------------------------------- /ares_logger/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ares_logger")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ares_logger")] 13 | [assembly: AssemblyCopyright("Copyright © 2022")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("986164b1-a473-496d-b5aa-4bb274e5634d")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ares_logger/main/config/config.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.Serialization; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ares_logger.main.config 9 | { 10 | public class conf 11 | { 12 | public static config_handler handler; 13 | } 14 | 15 | public class values 16 | { 17 | public bool log_avatars { get; set; } = true; 18 | public bool ignore_friends { get; set; } = false; 19 | public bool log_worlds { get; set; } = true; 20 | public bool enable_unsafe_features { get; set; } = false; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ares_logger/main/config/config_handler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Newtonsoft.Json; 4 | 5 | namespace ares_logger.main.config 6 | { 7 | // thx to _1234/hacker for this config system, 1000x better than what i had before 8 | public class config_handler where T : class 9 | { 10 | private string FilePath { get; } 11 | public T Config { get; private set; } 12 | public event Action PreOnConfigUpdate; 13 | public event Action OnConfigUpdate; 14 | 15 | public config_handler(string Path) 16 | { 17 | FilePath = Path; 18 | 19 | var Watch = System.IO.Path.GetDirectoryName(FilePath); 20 | 21 | if (Watch != null) 22 | { 23 | var watcher = new FileSystemWatcher(Watch, System.IO.Path.GetFileName(FilePath)) 24 | { 25 | NotifyFilter = NotifyFilters.LastWrite, 26 | EnableRaisingEvents = true 27 | }; 28 | watcher.Changed += UpdateConfig; 29 | } 30 | CheckConfig(); 31 | 32 | Config = JsonConvert.DeserializeObject(File.ReadAllText(FilePath)); 33 | } 34 | 35 | private void CheckConfig() 36 | { 37 | if (!File.Exists(FilePath) || new System.IO.FileInfo(FilePath).Length < 2) 38 | File.WriteAllText(FilePath, JsonConvert.SerializeObject(Activator.CreateInstance(typeof(T)), Formatting.Indented, new JsonSerializerSettings())); 39 | } 40 | 41 | private void UpdateConfig(object obj, FileSystemEventArgs args) 42 | { 43 | try 44 | { 45 | var UpdatedObject = JsonConvert.DeserializeObject(File.ReadAllText(FilePath)); 46 | 47 | if (UpdatedObject != null) 48 | foreach (var Prop in UpdatedObject.GetType()?.GetProperties()) 49 | { 50 | var Original = Config.GetType().GetProperty(Prop?.Name); 51 | 52 | if (Original != null 53 | && Prop.GetValue(UpdatedObject) != Original.GetValue(Config)) 54 | { 55 | PreOnConfigUpdate?.Invoke(); 56 | Config = UpdatedObject; 57 | 58 | OnConfigUpdate?.Invoke(); 59 | break; 60 | } 61 | } 62 | } 63 | catch 64 | { // Throw Error 65 | } 66 | } 67 | 68 | public void Save() => 69 | File.WriteAllText(FilePath, JsonConvert.SerializeObject(Config, Formatting.Indented, new JsonSerializerSettings())); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /ares_logger/main/handler/domain_handler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using ares_logger.main; 7 | 8 | namespace ares_logger.handler 9 | { 10 | internal sealed class domain_handler : AppDomainManager, main_domain 11 | { 12 | public domain_handler() { } 13 | public override void InitializeNewDomain(AppDomainSetup appDomainInfo) { InitializationFlags = AppDomainManagerInitializationOptions.RegisterWithHost; } 14 | 15 | public void init() => core.init(); 16 | public void setup_hook(IntPtr create_hook, IntPtr remove_hook, IntPtr enable_hook, IntPtr disable_hook) 17 | => util.hook.setup_hook(create_hook, remove_hook, enable_hook, disable_hook); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ares_logger/main/handler/main_domain.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ares_logger.handler 9 | { 10 | [ComImport, Guid("A3FA5B56-22BA-4550-8016-915BF8A395A6"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 11 | internal interface main_domain 12 | { 13 | void init(); 14 | void setup_hook(IntPtr create_hook, IntPtr remove_hook, IntPtr enable_hook, IntPtr disable_hook); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ares_logger/main/patches/download_mgr.cs: -------------------------------------------------------------------------------- 1 | using ares_logger.main.funcs; 2 | using ares_logger.main.util; 3 | using Assembly_CSharp; 4 | using Assembly_CSharp.VRC.Core; 5 | using IL2CPP_Core.Objects; 6 | using System; 7 | 8 | namespace ares_logger.main.patches 9 | { 10 | internal class download_mgr 11 | { 12 | public static sdk.patch patch; 13 | public delegate IntPtr _bundledownload(IntPtr hiddenStructReturn, IntPtr thisPtr, IntPtr pApiWorld, IntPtr pMulticastDelegate, bool param_3); 14 | public static _bundledownload __bundledownload; 15 | 16 | public static void init_patch() 17 | { 18 | try 19 | { 20 | var methodsBundle = AssetBundleDownloadManager.Instance_Class.GetMethods(x => x.GetParameters().Length >= 2); 21 | foreach (var method1 in methodsBundle) 22 | { 23 | log_sys.debug_log($"{method1.Name} | {method1.GetParameters()[0].ReturnType.Name} / {method1.GetParameters()[1].ReturnType.Name} / {method1.GetParameters()[2].ReturnType.Name}"); 24 | } 25 | 26 | IL2Method method = AssetBundleDownloadManager.Instance_Class.GetMethod("DownloadWorldAssetBundle"); 27 | if (method == null) 28 | throw new NullReferenceException(); 29 | 30 | patch = new sdk.patch(method, (_bundledownload)bundle_download); 31 | __bundledownload = patch.create_delegate<_bundledownload>(); 32 | } 33 | catch (Exception e) 34 | { 35 | log_sys.log($"[patch fail]: downloadmgr patch exception | e: {e.Message}", ConsoleColor.Red); 36 | } 37 | } 38 | 39 | public static IntPtr bundle_download(IntPtr hiddenStructReturn, IntPtr thisPtr, IntPtr pApiWorld, IntPtr pMulticastDelegate, bool param_3) 40 | { 41 | try 42 | { 43 | var apiWorld = new ApiWorld(pApiWorld); 44 | logging.execute_log(null, false, true, apiWorld); 45 | } 46 | catch (Exception e) { log_sys.debug_log($"fail at bundle code, e: {e.Message}"); } 47 | 48 | return __bundledownload(hiddenStructReturn, thisPtr, pApiWorld, pMulticastDelegate, param_3); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /ares_logger/main/patches/network_mgr.cs: -------------------------------------------------------------------------------- 1 | using ares_logger.main.util; 2 | using ares_logger.sdk; 3 | using Assembly_CSharp; 4 | using Assembly_CSharp.VRC; 5 | using IL2CPP_Core.Objects; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Linq; 9 | using System.Text; 10 | using System.Threading.Tasks; 11 | 12 | namespace ares_logger.main.patches 13 | { 14 | internal class network_mgr 15 | { 16 | public delegate void _(IntPtr _instance, IntPtr _player); 17 | public static patch player_join; 18 | public static _ __OnPlayerJoined; 19 | 20 | public static patch player_left; 21 | public static _ __OnPlayerLeft; 22 | 23 | public static Dictionary player_list = new Dictionary(); 24 | public static Dictionary actor_list = new Dictionary(); 25 | 26 | public static void init_patch() 27 | { 28 | try 29 | { 30 | IL2Method method = NetworkManager.Instance_Class.GetMethod("OnPlayerJoined"); 31 | player_join = new patch(method, (_)on_join); 32 | __OnPlayerJoined = player_join.create_delegate<_>(); 33 | } 34 | catch (Exception e) { log_sys.log($"[patch fail]: networkmgr (onplayerjoin) patch exception | e: {e.Message}", ConsoleColor.Red); } 35 | 36 | try 37 | { 38 | IL2Method method = NetworkManager.Instance_Class.GetMethod("OnPlayerLeft"); 39 | player_left = new patch(method, (_)on_left); 40 | __OnPlayerLeft = player_join.create_delegate<_>(); 41 | } 42 | catch (Exception e) { log_sys.log($"[patch fail]: networkmgr (onplayerleft) patch exception | e: {e.Message}", ConsoleColor.Red); } 43 | 44 | 45 | } 46 | 47 | private static void on_join(IntPtr _instance, IntPtr _player) 48 | { 49 | if (_player == IntPtr.Zero) return; 50 | var player = new Assembly_CSharp.VRC.Player(_player); 51 | 52 | 53 | try 54 | { 55 | if (player.vrc_player.actor_id == VRCPlayer.Instance.actor_id) patches.on_event.log_avatar(); 56 | player_list.Add(player.vrc_player.actor_id, player); 57 | actor_list.Add(player.Pointer, player.vrc_player.actor_id); 58 | } 59 | catch (Exception e) 60 | { 61 | log_sys.log($"[on_join]: failed at on_join code, e: {e.Message}", ConsoleColor.Red); 62 | } 63 | 64 | 65 | __OnPlayerJoined(_instance, _player); 66 | } 67 | 68 | private static void on_left(IntPtr _instance, IntPtr _player) 69 | { 70 | if (_player == IntPtr.Zero) return; 71 | 72 | var player = new Player(_player); 73 | 74 | 75 | // some shit code to fix vrcplayer being destroyed before i can access it 76 | try 77 | { 78 | var list = actor_list.TryGetValue(player.Pointer, out int actor); 79 | if (list == true) 80 | { 81 | player_list.Remove(actor); 82 | actor_list.Remove(player.Pointer); 83 | } 84 | } 85 | catch (Exception e) 86 | { 87 | log_sys.log($"[on_join]: failed at on_left code, e: {e.Message}", ConsoleColor.Red); 88 | } 89 | 90 | 91 | __OnPlayerLeft(_instance, _player); 92 | } 93 | 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /ares_logger/main/patches/on_event.cs: -------------------------------------------------------------------------------- 1 | using ares_logger.main.funcs; 2 | using ares_logger.main.util; 3 | using Assembly_CSharp; 4 | using Assembly_CSharp.VRC.Core; 5 | using IL2CPP_Core.Objects; 6 | using Photon; 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using System.Text; 11 | using System.Threading.Tasks; 12 | 13 | namespace ares_logger.main.patches 14 | { 15 | internal class on_event 16 | { 17 | public static sdk.patch patch; 18 | public delegate void _onevent(IntPtr instance, IntPtr data); 19 | public static _onevent __onevent; 20 | 21 | public static void init_patch() 22 | { 23 | try 24 | { 25 | IL2Method method = VRCNetworkingClient.Instance_Class.GetMethod("OnEvent"); 26 | if (method == null) 27 | throw new NullReferenceException(); 28 | 29 | patch = new sdk.patch(method, (_onevent)event_patch); 30 | __onevent = patch.create_delegate<_onevent>(); 31 | } 32 | catch (Exception e) 33 | { 34 | log_sys.log($"[patch fail]: onevent patch exception | e: {e.Source}", ConsoleColor.Red); 35 | } 36 | 37 | } 38 | 39 | private static void event_patch(IntPtr instance, IntPtr data) 40 | { 41 | var event_data = new EventData(data); 42 | switch (event_data.Code) 43 | { 44 | // event 223 does not contain a valid sender at all in my testing, so it's not going to be used here. 45 | case 42: 46 | log_avatar(event_data.Sender); 47 | break; 48 | default: 49 | break; 50 | } 51 | 52 | __onevent(instance, data); 53 | } 54 | 55 | private static void log_avatar(int actor_id) 56 | { 57 | log_sys.debug_log($"log_avatar (int actor_id) enter"); 58 | try 59 | { 60 | var list = network_mgr.player_list.TryGetValue(actor_id, out var player); 61 | if (list == true) funcs.logging.execute_log(player.vrc_player, true); 62 | } 63 | catch (Exception e) 64 | { 65 | log_sys.log($"[log failure]: unknown exception: {e.Message}", ConsoleColor.Red); 66 | } 67 | log_sys.debug_log($"log_avatar (int actor_id) exit"); 68 | } 69 | 70 | // override that takes 0 params for when you just join a world. 71 | public static void log_avatar() 72 | { 73 | log_sys.debug_log($"log_avatar (void) enter"); 74 | try 75 | { 76 | foreach (VRCPlayer player in UnityEngine.Object.FindObjectsOfType()) 77 | { 78 | funcs.logging.execute_log(player, true); 79 | } 80 | } 81 | catch (Exception e) 82 | { 83 | log_sys.log($"[log failure]: unknown exception: {e.Source}", ConsoleColor.Red); 84 | } 85 | log_sys.debug_log($"log_avatar (void) exit"); 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/Assembly-CSharp/AssetBundleDownloadManager.cs: -------------------------------------------------------------------------------- 1 | using ares_logger.main.util; 2 | using Assembly_CSharp.VRC.Core; 3 | using IL2CPP_Core.Objects; 4 | using System; 5 | using System.Linq; 6 | using UnityEngine; 7 | 8 | namespace Assembly_CSharp 9 | { 10 | internal class AssetBundleDownloadManager : MonoBehaviour 11 | { 12 | public AssetBundleDownloadManager(IntPtr ptr) : base(ptr) { } 13 | 14 | static AssetBundleDownloadManager() 15 | { 16 | // finds the unitask for loading world bundles 17 | (Instance_Class.GetMethod(x => x.GetParameters().Length > 1 && x.GetParameters()[0].ReturnType.Name == ApiWorld.Instance_Class.FullName)).Name = "DownloadWorldAssetBundle"; 18 | (Instance_Class.GetMethod(x => x.GetParameters().Length > 1 && x.GetParameters()[0].ReturnType.Name == ApiAvatar.Instance_Class.FullName)).Name = "DownloadAvatarAssetBundle"; 19 | } 20 | 21 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["Assembly-CSharp"].GetClasses().FirstOrDefault(x => x.BaseType == MonoBehaviour.Instance_Class && x.GetField(y => y.ReturnType.Name == "UnityEngine.Cache") != null); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/Assembly-CSharp/NetworkManager.cs: -------------------------------------------------------------------------------- 1 | using ares_logger.main.util; 2 | using IL2CPP_Core.Objects; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using UnityEngine; 9 | 10 | namespace Assembly_CSharp 11 | { 12 | public class NetworkManager : MonoBehaviour 13 | { 14 | static NetworkManager() 15 | { 16 | var methodsPlayer = Instance_Class.GetMethods(x => x.GetParameters().Length == 1 && x.GetParameters()[0].ReturnType.Name == VRC.Player.Instance_Class.FullName); 17 | try 18 | { 19 | methodsPlayer[1].Name = "OnPlayerJoined"; 20 | } 21 | catch { } 22 | 23 | try 24 | { 25 | methodsPlayer[3].Name = "OnPlayerLeft"; 26 | } 27 | catch { } 28 | } 29 | public NetworkManager(IntPtr ptr) : base(ptr) { } 30 | 31 | 32 | 33 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["Assembly-CSharp"].GetClasses().FirstOrDefault(x => x.GetMethod("OnCustomAuthenticationResponse") != null && x.GetMethod("Awake") != null); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/Assembly-CSharp/VRC/Core/APIUser.cs: -------------------------------------------------------------------------------- 1 | using IL2CPP_Core.Objects; 2 | using System; 3 | 4 | namespace Assembly_CSharp.VRC.Core 5 | { 6 | public class APIUser : ApiModel 7 | { 8 | public APIUser(IntPtr ptr) : base(ptr) { } 9 | 10 | public static bool IsFriendsWith(string userId) => IsFriendsWith(new IL2String_utf8(userId)); 11 | public static bool IsFriendsWith(IL2String userId) 12 | { 13 | return Instance_Class.GetMethod(nameof(IsFriendsWith)).Invoke(new IntPtr[] { userId.Pointer }).GetValue(); 14 | } 15 | 16 | public string authToken 17 | { 18 | get => Instance_Class.GetProperty(nameof(authToken)).GetGetMethod().Invoke(this)?.GetValue().ToString(); 19 | } 20 | 21 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["VRCCore-Standalone"].GetClass("APIUser", "VRC.Core"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/Assembly-CSharp/VRC/Core/ApiModel.cs: -------------------------------------------------------------------------------- 1 | using IL2CPP_Core.Objects; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Assembly_CSharp.VRC.Core 9 | { 10 | public class ApiModel : IL2Object 11 | { 12 | public ApiModel(IntPtr ptr) : base(ptr) { } 13 | 14 | public string id 15 | { 16 | get => Instance_Class.GetProperty(nameof(id)).GetGetMethod().Invoke(this)?.GetValue().ToString(); 17 | set => Instance_Class.GetProperty(nameof(id)).GetSetMethod().Invoke(this, new IntPtr[] { new IL2String_utf8(value).Pointer }); 18 | } 19 | 20 | public bool Populated 21 | { 22 | get => Instance_Class.GetProperty(nameof(Populated)).GetGetMethod().Invoke(this).GetValue(); 23 | } 24 | 25 | /// 26 | /// 27 | /// 28 | /// Action "ApiContainer" 29 | /// Action "ApiContainer" 30 | /// 31 | /// 32 | unsafe public void Fetch(Action onSuccess = null, Action onFailure = null, Dictionary parameters = null, bool disableCache = false) 33 | { 34 | IntPtr ptrSuccess = IntPtr.Zero; 35 | //if (onSuccess != null) 36 | // ptrSuccess = _UnityAction.CreateDelegate(onSuccess, IntPtr.Zero, .action_1); 37 | IntPtr ptrFailure = IntPtr.Zero; 38 | //if (onFailure != null) 39 | // ptrFailure = _UnityAction.CreateDelegate(onFailure, IntPtr.Zero, BlazeTools.IL2SystemClass.action_1); 40 | 41 | Instance_Class.GetMethod(nameof(Fetch)).Invoke(this, new IntPtr[] { ptrSuccess, ptrFailure, IntPtr.Zero, new IntPtr(&disableCache) }); 42 | } 43 | 44 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["VRCCore-Standalone"].GetClass("ApiModel", "VRC.Core"); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/Assembly-CSharp/VRC/Core/ApiWorld.cs: -------------------------------------------------------------------------------- 1 | using IL2CPP_Core.Objects; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | 6 | namespace Assembly_CSharp.VRC.Core 7 | { 8 | public class ApiWorld : ApiModel 9 | { 10 | public ApiWorld(IntPtr ptr) : base(ptr) { } 11 | 12 | public string currentInstanceIdWithTags 13 | { 14 | get => Instance_Class.GetField(nameof(currentInstanceIdWithTags)).GetValue(this)?.GetValue().ToString(); 15 | } 16 | 17 | public string authorId 18 | { 19 | get => Instance_Class.GetProperty(nameof(authorId)).GetGetMethod().Invoke(this)?.GetValue().ToString(); 20 | set => Instance_Class.GetProperty(nameof(authorId)).GetSetMethod().Invoke(this, new IntPtr[] { new IL2String_utf8(value).Pointer }); 21 | } 22 | 23 | public string releaseStatus 24 | { 25 | get => Instance_Class.GetProperty(nameof(releaseStatus)).GetGetMethod().Invoke(this)?.GetValue().ToString(); 26 | set => Instance_Class.GetProperty(nameof(releaseStatus)).GetSetMethod().Invoke(this, new IntPtr[] { new IL2String_utf8(value).Pointer }); 27 | } 28 | 29 | public string assetUrl 30 | { 31 | get => Instance_Class.GetProperty(nameof(assetUrl)).GetGetMethod().Invoke(this)?.GetValue().ToString(); 32 | set => Instance_Class.GetProperty(nameof(assetUrl)).GetSetMethod().Invoke(this, new IntPtr[] { new IL2String_utf8(value).Pointer }); 33 | } 34 | 35 | public string name 36 | { 37 | get => Instance_Class.GetProperty(nameof(name)).GetGetMethod().Invoke(this)?.GetValue().ToString(); 38 | set => Instance_Class.GetProperty(nameof(name)).GetSetMethod().Invoke(this, new IntPtr[] { new IL2String_utf16(value).Pointer }); 39 | } 40 | 41 | public string authorName 42 | { 43 | get => Instance_Class.GetProperty(nameof(authorName)).GetGetMethod().Invoke(this)?.GetValue().ToString(); 44 | set => Instance_Class.GetProperty(nameof(authorName)).GetSetMethod().Invoke(this, new IntPtr[] { new IL2String_utf16(value).Pointer }); 45 | } 46 | 47 | public string imageUrl 48 | { 49 | get => Instance_Class.GetProperty(nameof(imageUrl)).GetGetMethod().Invoke(this)?.GetValue().ToString(); 50 | set => Instance_Class.GetProperty(nameof(imageUrl)).GetSetMethod().Invoke(this, new IntPtr[] { new IL2String_utf8(value).Pointer }); 51 | } 52 | 53 | public string description 54 | { 55 | get => Instance_Class.GetProperty(nameof(description)).GetGetMethod().Invoke(this)?.GetValue().ToString(); 56 | set => Instance_Class.GetProperty(nameof(description)).GetSetMethod().Invoke(this, new IntPtr[] { new IL2String_utf16(value).Pointer }); 57 | } 58 | 59 | public string unityVersion 60 | { 61 | get => Instance_Class.GetProperty(nameof(unityVersion)).GetGetMethod().Invoke(this)?.GetValue().ToString(); 62 | set => Instance_Class.GetProperty(nameof(unityVersion)).GetSetMethod().Invoke(this, new IntPtr[] { new IL2String_utf16(value).Pointer }); 63 | } 64 | 65 | public string thumbnailImageUrl 66 | { 67 | get => Instance_Class.GetProperty(nameof(thumbnailImageUrl)).GetGetMethod().Invoke(this)?.GetValue().ToString(); 68 | set => Instance_Class.GetProperty(nameof(thumbnailImageUrl)).GetSetMethod().Invoke(this, new IntPtr[] { new IL2String_utf16(value).Pointer }); 69 | } 70 | 71 | public string[] tags 72 | { 73 | get 74 | { 75 | IL2Object result = Instance_Class.GetProperty(nameof(tags)).GetGetMethod().Invoke(this); 76 | if (result == null) 77 | return null; 78 | return new IL2ListObject(result.Pointer).ToArray().Select(x => x.ToString()).ToArray(); 79 | } 80 | } 81 | 82 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["VRCCore-Standalone"].GetClass("ApiWorld", "VRC.Core"); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/Assembly-CSharp/VRC/Core/ApiWorldInstance.cs: -------------------------------------------------------------------------------- 1 | using IL2CPP_Core.Objects; 2 | using System; 3 | 4 | namespace Assembly_CSharp.VRC.Core 5 | { 6 | public class ApiWorldInstance : IL2Object 7 | { 8 | public ApiWorldInstance(IntPtr ptr) : base(ptr) { } 9 | 10 | unsafe public ApiWorldInstance(ApiWorld world, string _idWithTags, int _count) : base(IntPtr.Zero) 11 | { 12 | Pointer = Import.Object.il2cpp_object_new(Instance_Class.Pointer); 13 | Instance_Class.GetMethod(".ctor", x => x.GetParameters().Length == 3 && x.GetParameters()[2].Name == "_count").Invoke(Pointer, new IntPtr[] { world.Pointer, new IL2String_utf16(_idWithTags).Pointer, new IntPtr(&_count) }); 14 | } 15 | 16 | public string GetInstanceCreator() 17 | { 18 | return Instance_Class.GetMethod(nameof(GetInstanceCreator)).Invoke(this)?.GetValue().ToString(); 19 | } 20 | 21 | public ApiWorld instanceWorld 22 | { 23 | get => Instance_Class.GetField(nameof(instanceWorld)).GetValue(this)?.GetValue(); 24 | } 25 | 26 | public string idWithTags 27 | { 28 | get => Instance_Class.GetField(nameof(idWithTags)).GetValue(this)?.GetValue().ToString(); 29 | } 30 | 31 | public string ownerId 32 | { 33 | get => Instance_Class.GetProperty(nameof(ownerId)).GetGetMethod().Invoke(this)?.GetValue().ToString(); 34 | set => Instance_Class.GetProperty(nameof(ownerId)).GetSetMethod().Invoke(this, new IntPtr[] { new IL2String_utf8(value).Pointer }); 35 | } 36 | 37 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["VRCCore-Standalone"].GetClass("ApiWorldInstance", "VRC.Core"); 38 | 39 | public enum AccessType 40 | { 41 | Public, 42 | FriendsOfGuests, 43 | FriendsOnly, 44 | InviteOnly, 45 | InvitePlus, 46 | Counter 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/Assembly-CSharp/VRC/Core/VRCNetworkingClient.cs: -------------------------------------------------------------------------------- 1 | using IL2CPP_Core.Objects; 2 | using Photon; 3 | using System; 4 | using System.Linq; 5 | 6 | 7 | namespace Assembly_CSharp.VRC.Core 8 | { 9 | internal class VRCNetworkingClient : LoadBalancingClient 10 | { 11 | public VRCNetworkingClient(IntPtr ptr) : base(ptr) { } 12 | 13 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["Assembly-CSharp"].GetClasses().First(x => x.GetField(y => y.Instance) != null && x.GetMethod("OnEvent") != null); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/Assembly-CSharp/VRC/Player.cs: -------------------------------------------------------------------------------- 1 | using Assembly_CSharp.VRC.Core; 2 | using IL2CPP_Core.Objects; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using UnityEngine; 9 | 10 | namespace Assembly_CSharp.VRC 11 | { 12 | internal class Player : MonoBehaviour 13 | { 14 | public Player(IntPtr ptr) : base(ptr) { } 15 | 16 | public VRCPlayer vrc_player 17 | { 18 | get 19 | { 20 | IL2Property property = Instance_Class.GetProperty(nameof(vrc_player)); 21 | if (property == null) 22 | (property = Instance_Class.GetProperty(VRCPlayer.Instance_Class)).Name = nameof(vrc_player); 23 | return property?.GetGetMethod().Invoke(this)?.GetValue(); 24 | } 25 | } 26 | 27 | public APIUser api_user 28 | { 29 | get 30 | { 31 | IL2Property property = Instance_Class.GetProperty(nameof(api_user)); 32 | if (property == null) 33 | (property = Instance_Class.GetProperty(APIUser.Instance_Class)).Name = nameof(api_user); 34 | return property?.GetGetMethod().Invoke(this)?.GetValue(); 35 | } 36 | } 37 | 38 | 39 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["Assembly-CSharp"].GetClasses().FirstOrDefault(x => x.GetField("_USpeaker") != null); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/Assembly-CSharp/VRCNetworkBehaviour.cs: -------------------------------------------------------------------------------- 1 | using IL2CPP_Core.Objects; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using UnityEngine; 8 | 9 | namespace Assembly_CSharp 10 | { 11 | public abstract class VRCNetworkBehaviour : MonoBehaviour 12 | { 13 | public VRCNetworkBehaviour(IntPtr ptr) : base(ptr) { } 14 | 15 | public int actor_id 16 | { 17 | get 18 | { 19 | IL2Property property = Instance_Class.GetProperty(nameof(actor_id)); 20 | if (property == null) 21 | { 22 | (property = Instance_Class.GetProperties(x => x.GetGetMethod().ReturnType.Name == typeof(int).FullName).Skip(1).FirstOrDefault()).Name = nameof(actor_id); 23 | if (property == null) 24 | return default; 25 | } 26 | return property.GetGetMethod().Invoke(this).GetValue(); 27 | } 28 | } 29 | 30 | public static new IL2Class Instance_Class = VRCPlayer.Instance_Class.BaseType; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/Assembly-CSharp/VRCPlayer.cs: -------------------------------------------------------------------------------- 1 | using Assembly_CSharp.VRC; 2 | using Assembly_CSharp.VRC.Core; 3 | using IL2CPP_Core.Objects; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace Assembly_CSharp 11 | { 12 | internal class VRCPlayer : VRCNetworkBehaviour 13 | { 14 | public VRCPlayer(IntPtr ptr) : base(ptr) { } 15 | 16 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["Assembly-CSharp"].GetClass(VRC.Player.Instance_Class.GetField("_vrcplayer").ReturnType.Name); 17 | 18 | public Player player 19 | { 20 | get 21 | { 22 | IL2Property property = Instance_Class.GetProperty(nameof(player)); 23 | if (property == null) 24 | (property = Instance_Class.GetProperty(Player.Instance_Class)).Name = nameof(player); 25 | return property?.GetGetMethod().Invoke(this)?.GetValue(); 26 | } 27 | } 28 | 29 | public ApiAvatar AvatarModel 30 | { 31 | get 32 | { 33 | IL2Property property = Instance_Class.GetProperty(nameof(AvatarModel)); 34 | if (property == null) 35 | (property = Instance_Class.GetProperty(ApiAvatar.Instance_Class)).Name = nameof(AvatarModel); 36 | return property?.GetGetMethod().Invoke(this)?.GetValue(); 37 | } 38 | } 39 | 40 | public static VRCPlayer Instance 41 | { 42 | get 43 | { 44 | IL2Field field = Instance_Class.GetField(nameof(Instance)); 45 | if (field == null) 46 | (field = Instance_Class.GetField(x => x.Instance)).Name = nameof(Instance); 47 | return field.GetValue()?.GetValue(); 48 | } 49 | } 50 | 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/CPP2IL.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | public static class CPP2IL 5 | { 6 | public static byte[] ToByteArray(IL2Object obj) 7 | { 8 | if (obj == null) return null; 9 | var bf = new System.Runtime.Serialization.Formatters.Binary.IL2BinaryFormatter(); 10 | var ms = new System.IO.IL2MemoryStream(); 11 | bf.Serialize(ms, obj); 12 | return ms.ToArray(); 13 | } 14 | 15 | public static byte[] ToByteArray(object obj) 16 | { 17 | if (obj == null) return null; 18 | var binaryFormatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); 19 | var memoryStream = new System.IO.MemoryStream(); 20 | binaryFormatter.Serialize(memoryStream, obj); 21 | return memoryStream.ToArray(); 22 | } 23 | 24 | public static T FromByteArray(byte[] data) 25 | { 26 | if (data == null) return default(T); 27 | var bf = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); 28 | using (var ms = new System.IO.MemoryStream(data)) 29 | { 30 | object obj = bf.Deserialize(ms); 31 | return (T)obj; 32 | } 33 | } 34 | 35 | public static T IL2CPPFromByteArray(byte[] data) 36 | { 37 | if (data == null) return default(T); 38 | var bf = new System.Runtime.Serialization.Formatters.Binary.IL2BinaryFormatter(); 39 | var ms = new System.IO.IL2MemoryStream(data); 40 | object obj = bf.Deserialize(ms); 41 | return (T)obj; 42 | } 43 | 44 | public static T FromIL2CPPToManaged(IL2Object obj) 45 | { 46 | return FromByteArray(ToByteArray(obj)); 47 | } 48 | } -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/CastUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using IL2CPP_Core.Objects; 4 | 5 | public static class CastUtils 6 | { 7 | public static IntPtr IL2Typeof(this Type type) 8 | { 9 | IL2Class ilType = null; 10 | 11 | ilType = IL2CPP.AssemblyList["mscorlib"].GetClass(type.Name, type.Namespace); 12 | if (ilType == null) 13 | ilType = (IL2Class)type.GetFields().First(x => x.IsStatic && x.FieldType == typeof(IL2Class)).GetValue(null); 14 | 15 | return IL2Typeof(ilType); 16 | } 17 | 18 | unsafe public static IntPtr IL2Typeof(this IL2Class type) 19 | { 20 | IntPtr ptr = Import.Class.il2cpp_class_get_type(type.Pointer); 21 | if (ptr == IntPtr.Zero) 22 | return IntPtr.Zero; 23 | 24 | IntPtr result = Import.Class.il2cpp_type_get_object(ptr); 25 | if (result == IntPtr.Zero) 26 | return IntPtr.Zero; 27 | 28 | return result; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/IL2CPP.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.IO; 4 | using System.Collections.Generic; 5 | using System.Runtime.InteropServices; 6 | using IL2CPP_Core.Objects; 7 | using ares_logger.main.util; 8 | 9 | public static class IL2CPP 10 | { 11 | static IL2CPP() 12 | { 13 | domain = Import.Domain.il2cpp_domain_get(); 14 | 15 | uint count = 0; 16 | IntPtr assemblies = Import.Domain.il2cpp_domain_get_assemblies(domain, ref count); 17 | IntPtr[] assembliesarr = IntPtrToStructureArray(assemblies, count); 18 | AssemblyList = new Dictionary(); 19 | foreach (IntPtr assemblyPtr in assembliesarr) 20 | { 21 | if (assemblyPtr == IntPtr.Zero) 22 | continue; 23 | 24 | IntPtr Pointer = Import.Assembly.il2cpp_assembly_get_image(assemblyPtr); 25 | string AssemblyName = Path.GetFileNameWithoutExtension(Marshal.PtrToStringAnsi(Import.Image.il2cpp_image_get_name(Pointer))); 26 | if (Limiter.Contains(AssemblyName)) 27 | { 28 | IL2Assembly assembly = new IL2Assembly(Pointer); 29 | AssemblyList.Add(AssemblyName, assembly); 30 | } 31 | } 32 | log_sys.log("[init]: il2cpp init complete", ConsoleColor.Green); 33 | } 34 | 35 | public static T ResolveICall(string signature) where T : Delegate 36 | { 37 | 38 | var icallPtr = Import.Method.il2cpp_resolve_icall(signature); 39 | if (icallPtr != IntPtr.Zero) 40 | return Marshal.GetDelegateForFunctionPointer(icallPtr); 41 | return null; 42 | } 43 | 44 | public static T[] IntPtrToStructureArray(IntPtr ptr, uint len) 45 | { 46 | IntPtr iter = ptr; 47 | T[] array = new T[len]; 48 | for (uint i = 0; i < len; i++) 49 | { 50 | array[i] = (T)Marshal.PtrToStructure(iter, typeof(T)); 51 | iter += Marshal.SizeOf(typeof(T)); 52 | } 53 | return array; 54 | } 55 | 56 | private static IntPtr domain; 57 | 58 | private static string[] Limiter = new string[] 59 | { 60 | "Assembly-CSharp", 61 | "Epic.OnlineServices", 62 | "mscorlib", 63 | "System", 64 | "System.Core", 65 | "VRCCore-Standalone", 66 | "UnityEngine.CoreModule", 67 | "UnityEngine.ImageConversionModule", 68 | "UnityEngine.InputLegacyModule", 69 | "UnityEngine.UnityAnalyticsModule", 70 | "UnityEngine.AnimationModule", 71 | "UnityEngine.PhysicsModule", 72 | "UnityEngine.UI", 73 | "UnityEngine.UIModule", 74 | "UnityEngine.IMGUIModule", 75 | "UnityEngine.VRModule", 76 | "Photon-DotNet", 77 | "VRCSDKBase", 78 | "VRCSDK2", 79 | "VRCSDK3", 80 | "VRCSDK3A", 81 | "VRC.Udon", 82 | "VRC.UI.Core", 83 | "VRC.UI.Elements", 84 | "VRC.Dynamics", 85 | "VRC.SDK3.Dynamics.Contact", 86 | "Facepunch.Steamworks.Win64", 87 | "Transmtn", 88 | "Unity.TextMeshPro", 89 | "DataModel" 90 | }; 91 | 92 | public static Dictionary AssemblyList; 93 | } 94 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/Objects/IL2Assembly.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Runtime.InteropServices; 6 | 7 | namespace IL2CPP_Core.Objects 8 | { 9 | public class IL2Assembly : IL2Object 10 | { 11 | 12 | public string Name { get; private set; } 13 | private List ClassList = new List(); 14 | internal IL2Assembly(IntPtr ptr) : base(ptr) 15 | { 16 | Pointer = ptr; 17 | Name = Path.GetFileNameWithoutExtension(Marshal.PtrToStringAnsi(Import.Image.il2cpp_image_get_name(Pointer))); 18 | 19 | // Map out Classes 20 | uint count = Import.Image.il2cpp_image_get_class_count(Pointer); 21 | for (uint i = 0; i < count; i++) 22 | { 23 | IL2Class klass = new IL2Class(Import.Image.il2cpp_image_get_class(Pointer, i)); 24 | if (klass.DeclaringType == null) 25 | ClassList.Add(klass); 26 | } 27 | } 28 | public IL2Class[] GetClasses() => ClassList.ToArray(); 29 | public IL2Class[] GetClasses(IL2BindingFlags flags) => GetClasses().Where(x => x.HasFlag(flags)).ToArray(); 30 | public IL2Class GetClass(IntPtr ptr) => GetClasses().Where(x => x.Pointer == ptr).FirstOrDefault(); 31 | public IL2Class GetClass(string name) => GetClass(name, null); 32 | public IL2Class GetClass(string name, IL2BindingFlags flags) => GetClass(name, null, flags); 33 | public IL2Class GetClass(string name, string name_space) 34 | { 35 | IL2Class returnval = null; 36 | foreach (IL2Class type in GetClasses()) 37 | { 38 | if (type.Name.Equals(name) && (string.IsNullOrEmpty(type.Namespace) || type.Namespace.Equals(name_space))) 39 | { 40 | returnval = type; 41 | break; 42 | } 43 | else 44 | { 45 | foreach (IL2Class nestedtype in type.GetNestedTypes()) 46 | { 47 | if (nestedtype.Name.Equals(name) && (string.IsNullOrEmpty(nestedtype.Namespace) || nestedtype.Namespace.Equals(name_space))) 48 | { 49 | returnval = nestedtype; 50 | break; 51 | } 52 | } 53 | if (returnval != null) 54 | break; 55 | } 56 | } 57 | return returnval; 58 | } 59 | public IL2Class GetClass(string name, string name_space, IL2BindingFlags flags) 60 | { 61 | IL2Class returnval = null; 62 | foreach (IL2Class type in GetClasses()) 63 | { 64 | if (type.Name.Equals(name) && (string.IsNullOrEmpty(type.Namespace) || type.Namespace.Equals(name_space)) && type.HasFlag(flags)) 65 | { 66 | returnval = type; 67 | break; 68 | } 69 | /* 70 | else 71 | { 72 | foreach (IL2Class nestedtype in type.GetNestedTypes()) 73 | { 74 | if (nestedtype.Name.Equals(name) && (string.IsNullOrEmpty(nestedtype.Namespace) || nestedtype.Namespace.Equals(name_space)) && nestedtype.HasFlag(flags)) 75 | { 76 | returnval = nestedtype; 77 | break; 78 | } 79 | } 80 | if (returnval != null) 81 | break; 82 | } 83 | */ 84 | } 85 | return returnval; 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/Objects/IL2ClassType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace IL2CPP_Core.Objects 4 | { 5 | public class IL2ClassType : IL2Object 6 | { 7 | internal IL2ClassType(IntPtr ptr) : base(ptr) { } 8 | 9 | public string Name 10 | { 11 | get => Import.Object.il2cpp_type_get_name(Pointer); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/Objects/IL2Field.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace IL2CPP_Core.Objects 5 | { 6 | public class IL2Field : IL2Object 7 | { 8 | internal IL2Field(IntPtr ptr) : base(ptr) { } 9 | 10 | private string szName; 11 | public string Name 12 | { 13 | get 14 | { 15 | if (string.IsNullOrEmpty(szName)) 16 | szName = Marshal.PtrToStringAnsi(Import.Field.il2cpp_field_get_name(Pointer)); 17 | return szName; 18 | } 19 | set => szName = value; 20 | } 21 | 22 | public IL2ClassType ReturnType => new IL2ClassType(Import.Field.il2cpp_field_get_type(Pointer)); 23 | public int Token => Import.Field.il2cpp_field_get_offset(Pointer); 24 | 25 | public IL2BindingFlags Flags 26 | { 27 | get 28 | { 29 | uint flags = 0; 30 | return (IL2BindingFlags)Import.Field.il2cpp_field_get_flags(Pointer, ref flags); 31 | } 32 | } 33 | public bool HasFlag(IL2BindingFlags flag) => ((Flags & flag) != 0); 34 | 35 | public bool IsStatic => HasFlag(IL2BindingFlags.FIELD_STATIC); 36 | public bool IsPrivate => HasFlag(IL2BindingFlags.FIELD_PRIVATE); 37 | public bool IsPublic => HasFlag(IL2BindingFlags.FIELD_PUBLIC); 38 | 39 | public bool Instance => IsStatic && ReturnType.Name == ReflectedType.FullName; 40 | public IL2Class ReflectedType => new IL2Class(Import.Field.il2cpp_field_get_parent(Pointer)); 41 | 42 | public bool HasAttribute(IL2Class klass) 43 | { 44 | if (klass == null) return false; 45 | return Import.Field.il2cpp_field_has_attribute(Pointer, klass.Pointer); 46 | } 47 | 48 | public IL2Object GetValue() => GetValue(IntPtr.Zero); 49 | public IL2Object GetValue(IL2Object obj) => GetValue(obj.Pointer); 50 | public IL2Object GetValue(IntPtr obj) 51 | { 52 | IntPtr returnval = IntPtr.Zero; 53 | if (HasFlag(IL2BindingFlags.FIELD_STATIC)) 54 | returnval = Import.Field.il2cpp_field_get_value_object(Pointer, IntPtr.Zero); 55 | else 56 | returnval = Import.Field.il2cpp_field_get_value_object(Pointer, obj); 57 | if (returnval != IntPtr.Zero) 58 | return new IL2Object(returnval); 59 | return null; 60 | } 61 | public new IL2Object GetValue() where T : unmanaged => GetValue(IntPtr.Zero); 62 | public IL2Object GetValue(IL2Object obj) where T : unmanaged => GetValue(obj.Pointer); 63 | public IL2Object GetValue(IntPtr obj) where T : unmanaged 64 | { 65 | IntPtr returnval = IntPtr.Zero; 66 | if (HasFlag(IL2BindingFlags.FIELD_STATIC)) 67 | returnval = Import.Field.il2cpp_field_get_value_object(Pointer, IntPtr.Zero); 68 | else 69 | returnval = Import.Field.il2cpp_field_get_value_object(Pointer, obj); 70 | if (returnval != IntPtr.Zero) 71 | return new IL2Object(returnval); 72 | return null; 73 | } 74 | public void SetValue(IL2Object value) => SetValue(IntPtr.Zero, value.Pointer); 75 | public void SetValue(IntPtr value) => SetValue(IntPtr.Zero, value); 76 | public void SetValue(IL2Object obj, IntPtr value) => SetValue(obj.Pointer, value); 77 | public void SetValue(IntPtr obj, IntPtr value) 78 | { 79 | if (HasFlag(IL2BindingFlags.FIELD_STATIC)) 80 | Import.Field.il2cpp_field_static_set_value(Pointer, value); 81 | else 82 | Import.Field.il2cpp_field_set_value(obj, Pointer, value); 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/Objects/IL2Object.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | using System.Linq; 4 | 5 | namespace IL2CPP_Core.Objects 6 | { 7 | unsafe public class IL2Object : IL2Object where T : unmanaged 8 | { 9 | public IL2Object(IntPtr ptr) : base(ptr) { } 10 | public IL2Object(T value, IL2Class type) : base(IntPtr.Zero) 11 | { 12 | Pointer = Import.Object.il2cpp_object_new(type.Pointer); 13 | if (Pointer == IntPtr.Zero) 14 | throw new NullReferenceException(); 15 | 16 | *(T*)(Pointer + 0x10) = value; 17 | } 18 | 19 | /// 20 | /// IS UNMANAGED 21 | /// 22 | /// 23 | unsafe public T GetValue() 24 | { 25 | return *(T*)(Pointer + 0x10).ToPointer(); 26 | } 27 | } 28 | 29 | public class IL2Object 30 | { 31 | public IL2Object(IntPtr ptr) => Pointer = ptr; 32 | 33 | /// 34 | /// NOT UNMANAGED 35 | /// 36 | /// 37 | public T1 GetValue() where T1 : IL2Object 38 | { 39 | T1 obj = (T1)Activator.CreateInstance(typeof(T1), new object[] { IntPtr.Zero }); 40 | obj.Pointer = Pointer; 41 | return obj; 42 | } 43 | 44 | public override bool Equals(object obj) 45 | { 46 | if (obj == null) return this == null; 47 | if (obj is IL2Object b) return b.Pointer == Pointer; 48 | return false; 49 | } 50 | public override int GetHashCode() => Pointer.GetHashCode(); 51 | public static bool operator !=(IL2Object x, IL2Object y) => !(x == y); 52 | public static bool operator ==(IL2Object x, IL2Object y) 53 | { 54 | if (ReferenceEquals(x, y)) return true; 55 | if (x is null || y is null) return false; 56 | return x.Pointer == y.Pointer; 57 | } 58 | ~IL2Object() 59 | { 60 | // For Clear RAM Pointer 61 | GC.SuppressFinalize(this); 62 | } 63 | 64 | public bool Static 65 | { 66 | get => handleStatic > 0; 67 | set 68 | { 69 | if (value) 70 | { 71 | if (handleStatic < 1) 72 | { 73 | handleStatic = Import.Handler.il2cpp_gchandle_new(Pointer, true); 74 | } 75 | } 76 | else 77 | { 78 | if (handleStatic > 0) 79 | { 80 | Import.Handler.il2cpp_gchandle_free(handleStatic); 81 | handleStatic = 0; 82 | } 83 | } 84 | } 85 | } 86 | 87 | public IntPtr Pointer; 88 | 89 | private uint handleStatic = 0; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/Objects/IL2Param.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace IL2CPP_Core.Objects 4 | { 5 | public class IL2Param : IL2Object 6 | { 7 | public string Name { get; private set; } 8 | internal IL2Param(IntPtr ptr, string name) : base(ptr) 9 | { 10 | Pointer = ptr; 11 | Name = name; 12 | } 13 | public IL2ClassType ReturnType => new IL2ClassType(Pointer); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/Objects/IL2Property.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace IL2CPP_Core.Objects 5 | { 6 | public class IL2Property : IL2Object 7 | { 8 | internal IL2Property(IntPtr ptr) : base(ptr) { } 9 | 10 | private string szName; 11 | public string Name 12 | { 13 | get 14 | { 15 | if (string.IsNullOrEmpty(szName)) 16 | szName = Marshal.PtrToStringAnsi(Import.Property.il2cpp_property_get_name(Pointer)); 17 | return szName; 18 | } 19 | set 20 | { 21 | szName = value; 22 | if (GetGetMethod() != null) 23 | GetGetMethod().Name = "get_" + value; 24 | if (GetSetMethod() != null) 25 | GetSetMethod().Name = "set_" + value; 26 | } 27 | } 28 | 29 | public string OriginalName => Marshal.PtrToStringAnsi(Import.Property.il2cpp_property_get_name(Pointer)); 30 | 31 | public IL2BindingFlags Flags => (IL2BindingFlags)Import.Property.il2cpp_property_get_flags(Pointer); 32 | public bool HasFlag(IL2BindingFlags flag) => ((Flags & flag) != 0); 33 | public bool Instance => GetGetMethod() != null && GetGetMethod().Instance; 34 | 35 | public IL2Method GetGetMethod() 36 | { 37 | if (getMethod == null) 38 | { 39 | IntPtr method = Import.Property.il2cpp_property_get_get_method(Pointer); 40 | if (method != IntPtr.Zero) 41 | getMethod = new IL2Method(method); 42 | } 43 | return getMethod; 44 | } 45 | private IL2Method getMethod; 46 | public IL2Method GetSetMethod() 47 | { 48 | if (setMethod == null) 49 | { 50 | IntPtr method = Import.Property.il2cpp_property_get_set_method(Pointer); 51 | if (method != IntPtr.Zero) 52 | setMethod = new IL2Method(method); 53 | } 54 | return setMethod; 55 | } 56 | private IL2Method setMethod; 57 | 58 | public bool IsStatic => GetGetMethod()?.IsStatic == true || GetSetMethod()?.IsStatic == true; 59 | public bool IsPublic => GetGetMethod()?.IsPublic == true || GetSetMethod()?.IsPublic == true; 60 | } 61 | } -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/Action.cs: -------------------------------------------------------------------------------- 1 | using IL2CPP_Core.Objects; 2 | 3 | namespace System 4 | { 5 | unsafe public class IL2Action : IL2Object 6 | { 7 | public IL2Action(IntPtr ptr) : base(ptr) { } 8 | 9 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass("Action", "System"); 10 | } 11 | 12 | unsafe public class IL2Action : IL2Object 13 | { 14 | public IL2Action(IntPtr ptr) : base(ptr) { } 15 | 16 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass("Action`1", "System").MakeGenericType(new Type[] { typeof(T) }); 17 | } 18 | 19 | unsafe public class IL2Action : IL2Object 20 | { 21 | public IL2Action(IntPtr ptr) : base(ptr) { } 22 | 23 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass("Action`2", "System").MakeGenericType(new Type[] { typeof(T1), typeof(T2) }); 24 | } 25 | 26 | unsafe public class IL2Action : IL2Object 27 | { 28 | public IL2Action(IntPtr ptr) : base(ptr) { } 29 | 30 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass("Action`3", "System").MakeGenericType(new Type[] { typeof(T1), typeof(T2), typeof(T3) }); 31 | } 32 | unsafe public class IL2Action : IL2Object 33 | { 34 | public IL2Action(IntPtr ptr) : base(ptr) { } 35 | 36 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass("Action`4", "System").MakeGenericType(new Type[] { typeof(T1), typeof(T2), typeof(T3), typeof(T4) }); 37 | } 38 | unsafe public class IL2Action : IL2Object 39 | { 40 | public IL2Action(IntPtr ptr) : base(ptr) { } 41 | 42 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass("Action`5", "System").MakeGenericType(new Type[] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5) }); 43 | } 44 | } -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/Array.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using IL2CPP_Core.Objects; 4 | namespace System 5 | { 6 | public class IL2Array : IL2Object where T : unmanaged 7 | { 8 | public IL2Array(int length, IL2Class typeobject = null) : base(IntPtr.Zero) 9 | { 10 | if (typeobject == null) 11 | typeobject = IL2ObjectSystem.Instance_Class; 12 | 13 | Pointer = Import.Object.il2cpp_array_new(typeobject.Pointer, (ulong)length); 14 | } 15 | 16 | public IL2Array(IntPtr ptr) : base(ptr) { } 17 | 18 | unsafe public T this[int index] 19 | { 20 | get 21 | { 22 | if (index < 0 || index >= Length) 23 | { 24 | throw new ArgumentOutOfRangeException(); 25 | } 26 | return *(T*)((byte*)IntPtr.Add(Pointer, 4 * IntPtr.Size).ToPointer() + index * sizeof(T)); 27 | } 28 | set 29 | { 30 | if (index < 0 || index >= Length) 31 | { 32 | throw new ArgumentOutOfRangeException(); 33 | } 34 | *(T*)((byte*)IntPtr.Add(Pointer, 4 * IntPtr.Size).ToPointer() + index * sizeof(T)) = value; 35 | } 36 | } 37 | 38 | public int Length 39 | { 40 | get 41 | { 42 | int result; 43 | if (typeof(T) == typeof(byte)) 44 | { 45 | result = (int)Import.Object.il2cpp_array_get_byte_length(Pointer); 46 | } 47 | else 48 | { 49 | result = Import.Object.il2cpp_array_length(Pointer); 50 | } 51 | return result; 52 | } 53 | } 54 | 55 | public T[] ToArray() 56 | { 57 | int len = Length; 58 | T[] result = new T[Length]; 59 | for(int i = 0;i< len; i++) 60 | { 61 | result[i] = this[i]; 62 | } 63 | return result; 64 | } 65 | 66 | public T2[] ToArray() where T2 : IL2Object 67 | { 68 | int len = Length; 69 | T2[] result = new T2[Length]; 70 | for(int i = 0;i< len; i++) 71 | { 72 | T2 obj = (T2)Activator.CreateInstance(typeof(T2), new object[] { IntPtr.Zero }); 73 | obj.Pointer = (IntPtr)(object)this[i]; 74 | result[i] = obj; 75 | } 76 | return result; 77 | } 78 | 79 | unsafe public byte[] GetAsByteArray() 80 | { 81 | int size = (int)Import.Object.il2cpp_array_get_byte_length(Pointer); 82 | byte[] result = new byte[size]; 83 | if (size > 0) 84 | Marshal.Copy((IntPtr)((long*)Pointer + 4), result, 0, size); 85 | return result; 86 | } 87 | 88 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass(typeof(Array).Name, typeof(Array).Namespace); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/Boolean.cs: -------------------------------------------------------------------------------- 1 | using IL2CPP_Core.Objects; 2 | 3 | namespace System 4 | { 5 | public class IL2Boolean : IL2Object 6 | { 7 | public IL2Boolean(IntPtr ptr) : base(ptr) { } 8 | 9 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass(typeof(bool).Name, typeof(bool).Namespace); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/Byte.cs: -------------------------------------------------------------------------------- 1 | using IL2CPP_Core.Objects; 2 | 3 | namespace System 4 | { 5 | public class IL2Byte : IL2Object 6 | { 7 | public IL2Byte(IntPtr ptr) : base(ptr) { } 8 | 9 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass(typeof(byte).Name, typeof(byte).Namespace); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/Collections/Generic/Dictionary.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using IL2CPP_Core.Objects; 4 | 5 | namespace System.Collections.Generic 6 | { 7 | unsafe public class IL2Dictionary : IL2Object 8 | { 9 | public IL2Dictionary(IntPtr ptrNew) : base(ptrNew) { } 10 | 11 | public int Count 12 | { 13 | get => Instance_Class.GetProperty(nameof(Count)).GetGetMethod().Invoke(this).GetValue(); 14 | } 15 | 16 | public void Clear() 17 | { 18 | Instance_Class.GetMethod(nameof(Clear)).Invoke(this, ex: false); 19 | } 20 | 21 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass("Dictionary`2", "System.Collections.Generic"); 22 | } 23 | 24 | unsafe public class IL2Dictionary : IL2Dictionary where TKey : IL2Object where TValue : IL2Object 25 | { 26 | public IL2Dictionary(IntPtr ptrNew) : base(ptrNew) { } 27 | 28 | public TValue this[TKey key] 29 | { 30 | get 31 | { 32 | IL2Method method = Instance_Class.GetProperty("Item").GetGetMethod(); 33 | return method.Invoke(this, new IntPtr[] { key == null ? IntPtr.Zero : key.Pointer, method.Pointer }).GetValue(); 34 | } 35 | set 36 | { 37 | IL2Method method = Instance_Class.GetProperty("Item").GetSetMethod(); 38 | method.Invoke(this, new IntPtr[] { key == null ? IntPtr.Zero : key.Pointer, value == null ? IntPtr.Zero : value.Pointer, method.Pointer }); 39 | } 40 | } 41 | 42 | public int FindEntry(TKey key) 43 | { 44 | IL2Method method = Instance_Class.GetMethod("FindEntry"); 45 | return method.Invoke(this, new IntPtr[] { key == null ? IntPtr.Zero : key.Pointer, method.Pointer }).GetValue(); 46 | } 47 | 48 | public void Add(TKey key, TValue value) 49 | { 50 | IL2Method method = Instance_Class.GetMethod("Add"); 51 | method.Invoke(this, new IntPtr[] { key == null ? IntPtr.Zero : key.Pointer, value == null ? IntPtr.Zero : value.Pointer, method.Pointer }); 52 | } 53 | 54 | public bool Remove(TKey key) 55 | { 56 | IL2Method method = Instance_Class.GetMethod("Remove"); 57 | return method.Invoke(this, new IntPtr[] { key == null ? IntPtr.Zero : key.Pointer, method.Pointer }).GetValue(); 58 | } 59 | 60 | public static new IL2Class Instance_Class = IL2Dictionary.Instance_Class.MakeGenericType(new Type[] { typeof(TKey), typeof(TValue) }); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/Collections/Hashtable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace System.Collections 5 | { 6 | public class IL2Hashtable : IL2Object 7 | { 8 | public IL2Hashtable(IntPtr ptr) : base(ptr) { } 9 | 10 | public IntPtr this[IntPtr key] 11 | { 12 | get => Instance_Class.GetProperty("Item").GetGetMethod().Invoke(this, new IntPtr[] { key }).Pointer; 13 | set => Instance_Class.GetProperty("Item").GetSetMethod().Invoke(this, new IntPtr[] { key, value }); 14 | } 15 | 16 | // public new IEnumerator GetEnumerator() 17 | // { 18 | // return new DictionaryEntryEnumerator(((IDictionary)this).GetEnumerator()); 19 | // } 20 | 21 | public new string ToString() 22 | { 23 | return Instance_Class.GetMethod(nameof(ToString)).Invoke(this)?.GetValue().ToString(); 24 | } 25 | 26 | // public object Clone() 27 | // { 28 | // return new Dictionary(this); 29 | // } 30 | 31 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass(typeof(Hashtable).Name, typeof(Hashtable).Namespace); 32 | } 33 | } -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/IO/File.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace System.IO 5 | { 6 | public static class IL2File 7 | { 8 | public static void WriteAllBytes(string path, IntPtr bytes) 9 | { 10 | Instance_Class.GetMethod(nameof(WriteAllBytes)).Invoke(new IntPtr[] { new IL2String_utf16(path).Pointer, bytes }); 11 | } 12 | 13 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass(typeof(File).Name, typeof(File).Namespace); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/IO/MemoryStream.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace System.IO 5 | { 6 | public class IL2MemoryStream : IL2Stream 7 | { 8 | public IL2MemoryStream() : base(IntPtr.Zero) 9 | { 10 | Pointer = Import.Object.il2cpp_object_new(Instance_Class.Pointer); 11 | Instance_Class.GetMethod(".ctor").Invoke(Pointer); 12 | } 13 | 14 | public IL2MemoryStream(byte[] buffer) : base(IntPtr.Zero) 15 | { 16 | Pointer = Import.Object.il2cpp_object_new(Instance_Class.Pointer); 17 | int len = buffer.Length; 18 | IL2Array array = new IL2Array(len, IL2Byte.Instance_Class); 19 | 20 | for(int i=0;i x.GetParameters().Length == 1 && x.GetParameters()[0].Name == "buffer").Invoke(Pointer, new IntPtr[] { array.Pointer }); 26 | } 27 | 28 | public virtual byte[] ToArray() 29 | { 30 | IL2Object result = Instance_Class.GetMethod(nameof(ToArray)).Invoke(this); 31 | if (result == null) return null; 32 | return new IL2Array(result.Pointer).ToArray(); 33 | } 34 | 35 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass(typeof(MemoryStream).Name, typeof(MemoryStream).Namespace); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/IO/Stream.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace System.IO 5 | { 6 | public abstract class IL2Stream : IL2Object 7 | { 8 | public IL2Stream(IntPtr ptr) : base(ptr) { } 9 | 10 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass(typeof(Stream).Name, typeof(Stream).Namespace); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/Int32.cs: -------------------------------------------------------------------------------- 1 | using IL2CPP_Core.Objects; 2 | 3 | namespace System 4 | { 5 | public class IL2Int32 : IL2Object 6 | { 7 | public IL2Int32(IntPtr ptr) : base(ptr) { } 8 | 9 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass(typeof(bool).Name, typeof(bool).Namespace); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/Object.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace System 5 | { 6 | public class IL2ObjectSystem : IL2Object 7 | { 8 | public IL2ObjectSystem(IntPtr ptr) : base(ptr) => Pointer = ptr; 9 | 10 | public new string ToString() 11 | { 12 | return Instance_Class.GetMethod(nameof(ToString)).Invoke(this)?.GetValue().ToString(); 13 | } 14 | 15 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass(typeof(object).Name, typeof(object).Namespace); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/Reflection/Assembly.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace System.Reflection 5 | { 6 | public class IL2AssemblyCore : IL2Object 7 | { 8 | public IL2AssemblyCore(IntPtr ptr) : base(ptr) { } 9 | 10 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass(typeof(Assembly).Name, typeof(Assembly).Namespace); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/Reflection/MemberInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace System.Reflection 5 | { 6 | public class IL2MemberInfo : IL2Object 7 | { 8 | public IL2MemberInfo(IntPtr ptr) : base(ptr) { } 9 | 10 | public IL2Type DeclaringType 11 | { 12 | get => Instance_Class.GetProperty(nameof(DeclaringType)).GetGetMethod().Invoke(this)?.GetValue(); 13 | } 14 | 15 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass(typeof(MemberInfo).Name, typeof(MemberInfo).Namespace); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/Reflection/MethodBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace System.Reflection 5 | { 6 | public class IL2MethodBase : IL2MemberInfo 7 | { 8 | public IL2MethodBase(IntPtr ptr) : base(ptr) { } 9 | 10 | /// 11 | /// Not supported IL2CPP 12 | /// 13 | public IL2ParameterInfo[] GetParameters() 14 | { 15 | IL2Object result = Instance_Class.GetMethod("GetParameters").Invoke(this); 16 | if (result == null) 17 | return null; 18 | 19 | return new IL2Array(result.Pointer).ToArray(); 20 | } 21 | 22 | /// 23 | /// Not supported IL2CPP 24 | /// 25 | public IL2RuntimeMethodHandle MethodHandle 26 | { 27 | get => Instance_Class.GetProperty(nameof(MethodHandle)).GetGetMethod().Invoke(this)?.GetValue(); 28 | } 29 | 30 | /// 31 | /// Not supported IL2CPP 32 | /// 33 | public IL2MethodBody GetMethodBody() 34 | { 35 | return Instance_Class.GetMethod(nameof(GetMethodBody), x => !x.IsStatic).Invoke(this)?.GetValue(); 36 | } 37 | 38 | unsafe public static IL2MethodBody GetMethodBody(IntPtr handle) 39 | { 40 | return Instance_Class.GetMethod(nameof(GetMethodBody), x => x.IsStatic).Invoke(new IntPtr[] { new IntPtr(&handle) })?.GetValue(); 41 | } 42 | 43 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass(typeof(MethodBase).Name, typeof(MethodBase).Namespace); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/Reflection/MethodBody.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace System.Reflection 5 | { 6 | public class IL2MethodBody : IL2Object 7 | { 8 | public IL2MethodBody(IntPtr ptr) : base(ptr) { } 9 | 10 | public byte[] GetILAsByteArray() 11 | { 12 | IL2Object result = Instance_Class.GetMethod(nameof(GetILAsByteArray)).Invoke(this); 13 | if (result == null) 14 | return null; 15 | 16 | return new IL2Array(result.Pointer).ToArray(); 17 | } 18 | 19 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass(typeof(MethodBody).Name, typeof(MethodBody).Namespace); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/Reflection/MethodInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace System.Reflection 5 | { 6 | public class IL2MethodInfo : IL2MethodBase 7 | { 8 | public IL2MethodInfo(IntPtr ptr) : base(ptr) { } 9 | public MemberTypes MemberType 10 | { 11 | get => Instance_Class.GetProperty(nameof(MemberType)).GetGetMethod().Invoke(this).GetValue(); 12 | } 13 | 14 | public IL2MethodInfo GetBaseDefinition() 15 | { 16 | return Instance_Class.GetMethod(nameof(GetBaseDefinition)).Invoke(this)?.GetValue(); 17 | } 18 | 19 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass(typeof(MethodInfo).Name, typeof(MethodInfo).Namespace); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/Reflection/Module.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace System.Reflection 5 | { 6 | public class IL2Module : IL2Object 7 | { 8 | public IL2Module(IntPtr ptr) : base(ptr) { } 9 | 10 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass(typeof(Module).Name, typeof(Module).Namespace); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/Reflection/MonoMethod.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace System.Reflection 5 | { 6 | public class IL2MonoMethod : IL2RuntimeMethodInfo 7 | { 8 | public IL2MonoMethod(IntPtr ptr) : base(ptr) { } 9 | 10 | public IL2MethodInfo GetBaseDefinition() 11 | { 12 | return Instance_Class.GetMethod(nameof(GetBaseDefinition)).Invoke(this)?.GetValue(); 13 | } 14 | 15 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass("MonoMethod", "System.Reflection"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/Reflection/ParameterInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace System.Reflection 5 | { 6 | public class IL2ParameterInfo : IL2Object 7 | { 8 | public IL2ParameterInfo(IntPtr ptr) : base(ptr) { } 9 | 10 | public IL2Object DefaultValue 11 | { 12 | get => Instance_Class.GetProperty(nameof(DefaultValue)).GetGetMethod().Invoke(this); 13 | } 14 | 15 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass(typeof(ParameterInfo).Name, typeof(ParameterInfo).Namespace); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/Reflection/RuntimeMethodInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace System.Reflection 5 | { 6 | public class IL2RuntimeMethodInfo : IL2MethodBase 7 | { 8 | public IL2RuntimeMethodInfo(IntPtr ptr) : base(ptr) { } 9 | 10 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass("RuntimeMethodInfo", "System.Reflection"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/Runtime/Serialization/Formatters/Binary/BinaryFormatter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using IL2CPP_Core.Objects; 4 | 5 | namespace System.Runtime.Serialization.Formatters.Binary 6 | { 7 | public sealed class IL2BinaryFormatter : IL2Object 8 | { 9 | public IL2BinaryFormatter(IntPtr ptr) : base(ptr) { } 10 | 11 | public IL2BinaryFormatter() : base(IntPtr.Zero) 12 | { 13 | Pointer = Import.Object.il2cpp_object_new(Instance_Class.Pointer); 14 | Instance_Class.GetMethod(".ctor", x => x.GetParameters().Length == 0).Invoke(Pointer); 15 | } 16 | 17 | public void Serialize(IL2Stream serializationStream, IL2Object graph) 18 | { 19 | Instance_Class.GetMethod(nameof(Serialize), x => x.GetParameters().Length == 2).Invoke(this, new IntPtr[] { serializationStream == null ? IntPtr.Zero : serializationStream.Pointer, graph == null ? IntPtr.Zero : graph.Pointer }); 20 | } 21 | 22 | public IL2Object Deserialize(IL2Stream serializationStream) 23 | { 24 | return Instance_Class.GetMethod(nameof(Deserialize), x => x.GetParameters().Length == 1).Invoke(this, new IntPtr[] { serializationStream.Pointer }); 25 | } 26 | 27 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass(typeof(BinaryFormatter).Name, typeof(BinaryFormatter).Namespace); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/RuntimeMethodHandle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace System 5 | { 6 | public class IL2RuntimeMethodHandle : IL2Object 7 | { 8 | public IL2RuntimeMethodHandle(IntPtr ptr) : base(ptr) { } 9 | 10 | unsafe public IntPtr value 11 | { 12 | get => Instance_Class.GetField(nameof(value)).GetValue(this).GetValue(); 13 | set => Instance_Class.GetField(nameof(value)).SetValue(this, new IntPtr(&value)); 14 | } 15 | 16 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass(typeof(RuntimeMethodHandle).Name, typeof(RuntimeMethodHandle).Namespace); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/RuntimeType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using IL2CPP_Core.Objects; 4 | 5 | namespace System 6 | { 7 | public class RuntimeType : IL2Object 8 | { 9 | public RuntimeType(IntPtr ptr) : base(ptr) { } 10 | 11 | public IntPtr MakeGenericType(Type[] types) => MakeGenericType(types.Select(x => x.IL2Typeof()).ToArray()); 12 | public IntPtr MakeGenericType(IntPtr[] intPtrs) 13 | { 14 | int len = intPtrs.Length; 15 | IL2Array array = new IL2Array(len, IL2Type.Instance_Class); 16 | for(int i=0;i Instance_Class.GetProperty(nameof(ASCII)).GetGetMethod().Invoke()?.GetValue(); 12 | } 13 | 14 | public static IL2Encoding UTF8 15 | { 16 | get => Instance_Class.GetProperty(nameof(UTF8)).GetGetMethod().Invoke()?.GetValue(); 17 | } 18 | 19 | public IL2String GetString(byte[] bytes) 20 | { 21 | IL2Array array = new IL2Array(bytes.Length, IL2CPP.AssemblyList["mscorlib"].GetClass("Byte", "System")); 22 | for (int i = 0; i < array.Length; i++) 23 | { 24 | array[i] = bytes[i]; 25 | } 26 | return GetString(array); 27 | } 28 | 29 | public IL2String GetString(IL2Array bytes) 30 | { 31 | IL2Method method = Instance_Class.GetMethod(nameof(GetString), x => x.GetParameters().Length == 1 && x.GetParameters()[0].Name == "bytes"); 32 | if (method == null) 33 | return null; 34 | 35 | var result = method.Invoke(this, new IntPtr[] { bytes == null ? IntPtr.Zero : bytes.Pointer }); 36 | if (result == null) 37 | return null; 38 | 39 | return new IL2String(result.Pointer); 40 | } 41 | 42 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass(typeof(Encoding).Name, typeof(Encoding).Namespace); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/IL2CPP/System/Type.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using IL2CPP_Core.Objects; 4 | 5 | namespace System 6 | { 7 | public class IL2Type : IL2MemberInfo 8 | { 9 | public IL2Type(IntPtr ptr) : base(ptr) { } 10 | 11 | public IL2AssemblyCore Assembly 12 | { 13 | get => Instance_Class.GetProperty(nameof(Assembly)).GetGetMethod().Invoke(this)?.GetValue(); 14 | } 15 | 16 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["mscorlib"].GetClass(typeof(Type).Name, typeof(Type).Namespace); 17 | } 18 | } -------------------------------------------------------------------------------- /ares_logger/main/sdk/Photon/EventData.cs: -------------------------------------------------------------------------------- 1 | using IL2CPP_Core.Objects; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Photon 9 | { 10 | internal class EventData : IL2Object 11 | { 12 | public EventData(IntPtr ptr) : base(ptr) { } 13 | 14 | public int Sender 15 | { 16 | get => Instance_Class.GetProperty(nameof(Sender)).GetGetMethod().Invoke(this).GetValue(); 17 | } 18 | 19 | public IL2Object CustomData 20 | { 21 | get => Instance_Class.GetProperty(nameof(CustomData)).GetGetMethod().Invoke(this); 22 | } 23 | 24 | public byte Code 25 | { 26 | get => Instance_Class.GetField(nameof(Code)).GetValue(this).GetValue(); 27 | } 28 | 29 | public override string ToString() 30 | { 31 | return Instance_Class.GetMethod(nameof(ToString)).Invoke(this)?.GetValue().ToString(); 32 | } 33 | 34 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["Photon-DotNet"].GetClass("EventData", "ExitGames.Client.Photon"); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/Photon/LoadBalancingClient.cs: -------------------------------------------------------------------------------- 1 | using ares_logger.main.util; 2 | using Assembly_CSharp.VRC.Core; 3 | using IL2CPP_Core.Objects; 4 | using System; 5 | 6 | namespace Photon 7 | { 8 | internal class LoadBalancingClient : IL2Object 9 | { 10 | public LoadBalancingClient(IntPtr ptr) : base(ptr) { } 11 | 12 | public static IL2Class Instance_Class = VRCNetworkingClient.Instance_Class.BaseType; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/Application.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine 5 | { 6 | public static class Application 7 | { 8 | unsafe public static int targetFrameRate 9 | { 10 | get => Instance_Class.GetProperty(nameof(targetFrameRate)).GetGetMethod().Invoke().GetValue(); 11 | set => Instance_Class.GetProperty(nameof(targetFrameRate)).GetSetMethod().Invoke(new IntPtr[] { new IntPtr(&value) }); 12 | } 13 | 14 | public static string unityVersion 15 | { 16 | get => Instance_Class.GetProperty(nameof(unityVersion)).GetGetMethod().Invoke()?.GetValue().ToString(); 17 | } 18 | 19 | public static string version 20 | { 21 | get => Instance_Class.GetProperty(nameof(version)).GetGetMethod().Invoke()?.GetValue().ToString(); 22 | } 23 | 24 | public static string streamingAssetsPath 25 | { 26 | get => Instance_Class.GetProperty(nameof(streamingAssetsPath)).GetGetMethod().Invoke()?.GetValue().ToString(); 27 | } 28 | 29 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("Application", "UnityEngine"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/AsyncOperation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine 5 | { 6 | public class AsyncOperation : YieldInstruction 7 | { 8 | public AsyncOperation(IntPtr ptr) : base(ptr) { } 9 | 10 | unsafe public static void InternalDestroy(IntPtr ptr) 11 | { 12 | Instance_Class.GetMethod(nameof(InternalDestroy)).Invoke(new IntPtr[] { new IntPtr(&ptr) }); 13 | } 14 | 15 | public bool isDone 16 | { 17 | get => Instance_Class.GetProperty(nameof(isDone)).GetGetMethod().Invoke(this).GetValue(); 18 | } 19 | 20 | public float progress 21 | { 22 | get => Instance_Class.GetProperty(nameof(progress)).GetGetMethod().Invoke(this).GetValue(); 23 | } 24 | 25 | public bool allowSceneActivation 26 | { 27 | get => Instance_Class.GetProperty(nameof(allowSceneActivation)).GetGetMethod().Invoke(this).GetValue(); 28 | } 29 | 30 | public void InvokeCompletionEvent() 31 | { 32 | Instance_Class.GetMethod(nameof(InvokeCompletionEvent)).Invoke(); 33 | } 34 | 35 | /*public event Action completed 36 | { 37 | add 38 | { 39 | } 40 | remove 41 | { 42 | } 43 | }*/ 44 | 45 | unsafe public IntPtr m_Ptr 46 | { 47 | get => Instance_Class.GetField(nameof(m_Ptr)).GetValue(this).GetValue(); 48 | set => Instance_Class.GetField(nameof(m_Ptr)).SetValue(this, new IntPtr(&value)); 49 | } 50 | 51 | // private Action m_completeCallback; 52 | 53 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("AsyncOperation", "UnityEngine"); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/Behaviour.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine 5 | { 6 | /// 7 | /// Behaviours are Components that can be enabled or disabled. 8 | /// 9 | public class Behaviour : Component 10 | { 11 | public Behaviour(IntPtr ptr) : base(ptr) { } 12 | 13 | unsafe public bool enabled 14 | { 15 | get => Instance_Class.GetProperty(nameof(enabled)).GetGetMethod().Invoke(this).GetValue(); 16 | set => Instance_Class.GetProperty(nameof(enabled)).GetSetMethod().Invoke(this, new IntPtr[] { new IntPtr(&value) }); 17 | } 18 | 19 | public bool isActiveAndEnabled 20 | { 21 | get => Instance_Class.GetProperty(nameof(isActiveAndEnabled)).GetGetMethod().Invoke(this).GetValue(); 22 | } 23 | 24 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("Behaviour", "UnityEngine"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/Camera.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine 5 | { 6 | public sealed class Camera : MonoBehaviour 7 | { 8 | public Camera(IntPtr ptr) : base(ptr) { } 9 | 10 | public static Camera main 11 | { 12 | get => Instance_Class.GetProperty(nameof(main)).GetGetMethod().Invoke()?.GetValue(); 13 | } 14 | 15 | public static Camera current 16 | { 17 | get => Instance_Class.GetProperty(nameof(current)).GetGetMethod().Invoke()?.GetValue(); 18 | } 19 | 20 | unsafe public Ray ScreenPointToRay(Vector3 pos) 21 | { 22 | return Instance_Class.GetMethod("ScreenPointToRay", x => x.GetParameters().Length == 1).Invoke(this, new IntPtr[] { new IntPtr(&pos) }).GetValue(); 23 | } 24 | 25 | unsafe public Vector3 WorldToScreenPoint(Vector3 position, Camera.MonoOrStereoscopicEye eye) 26 | { 27 | return Instance_Class.GetMethod(nameof(WorldToScreenPoint), x => x.GetParameters().Length == 2).Invoke(this, new IntPtr[] { new IntPtr(&position), new IntPtr(&eye) }).GetValue(); 28 | } 29 | 30 | unsafe public Vector3 WorldToScreenPoint(Vector3 position) 31 | { 32 | return Instance_Class.GetMethod(nameof(WorldToScreenPoint), x => x.GetParameters().Length == 1).Invoke(this, new IntPtr[] { new IntPtr(&position) }).GetValue(); 33 | } 34 | 35 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("Camera", "UnityEngine"); 36 | 37 | public enum StereoscopicEye 38 | { 39 | Left, 40 | Right 41 | } 42 | 43 | public enum MonoOrStereoscopicEye 44 | { 45 | Left, 46 | Right, 47 | Mono 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/Color32.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace UnityEngine 5 | { 6 | /// 7 | /// Representation of RGBA colors in 32 bit format. 8 | /// 9 | [StructLayout(LayoutKind.Explicit)] 10 | public struct Color32 11 | { 12 | /// 13 | /// Constructs a new Color32 with given r, g, b, a components. 14 | /// 15 | /// 16 | /// 17 | /// 18 | /// 19 | // Token: 0x06001350 RID: 4944 RVA: 0x0001D572 File Offset: 0x0001B772 20 | public Color32(byte r, byte g, byte b, byte a) 21 | { 22 | rgba = 0; 23 | this.r = r; 24 | this.g = g; 25 | this.b = b; 26 | this.a = a; 27 | } 28 | 29 | public static implicit operator Color32(Color c) 30 | { 31 | return new Color32((byte)(Mathf.Clamp01(c.r) * 255f), (byte)(Mathf.Clamp01(c.g) * 255f), (byte)(Mathf.Clamp01(c.b) * 255f), (byte)(Mathf.Clamp01(c.a) * 255f)); 32 | } 33 | 34 | public static implicit operator Color(Color32 c) 35 | { 36 | return new Color(c.r / 255f, c.g / 255f, c.b / 255f, c.a / 255f); 37 | } 38 | 39 | /// 40 | /// Linearly interpolates between colors a and b by t. 41 | /// 42 | /// 43 | /// 44 | /// 45 | public static Color32 Lerp(Color32 a, Color32 b, float t) 46 | { 47 | t = Mathf.Clamp01(t); 48 | return new Color32((byte)(a.r + (b.r - a.r) * t), (byte)(a.g + (b.g - a.g) * t), (byte)(a.b + (b.b - a.b) * t), (byte)(a.a + (b.a - a.a) * t)); 49 | } 50 | 51 | /// 52 | /// Linearly interpolates between colors a and b by t. 53 | /// 54 | /// 55 | /// 56 | /// 57 | public static Color32 LerpUnclamped(Color32 a, Color32 b, float t) 58 | { 59 | return new Color32((byte)(a.r + (b.r - a.r) * t), (byte)(a.g + (b.g - a.g) * t), (byte)(a.b + (b.b - a.b) * t), (byte)(a.a + (b.a - a.a) * t)); 60 | } 61 | 62 | /// 63 | /// Returns a nicely formatted string of this color. 64 | /// 65 | /// 66 | public override string ToString() 67 | { 68 | return UnityString.Format("RGBA({0}, {1}, {2}, {3})", new object[] 69 | { 70 | r, 71 | g, 72 | b, 73 | a 74 | }); 75 | } 76 | 77 | /// 78 | /// Returns a nicely formatted string of this color. 79 | /// 80 | /// 81 | public string ToString(string format) 82 | { 83 | return UnityString.Format("RGBA({0}, {1}, {2}, {3})", new object[] 84 | { 85 | r.ToString(format), 86 | g.ToString(format), 87 | b.ToString(format), 88 | a.ToString(format) 89 | }); 90 | } 91 | 92 | [FieldOffset(0)] 93 | private int rgba; 94 | 95 | /// 96 | /// Red component of the color. 97 | /// 98 | [FieldOffset(0)] 99 | public byte r; 100 | 101 | /// 102 | /// Green component of the color. 103 | /// 104 | [FieldOffset(1)] 105 | public byte g; 106 | 107 | /// 108 | /// Blue component of the color. 109 | /// 110 | [FieldOffset(2)] 111 | public byte b; 112 | 113 | /// 114 | /// Alpha component of the color. 115 | /// 116 | [FieldOffset(3)] 117 | public byte a; 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/Component.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | 5 | namespace UnityEngine 6 | { 7 | public class Component : Object 8 | { 9 | public Component(IntPtr ptr) : base(ptr) { } 10 | 11 | public Transform transform 12 | { 13 | get => Instance_Class.GetProperty(nameof(transform)).GetGetMethod().Invoke(this)?.GetValue(); 14 | } 15 | 16 | public T GetComponentInChildren() where T : Component => GetComponentInChildren(typeof(T))?.GetValue(); 17 | public T GetComponentInChildren(bool includeInactive) where T : Component => GetComponentInChildren(typeof(T), includeInactive).GetValue(); 18 | public T[] GetComponentsInChildren() where T : Component => gameObject?.GetComponentsInChildren(); 19 | public T[] GetComponentsInChildren(bool includeInactive) where T : Component => gameObject?.GetComponentsInChildren(includeInactive); 20 | public Component GetComponentInChildren(Type type) => GetComponentInChildren(type, false); 21 | public Component GetComponentInChildren(Type type, bool includeInactive) => gameObject?.GetComponentInChildren(type, includeInactive); 22 | public Component[] GetComponentsInChildren(Type type) => gameObject?.GetComponentsInChildren(type); 23 | public Component[] GetComponentsInChildren(Type type, bool includeInactive) => gameObject?.GetComponentsInChildren(type, includeInactive); 24 | public T GetComponent() where T : Component => gameObject?.GetComponent(); 25 | public T[] GetComponents() where T : Component => gameObject?.GetComponents(); 26 | public Component GetComponent(Type type) => gameObject?.GetComponent(type); 27 | public Component GetComponent(string type) => gameObject?.GetComponent(type); 28 | public Component[] GetComponents(Type type) => gameObject?.GetComponents(type); 29 | 30 | public string tag 31 | { 32 | get => gameObject.tag; 33 | set => gameObject.tag = value; 34 | } 35 | 36 | public GameObject gameObject 37 | { 38 | get => Instance_Class.GetProperty(nameof(gameObject)).GetGetMethod().Invoke(this)?.GetValue(); 39 | } 40 | 41 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("Component", "UnityEngine"); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/Coroutine.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine 5 | { 6 | public sealed class Coroutine : YieldInstruction 7 | { 8 | public Coroutine(IntPtr ptr) : base(ptr) { } 9 | 10 | unsafe public Coroutine() : base(IntPtr.Zero) 11 | { 12 | Pointer = Import.Object.il2cpp_object_new(Instance_Class.Pointer); 13 | Instance_Class.GetMethod(".ctor").Invoke(Pointer); 14 | } 15 | 16 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("Coroutine", "UnityEngine"); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/DrivenTransformProperties.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnityEngine 4 | { 5 | [Flags] 6 | public enum DrivenTransformProperties 7 | { 8 | None = 0, 9 | All = -1, 10 | AnchoredPositionX = 2, 11 | AnchoredPositionY = 4, 12 | AnchoredPositionZ = 8, 13 | Rotation = 16, 14 | ScaleX = 32, 15 | ScaleY = 64, 16 | ScaleZ = 128, 17 | AnchorMinX = 256, 18 | AnchorMinY = 512, 19 | AnchorMaxX = 1024, 20 | AnchorMaxY = 2048, 21 | SizeDeltaX = 4096, 22 | SizeDeltaY = 8192, 23 | PivotX = 16384, 24 | PivotY = 32768, 25 | AnchoredPosition = 6, 26 | AnchoredPosition3D = 14, 27 | Scale = 224, 28 | AnchorMin = 768, 29 | AnchorMax = 3072, 30 | Anchors = 3840, 31 | SizeDelta = 12288, 32 | Pivot = 49152 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/Events/UnityAction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnityEngine.Events 4 | { 5 | public delegate void UnityAction(); 6 | public delegate void UnityAction(T0 arg0); 7 | public delegate void UnityAction(T0 arg0, T1 arg1); 8 | public delegate void UnityAction(T0 arg0, T1 arg1, T2 arg2); 9 | public delegate void UnityAction(T0 arg0, T1 arg1, T2 arg2, T3 arg3); 10 | } 11 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/Events/UnityEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine.Events 5 | { 6 | public class UnityEvent : UnityEventBase 7 | { 8 | public UnityEvent(IntPtr ptr) : base(ptr) { } 9 | 10 | 11 | public void AddListener(UnityAction action) 12 | { 13 | IL2Delegate @delegate = IL2Delegate.CreateDelegate(action, IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("UnityAction", "UnityEngine.Events")); 14 | Instance_Class.GetMethod("AddListener").Invoke(this, new IntPtr[] { @delegate == null ? IntPtr.Zero : @delegate.Pointer }); 15 | } 16 | 17 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("UnityEvent", "UnityEngine.Events"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/Events/UnityEventBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine.Events 5 | { 6 | public class UnityEventBase : IL2Object 7 | { 8 | public UnityEventBase(IntPtr ptr) : base(ptr) { } 9 | 10 | public void RemoveAllListeners() 11 | { 12 | Instance_Class.GetMethod(nameof(RemoveAllListeners)).Invoke(this); 13 | } 14 | 15 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("UnityEventBase", "UnityEngine.Events"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/Experimental/Rendering/GraphicsFormat.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | 4 | namespace UnityEngine.Experimental.Rendering 5 | { 6 | public enum GraphicsFormat 7 | { 8 | None, 9 | R8_SRGB, 10 | R8G8_SRGB, 11 | R8G8B8_SRGB, 12 | R8G8B8A8_SRGB, 13 | R8_UNorm, 14 | R8G8_UNorm, 15 | R8G8B8_UNorm, 16 | R8G8B8A8_UNorm, 17 | R8_SNorm, 18 | R8G8_SNorm, 19 | R8G8B8_SNorm, 20 | R8G8B8A8_SNorm, 21 | R8_UInt, 22 | R8G8_UInt, 23 | R8G8B8_UInt, 24 | R8G8B8A8_UInt, 25 | R8_SInt, 26 | R8G8_SInt, 27 | R8G8B8_SInt, 28 | R8G8B8A8_SInt, 29 | R16_UNorm, 30 | R16G16_UNorm, 31 | R16G16B16_UNorm, 32 | R16G16B16A16_UNorm, 33 | R16_SNorm, 34 | R16G16_SNorm, 35 | R16G16B16_SNorm, 36 | R16G16B16A16_SNorm, 37 | R16_UInt, 38 | R16G16_UInt, 39 | R16G16B16_UInt, 40 | R16G16B16A16_UInt, 41 | R16_SInt, 42 | R16G16_SInt, 43 | R16G16B16_SInt, 44 | R16G16B16A16_SInt, 45 | R32_UInt, 46 | R32G32_UInt, 47 | R32G32B32_UInt, 48 | R32G32B32A32_UInt, 49 | R32_SInt, 50 | R32G32_SInt, 51 | R32G32B32_SInt, 52 | R32G32B32A32_SInt, 53 | R16_SFloat, 54 | R16G16_SFloat, 55 | R16G16B16_SFloat, 56 | R16G16B16A16_SFloat, 57 | R32_SFloat, 58 | R32G32_SFloat, 59 | R32G32B32_SFloat, 60 | R32G32B32A32_SFloat, 61 | B8G8R8_SRGB = 56, 62 | B8G8R8A8_SRGB, 63 | B8G8R8_UNorm, 64 | B8G8R8A8_UNorm, 65 | B8G8R8_SNorm, 66 | B8G8R8A8_SNorm, 67 | B8G8R8_UInt, 68 | B8G8R8A8_UInt, 69 | B8G8R8_SInt, 70 | B8G8R8A8_SInt, 71 | R4G4B4A4_UNormPack16, 72 | B4G4R4A4_UNormPack16, 73 | R5G6B5_UNormPack16, 74 | B5G6R5_UNormPack16, 75 | R5G5B5A1_UNormPack16, 76 | B5G5R5A1_UNormPack16, 77 | A1R5G5B5_UNormPack16, 78 | E5B9G9R9_UFloatPack32, 79 | B10G11R11_UFloatPack32, 80 | A2B10G10R10_UNormPack32, 81 | A2B10G10R10_UIntPack32, 82 | A2B10G10R10_SIntPack32, 83 | A2R10G10B10_UNormPack32, 84 | A2R10G10B10_UIntPack32, 85 | A2R10G10B10_SIntPack32, 86 | A2R10G10B10_XRSRGBPack32, 87 | A2R10G10B10_XRUNormPack32, 88 | R10G10B10_XRSRGBPack32, 89 | R10G10B10_XRUNormPack32, 90 | A10R10G10B10_XRSRGBPack32, 91 | A10R10G10B10_XRUNormPack32, 92 | [Obsolete("Enum member GraphicsFormat.RGB_DXT1_SRGB has been deprecated. Use GraphicsFormat.RGBA_DXT1_SRGB instead (UnityUpgradable) -> RGBA_DXT1_SRGB", true)] 93 | RGB_DXT1_SRGB = 96, 94 | RGBA_DXT1_SRGB = 96, 95 | [Obsolete("Enum member GraphicsFormat.RGB_DXT1_UNorm has been deprecated. Use GraphicsFormat.RGBA_DXT1_UNorm instead (UnityUpgradable) -> RGBA_DXT1_UNorm", true)] 96 | RGB_DXT1_UNorm, 97 | RGBA_DXT1_UNorm = 97, 98 | RGBA_DXT3_SRGB, 99 | RGBA_DXT3_UNorm, 100 | RGBA_DXT5_SRGB, 101 | RGBA_DXT5_UNorm, 102 | R_BC4_UNorm, 103 | R_BC4_SNorm, 104 | RG_BC5_UNorm, 105 | RG_BC5_SNorm, 106 | RGB_BC6H_UFloat, 107 | RGB_BC6H_SFloat, 108 | RGBA_BC7_SRGB, 109 | RGBA_BC7_UNorm, 110 | RGB_PVRTC_2Bpp_SRGB, 111 | RGB_PVRTC_2Bpp_UNorm, 112 | RGB_PVRTC_4Bpp_SRGB, 113 | RGB_PVRTC_4Bpp_UNorm, 114 | RGBA_PVRTC_2Bpp_SRGB, 115 | RGBA_PVRTC_2Bpp_UNorm, 116 | RGBA_PVRTC_4Bpp_SRGB, 117 | RGBA_PVRTC_4Bpp_UNorm, 118 | RGB_ETC_UNorm, 119 | RGB_ETC2_SRGB, 120 | RGB_ETC2_UNorm, 121 | RGB_A1_ETC2_SRGB, 122 | RGB_A1_ETC2_UNorm, 123 | RGBA_ETC2_SRGB, 124 | RGBA_ETC2_UNorm, 125 | R_EAC_UNorm, 126 | R_EAC_SNorm, 127 | RG_EAC_UNorm, 128 | RG_EAC_SNorm, 129 | RGBA_ASTC4X4_SRGB, 130 | RGBA_ASTC4X4_UNorm, 131 | RGBA_ASTC5X5_SRGB, 132 | RGBA_ASTC5X5_UNorm, 133 | RGBA_ASTC6X6_SRGB, 134 | RGBA_ASTC6X6_UNorm, 135 | RGBA_ASTC8X8_SRGB, 136 | RGBA_ASTC8X8_UNorm, 137 | RGBA_ASTC10X10_SRGB, 138 | RGBA_ASTC10X10_UNorm, 139 | RGBA_ASTC12X12_SRGB, 140 | RGBA_ASTC12X12_UNorm 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/Graphics.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine 5 | { 6 | public class Graphics : IL2Object 7 | { 8 | public Graphics(IntPtr ptr) : base(ptr) { } 9 | 10 | public static void Blit(Texture source, RenderTexture dest) 11 | { 12 | Instance_Class.GetMethod(nameof(Blit), x => x.GetParameters().Length == 2).Invoke(new IntPtr[] { source == null ? IntPtr.Zero : source.Pointer, dest == null ? IntPtr.Zero : dest.Pointer }); 13 | } 14 | 15 | public static void DrawTexture(Rect screenRect, Texture texture, Material mat) 16 | { 17 | int pass = -1; 18 | DrawTexture(screenRect, texture, mat, pass); 19 | } 20 | 21 | public static void DrawTexture(Rect screenRect, Texture texture) 22 | { 23 | int pass = -1; 24 | Material mat = null; 25 | DrawTexture(screenRect, texture, mat, pass); 26 | } 27 | 28 | public static void DrawTexture(Rect screenRect, Texture texture, Material mat = null, int pass = -1) 29 | { 30 | DrawTexture(screenRect, texture, 0, 0, 0, 0, mat, pass); 31 | } 32 | 33 | public static void DrawTexture(Rect screenRect, Texture texture, int leftBorder, int rightBorder, int topBorder, int bottomBorder, Material mat) 34 | { 35 | int pass = -1; 36 | DrawTexture(screenRect, texture, leftBorder, rightBorder, topBorder, bottomBorder, mat, pass); 37 | } 38 | 39 | public static void DrawTexture(Rect screenRect, Texture texture, int leftBorder, int rightBorder, int topBorder, int bottomBorder) 40 | { 41 | int pass = -1; 42 | Material mat = null; 43 | DrawTexture(screenRect, texture, leftBorder, rightBorder, topBorder, bottomBorder, mat, pass); 44 | } 45 | public static void DrawTexture(Rect screenRect, Texture texture, int leftBorder, int rightBorder, int topBorder, int bottomBorder, Material mat = null, int pass = -1) 46 | { 47 | DrawTexture(screenRect, texture, new Rect(0f, 0f, 1f, 1f), leftBorder, rightBorder, topBorder, bottomBorder, mat, pass); 48 | } 49 | 50 | public static void DrawTexture(Rect screenRect, Texture texture, Rect sourceRect, int leftBorder, int rightBorder, int topBorder, int bottomBorder, Material mat) 51 | { 52 | int pass = -1; 53 | DrawTexture(screenRect, texture, sourceRect, leftBorder, rightBorder, topBorder, bottomBorder, mat, pass); 54 | } 55 | 56 | public static void DrawTexture(Rect screenRect, Texture texture, Rect sourceRect, int leftBorder, int rightBorder, int topBorder, int bottomBorder) 57 | { 58 | int pass = -1; 59 | Material mat = null; 60 | DrawTexture(screenRect, texture, sourceRect, leftBorder, rightBorder, topBorder, bottomBorder, mat, pass); 61 | } 62 | 63 | public static void DrawTexture(Rect screenRect, Texture texture, Rect sourceRect, int leftBorder, int rightBorder, int topBorder, int bottomBorder, Material mat = null, int pass = -1) 64 | { 65 | Color32 c = new Color32(128, 128, 128, 128); 66 | DrawTextureImpl(screenRect, texture, sourceRect, leftBorder, rightBorder, topBorder, bottomBorder, c, mat, pass); 67 | } 68 | 69 | unsafe private static void DrawTextureImpl(Rect screenRect, Texture texture, Rect sourceRect, int leftBorder, int rightBorder, int topBorder, int bottomBorder, Color color, Material mat, int pass) 70 | { 71 | Instance_Class.GetMethod(nameof(DrawTextureImpl)).Invoke(new IntPtr[] { new IntPtr(&screenRect), texture == null ? IntPtr.Zero : texture.Pointer, new IntPtr(&sourceRect), new IntPtr(&leftBorder), new IntPtr(&rightBorder), new IntPtr(&topBorder), new IntPtr(&bottomBorder), new IntPtr(&color), mat == null ? IntPtr.Zero : mat.Pointer, new IntPtr(&pass) }); 72 | } 73 | 74 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("Graphics", "UnityEngine"); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/HideFlags.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnityEngine 4 | { 5 | [Flags] 6 | public enum HideFlags 7 | { 8 | None = 0, 9 | HideInHierarchy = 1, 10 | HideInInspector = 2, 11 | DontSaveInEditor = 4, 12 | NotEditable = 8, 13 | DontSaveInBuild = 16, 14 | DontUnloadUnusedAsset = 32, 15 | DontSave = 52, 16 | HideAndDontSave = 61 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/Input.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine 5 | { 6 | public static class Input 7 | { 8 | public static float GetAxis(string axisName) => Instance_Class.GetMethod(nameof(GetAxis)).Invoke(new IntPtr[] { new IL2String_utf8(axisName).Pointer }).GetValue(); 9 | unsafe public static bool GetKey(KeyCode key) => Instance_Class.GetMethod("GetKeyInt").Invoke(new IntPtr[] { new IntPtr(&key) }).GetValue(); 10 | unsafe public static bool GetKeyDown(KeyCode key) => Instance_Class.GetMethod("GetKeyDownInt").Invoke(new IntPtr[] { new IntPtr(&key) }).GetValue(); 11 | unsafe public static bool GetKeyUp(KeyCode key) => Instance_Class.GetMethod("GetKeyUpInt").Invoke(new IntPtr[] { new IntPtr(&key) }).GetValue(); 12 | public static bool GetButtonDown(string buttonName) => Instance_Class.GetMethod(nameof(GetButtonDown)).Invoke(new IntPtr[] { new IL2String_utf8(buttonName).Pointer }).GetValue(); 13 | 14 | public static Vector3 mousePosition 15 | { 16 | get => Instance_Class.GetProperty(nameof(mousePosition)).GetGetMethod().Invoke().GetValue(); 17 | } 18 | 19 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.InputLegacyModule"].GetClass("Input", "UnityEngine"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/LayerMask.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.CompilerServices; 3 | 4 | namespace UnityEngine 5 | { 6 | /// 7 | /// Specifies Layers to use in a Physics.Raycast. 8 | /// 9 | public struct LayerMask 10 | { 11 | public static implicit operator int(LayerMask mask) 12 | { 13 | return mask.m_Mask; 14 | } 15 | 16 | public static implicit operator LayerMask(int intVal) 17 | { 18 | LayerMask result; 19 | result.m_Mask = intVal; 20 | return result; 21 | } 22 | 23 | /// 24 | /// Converts a layer mask value to an integer value. 25 | /// 26 | public int value 27 | { 28 | get 29 | { 30 | return m_Mask; 31 | } 32 | set 33 | { 34 | m_Mask = value; 35 | } 36 | } 37 | 38 | private int m_Mask; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/LightShadows.cs: -------------------------------------------------------------------------------- 1 | namespace UnityEngine 2 | { 3 | public enum LightShadows 4 | { 5 | None, 6 | Hard, 7 | Soft 8 | } 9 | } -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/LightType.cs: -------------------------------------------------------------------------------- 1 | namespace UnityEngine 2 | { 3 | public enum LightType 4 | { 5 | Spot, 6 | Directional, 7 | Point, 8 | Area, 9 | Rectangle = 3, 10 | Disc 11 | } 12 | } -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/Material.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine 5 | { 6 | /// 7 | /// Behaviours are Components that can be enabled or disabled. 8 | /// 9 | public class Material : Object 10 | { 11 | public Material(IntPtr ptr) : base(ptr) { } 12 | 13 | public Shader shader 14 | { 15 | get => Instance_Class.GetProperty(nameof(shader)).GetGetMethod().Invoke(this)?.GetValue(); 16 | set => Instance_Class.GetProperty(nameof(shader)).GetSetMethod().Invoke(this, new IntPtr[] { value == null ? IntPtr.Zero : value.Pointer }); 17 | } 18 | 19 | unsafe public Color color 20 | { 21 | get => Instance_Class.GetProperty(nameof(color)).GetGetMethod().Invoke(this).GetValue(); 22 | set => Instance_Class.GetProperty(nameof(color)).GetSetMethod().Invoke(this, new IntPtr[] { new IntPtr(&value) }); 23 | } 24 | 25 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("Material", "UnityEngine"); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/MeshFilter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine 5 | { 6 | /// 7 | /// Behaviours are Components that can be enabled or disabled. 8 | /// 9 | public class MeshFilter : Component 10 | { 11 | public MeshFilter(IntPtr ptr) : base(ptr) { } 12 | 13 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("MeshFilter", "UnityEngine"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/MeshRenderer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine 5 | { 6 | /// 7 | /// Behaviours are Components that can be enabled or disabled. 8 | /// 9 | public class MeshRenderer : Renderer 10 | { 11 | public MeshRenderer(IntPtr ptr) : base(ptr) { } 12 | 13 | 14 | 15 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("MeshRenderer", "UnityEngine"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/MonoBehaviour.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine 5 | { 6 | /// 7 | /// Behaviours are Components that can be enabled or disabled. 8 | /// 9 | public class MonoBehaviour : Behaviour 10 | { 11 | public MonoBehaviour(IntPtr ptr) : base(ptr) { } 12 | 13 | public void StopAllCoroutines() 14 | { 15 | Instance_Class.GetMethod(nameof(StopAllCoroutines)).Invoke(this); 16 | } 17 | 18 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("MonoBehaviour", "UnityEngine"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/PrimitiveType.cs: -------------------------------------------------------------------------------- 1 | namespace UnityEngine 2 | { 3 | /// 4 | /// The various primitives that can be created using the GameObject.CreatePrimitive function. 5 | /// 6 | public enum PrimitiveType 7 | { 8 | /// 9 | /// A sphere primitive. 10 | /// 11 | Sphere, 12 | /// 13 | /// A capsule primitive. 14 | /// 15 | Capsule, 16 | /// 17 | /// A cylinder primitive. 18 | /// 19 | Cylinder, 20 | /// 21 | /// A cube primitive. 22 | /// 23 | Cube, 24 | /// 25 | /// A plane primitive. 26 | /// 27 | Plane, 28 | /// 29 | /// A Quad primitive. 30 | /// 31 | Quad 32 | } 33 | } -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/Ray.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnityEngine 4 | { 5 | /// 6 | /// Representation of rays. 7 | /// 8 | public struct Ray 9 | { 10 | /// 11 | /// Creates a ray starting at origin along direction. 12 | /// 13 | /// 14 | /// 15 | public Ray(Vector3 origin, Vector3 direction) 16 | { 17 | this.m_Origin = origin; 18 | this.m_Direction = direction.normalized; 19 | } 20 | 21 | /// 22 | /// The origin point of the ray. 23 | /// 24 | public Vector3 origin 25 | { 26 | get 27 | { 28 | return this.m_Origin; 29 | } 30 | set 31 | { 32 | this.m_Origin = value; 33 | } 34 | } 35 | 36 | /// 37 | /// The direction of the ray. 38 | /// 39 | public Vector3 direction 40 | { 41 | get 42 | { 43 | return this.m_Direction; 44 | } 45 | set 46 | { 47 | this.m_Direction = value.normalized; 48 | } 49 | } 50 | 51 | /// 52 | /// Returns a point at distance units along the ray. 53 | /// 54 | /// 55 | public Vector3 GetPoint(float distance) 56 | { 57 | return this.m_Origin + this.m_Direction * distance; 58 | } 59 | 60 | /// 61 | /// Returns a nicely formatted string for this ray. 62 | /// 63 | /// 64 | public override string ToString() 65 | { 66 | return UnityString.Format("Origin: {0}, Dir: {1}", new object[] 67 | { 68 | this.m_Origin, 69 | this.m_Direction 70 | }); 71 | } 72 | 73 | /// 74 | /// Returns a nicely formatted string for this ray. 75 | /// 76 | /// 77 | public string ToString(string format) 78 | { 79 | return UnityString.Format("Origin: {0}, Dir: {1}", new object[] 80 | { 81 | this.m_Origin.ToString(format), 82 | this.m_Direction.ToString(format) 83 | }); 84 | } 85 | 86 | private Vector3 m_Origin; 87 | 88 | private Vector3 m_Direction; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/RenderTexture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine 5 | { 6 | public class RenderTexture : Texture 7 | { 8 | public RenderTexture(IntPtr ptr) : base(ptr) { } 9 | 10 | unsafe public static RenderTexture GetTemporary(int width, int height, int depthBuffer, RenderTextureFormat format, RenderTextureReadWrite readWrite) 11 | { 12 | return Instance_Class.GetMethod(nameof(GetTemporary), x => x.GetParameters().Length == 5 13 | && x.GetParameters()[3].ReturnType.Name == "UnityEngine.RenderTextureFormat" && x.GetParameters()[4].ReturnType.Name == "UnityEngine.RenderTextureReadWrite").Invoke(new IntPtr[] { new IntPtr(&width), new IntPtr(&height), new IntPtr(&depthBuffer), new IntPtr(&format), new IntPtr(&readWrite) })?.GetValue(); 14 | } 15 | 16 | 17 | public static RenderTexture active 18 | { 19 | get => Instance_Class.GetProperty(nameof(active)).GetGetMethod().Invoke()?.GetValue(); 20 | set => Instance_Class.GetProperty(nameof(active)).GetSetMethod().Invoke(new IntPtr[] { value == null ? IntPtr.Zero : value.Pointer }); 21 | } 22 | 23 | public static void ReleaseTemporary(RenderTexture temp) 24 | { 25 | Instance_Class.GetMethod(nameof(ReleaseTemporary)).Invoke(new IntPtr[] { temp == null ? IntPtr.Zero : temp.Pointer }); 26 | } 27 | 28 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("RenderTexture", "UnityEngine"); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/RenderTextureFormat.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnityEngine 4 | { 5 | public enum RenderTextureFormat 6 | { 7 | ARGB32, 8 | Depth, 9 | ARGBHalf, 10 | Shadowmap, 11 | RGB565, 12 | ARGB4444, 13 | ARGB1555, 14 | Default, 15 | ARGB2101010, 16 | DefaultHDR, 17 | ARGB64, 18 | ARGBFloat, 19 | RGFloat, 20 | RGHalf, 21 | RFloat, 22 | RHalf, 23 | R8, 24 | ARGBInt, 25 | RGInt, 26 | RInt, 27 | BGRA32, 28 | RGB111110Float = 22, 29 | RG32, 30 | RGBAUShort, 31 | RG16, 32 | BGRA10101010_XR, 33 | BGR101010_XR, 34 | R16 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/RenderTextureReadWrite.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnityEngine 4 | { 5 | public enum RenderTextureReadWrite 6 | { 7 | Default, 8 | Linear, 9 | sRGB 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/Renderer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine 5 | { 6 | /// 7 | /// Behaviours are Components that can be enabled or disabled. 8 | /// 9 | public class Renderer : MonoBehaviour 10 | { 11 | public Renderer(IntPtr ptr) : base(ptr) { } 12 | 13 | public Material material 14 | { 15 | get => Instance_Class.GetProperty(nameof(material)).GetGetMethod().Invoke(this)?.GetValue(); 16 | set => Instance_Class.GetProperty(nameof(material)).GetSetMethod().Invoke(this, new IntPtr[] { value == null ? IntPtr.Zero : value.Pointer }); 17 | } 18 | 19 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("Renderer", "UnityEngine"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/Resources.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using IL2CPP_Core.Objects; 4 | 5 | namespace UnityEngine 6 | { 7 | public sealed class Resources 8 | { 9 | public static T[] FindObjectsOfTypeAll() where T : Object 10 | { 11 | Object[] objects = FindObjectsOfTypeAll(typeof(T)); 12 | T[] result = new T[objects.Length]; 13 | for (int i = 0; i < objects.Length; i++) 14 | { 15 | result[i] = objects[i].GetValue(); 16 | } 17 | return result; 18 | } 19 | public static Object[] FindObjectsOfTypeAll(Type type) 20 | { 21 | IntPtr typeObject = type.IL2Typeof(); 22 | if (typeObject == IntPtr.Zero) 23 | return null; 24 | 25 | IL2Object @object = Instance_Class.GetMethod(nameof(FindObjectsOfTypeAll), x => x.ReturnType.Name == Object.Instance_Class.FullName + "[]").Invoke(new IntPtr[] { typeObject }); 26 | if (@object == null) 27 | return null; 28 | 29 | return new IL2Array(@object.Pointer).ToArray(); 30 | } 31 | 32 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("Resources", "UnityEngine"); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/SceneManagement/LoadSceneMode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnityEngine.SceneManagement 4 | { 5 | public enum LoadSceneMode 6 | { 7 | Single, 8 | Additive 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/SceneManagement/LoadSceneParameters.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnityEngine.SceneManagement 4 | { 5 | [Serializable] 6 | public struct LoadSceneParameters 7 | { 8 | public LoadSceneParameters(LoadSceneMode mode) 9 | { 10 | m_LoadSceneMode = mode; 11 | m_LocalPhysicsMode = LocalPhysicsMode.None; 12 | } 13 | 14 | // [SerializeField] 15 | private LoadSceneMode m_LoadSceneMode; 16 | 17 | // [SerializeField] 18 | private LocalPhysicsMode m_LocalPhysicsMode; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/SceneManagement/LocalPhysicsMode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnityEngine.SceneManagement 4 | { 5 | [Flags] 6 | public enum LocalPhysicsMode 7 | { 8 | None = 0, 9 | Physics2D = 1, 10 | Physics3D = 2 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/SceneManagement/Scene.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using IL2CPP_Core.Objects; 4 | 5 | namespace UnityEngine.SceneManagement 6 | { 7 | [Serializable] 8 | public struct Scene 9 | { 10 | unsafe private static bool IsValidInternal(int sceneHandle) 11 | { 12 | return Instance_Class.GetMethod(nameof(IsValidInternal)).Invoke(new IntPtr[] { new IntPtr(&sceneHandle) }).GetValue(); 13 | } 14 | 15 | unsafe private static string GetNameInternal(int sceneHandle) 16 | { 17 | return Instance_Class.GetMethod(nameof(GetNameInternal)).Invoke(new IntPtr[] { new IntPtr(&sceneHandle) })?.GetValue().ToString(); 18 | } 19 | 20 | unsafe private static bool GetIsLoadedInternal(int sceneHandle) 21 | { 22 | return Instance_Class.GetMethod(nameof(GetIsLoadedInternal)).Invoke(new IntPtr[] { new IntPtr(&sceneHandle) }).GetValue(); 23 | } 24 | 25 | unsafe private static int GetBuildIndexInternal(int sceneHandle) 26 | { 27 | return Instance_Class.GetMethod(nameof(GetBuildIndexInternal)).Invoke(new IntPtr[] { new IntPtr(&sceneHandle) }).GetValue(); 28 | } 29 | 30 | unsafe private static int GetRootCountInternal(int sceneHandle) 31 | { 32 | return Instance_Class.GetMethod(nameof(GetRootCountInternal)).Invoke(new IntPtr[] { new IntPtr(&sceneHandle) }).GetValue(); 33 | } 34 | 35 | public int handle 36 | { 37 | get => m_Handle; 38 | } 39 | 40 | public bool IsValid() 41 | { 42 | return IsValidInternal(handle); 43 | } 44 | 45 | public string name 46 | { 47 | get => GetNameInternal(handle); 48 | } 49 | 50 | public bool isLoaded 51 | { 52 | get => GetIsLoadedInternal(handle); 53 | } 54 | 55 | public int buildIndex 56 | { 57 | get => GetBuildIndexInternal(handle); 58 | } 59 | 60 | public int rootCount 61 | { 62 | get => GetRootCountInternal(handle); 63 | } 64 | 65 | unsafe public GameObject[] GetRootGameObjects() 66 | { 67 | Scene _this = this; 68 | 69 | IL2Object result = Instance_Class.GetMethod(nameof(GetRootGameObjects)).Invoke(new IntPtr(&_this)); 70 | if (result == null) 71 | return null; 72 | 73 | return new IL2Array(result.Pointer).ToArray(); 74 | } 75 | 76 | public static bool operator ==(Scene lhs, Scene rhs) 77 | { 78 | return lhs.handle == rhs.handle; 79 | } 80 | 81 | public static bool operator !=(Scene lhs, Scene rhs) 82 | { 83 | return lhs.handle != rhs.handle; 84 | } 85 | 86 | public override int GetHashCode() 87 | { 88 | return m_Handle; 89 | } 90 | 91 | public override bool Equals(object other) 92 | { 93 | bool result; 94 | if (!(other is Scene)) 95 | { 96 | result = false; 97 | } 98 | else 99 | { 100 | Scene scene = (Scene)other; 101 | result = (handle == scene.handle); 102 | } 103 | return result; 104 | } 105 | 106 | // [SerializeField] 107 | private int m_Handle; 108 | 109 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("Scene", "UnityEngine.SceneManagement"); 110 | } 111 | } -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/SceneManagement/SceneManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine.SceneManagement 5 | { 6 | public class SceneManager : IL2Object 7 | { 8 | public SceneManager(IntPtr ptr) : base(ptr) { } 9 | 10 | public static int sceneCount 11 | { 12 | get => Instance_Class.GetProperty(nameof(sceneCount)).GetGetMethod().Invoke().GetValue(); 13 | } 14 | 15 | public static int sceneCountInBuildSettings 16 | { 17 | get => Instance_Class.GetProperty(nameof(sceneCountInBuildSettings)).GetGetMethod().Invoke().GetValue(); 18 | } 19 | 20 | public static Scene GetActiveScene() 21 | { 22 | return Instance_Class.GetMethod(nameof(GetActiveScene)).Invoke().GetValue(); 23 | } 24 | 25 | unsafe public static bool SetActiveScene(Scene scene) 26 | { 27 | return Instance_Class.GetMethod(nameof(SetActiveScene)).Invoke(new IntPtr[] { new IntPtr(&scene) }).GetValue(); 28 | } 29 | 30 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("SceneManager", "UnityEngine.SceneManagement"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/SceneManagement/SceneManagerAPIInternal.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine.SceneManagement 5 | { 6 | public static class SceneManagerAPIInternal 7 | { 8 | unsafe public static string GetScenePathByBuildIndex(int buildIndex) 9 | { 10 | return Instance_Class.GetMethod(nameof(GetScenePathByBuildIndex)).Invoke(new IntPtr[] { new IntPtr(&buildIndex) })?.GetValue().ToString(); 11 | } 12 | 13 | unsafe public static AsyncOperation LoadSceneAsyncNameIndexInternal(string sceneName, int sceneBuildIndex, LoadSceneParameters parameters, bool mustCompleteNextFrame) 14 | { 15 | return Instance_Class.GetMethod(nameof(LoadSceneAsyncNameIndexInternal)).Invoke(new IntPtr[] { sceneName == null ? IntPtr.Zero : new IL2String_utf16(sceneName).Pointer, new IntPtr(&sceneBuildIndex), new IntPtr(¶meters), new IntPtr(&mustCompleteNextFrame) })?.GetValue(); 16 | } 17 | 18 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("SceneManagerAPIInternal", "UnityEngine.SceneManagement"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/SceneManagement/SceneUtility.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine.SceneManagement 5 | { 6 | public static class SceneUtility 7 | { 8 | unsafe public static string GetScenePathByBuildIndex(int buildIndex) 9 | { 10 | return Instance_Class.GetMethod(nameof(GetScenePathByBuildIndex)).Invoke(new IntPtr[] { new IntPtr(&buildIndex) })?.GetValue().ToString(); 11 | } 12 | 13 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("SceneUtility", "UnityEngine.SceneManagement"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/SceneManagement/UnloadSceneOptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnityEngine.SceneManagement 4 | { 5 | [Flags] 6 | public enum UnloadSceneOptions 7 | { 8 | None = 0, 9 | UnloadAllEmbeddedSceneObjects = 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/Screen.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine 5 | { 6 | public sealed class Screen 7 | { 8 | public static int width 9 | { 10 | get => Instance_Class.GetProperty(nameof(width)).GetGetMethod().Invoke().GetValue(); 11 | } 12 | 13 | public static int height 14 | { 15 | get => Instance_Class.GetProperty(nameof(height)).GetGetMethod().Invoke().GetValue(); 16 | } 17 | 18 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("Screen", "UnityEngine"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/ScriptableObject.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine 5 | { 6 | public class ScriptableObject : Object 7 | { 8 | public ScriptableObject(IntPtr ptr) : base(ptr) { } 9 | 10 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("ScriptableObject", "UnityEngine"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/SendMessageOptions.cs: -------------------------------------------------------------------------------- 1 | namespace UnityEngine 2 | { 3 | public enum SendMessageOptions 4 | { 5 | RequireReceiver, 6 | DontRequireReceiver 7 | } 8 | } -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/Shader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine 5 | { 6 | public class Shader : Object 7 | { 8 | public Shader(IntPtr ptr) : base(ptr) { } 9 | 10 | public static Shader Find(string name) 11 | { 12 | return Instance_Class.GetMethod(nameof(Find)).Invoke(new IntPtr[] { new IL2String_utf16(name).Pointer })?.GetValue(); 13 | } 14 | 15 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("Shader", "UnityEngine"); 16 | } 17 | } -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/Sprite.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine 5 | { 6 | public sealed class Sprite : Object 7 | { 8 | public Sprite(IntPtr ptr) : base(ptr) { } 9 | 10 | public Texture2D texture 11 | { 12 | get => Instance_Class.GetProperty(nameof(texture)).GetGetMethod().Invoke(this)?.GetValue(); 13 | } 14 | 15 | public static Sprite Create(Texture2D texture, Rect rect, Vector2 pivot, float pixelsPerUnit = 100, uint extrude = 0, SpriteMeshType meshType = SpriteMeshType.Tight, bool generateFallbackPhysicsShape = false) 16 | { 17 | Vector4 border = Vector4.zero; 18 | return Create2(texture, rect, pivot, pixelsPerUnit, extrude, meshType, border, generateFallbackPhysicsShape); 19 | } 20 | public Rect rect 21 | { 22 | get => Instance_Class.GetProperty(nameof(rect)).GetGetMethod().Invoke(this).GetValue(); 23 | } 24 | public Vector2 pivot 25 | { 26 | get => Instance_Class.GetProperty(nameof(pivot)).GetGetMethod().Invoke(this).GetValue(); 27 | } 28 | 29 | public float pixelsPerUnit 30 | { 31 | get => Instance_Class.GetProperty(nameof(pixelsPerUnit)).GetGetMethod().Invoke(this).GetValue(); 32 | } 33 | 34 | unsafe private static Sprite Create2(Texture2D texture, Rect rect, Vector2 pivot, float pixelsPerUnit, uint extrude, SpriteMeshType meshType, Vector4 border, bool generateFallbackPhysicsShape) 35 | { 36 | IntPtr ptrRect = new IntPtr(&rect); 37 | IntPtr ptrPivot = new IntPtr(&pivot); 38 | IntPtr ptrBorder = new IntPtr(&border); 39 | 40 | return CreateSprite(texture == null ? IntPtr.Zero : texture.Pointer, ref ptrRect, ref ptrPivot, pixelsPerUnit, extrude, meshType, ref ptrBorder, generateFallbackPhysicsShape); 41 | } 42 | 43 | private delegate IntPtr _delegateCreateSprite(IntPtr texture, IntPtr rect, IntPtr pivot, float pixelsPerUnit, uint extrude, SpriteMeshType meshType, IntPtr border, bool generateFallbackPhysicsShape); 44 | private static _delegateCreateSprite _CreateSprite = null; 45 | private static Sprite CreateSprite(IntPtr texture, ref IntPtr rect, ref IntPtr pivot, float pixelsPerUnit, uint extrude, SpriteMeshType meshType, ref IntPtr border, bool generateFallbackPhysicsShape) 46 | { 47 | if (_CreateSprite == null) 48 | { 49 | _CreateSprite = IL2CPP.ResolveICall<_delegateCreateSprite>("UnityEngine.Sprite::CreateSprite_Injected"); 50 | if (_CreateSprite == null) 51 | return null; 52 | } 53 | 54 | IntPtr result = _CreateSprite(texture, rect, pivot, pixelsPerUnit, extrude, meshType, border, generateFallbackPhysicsShape); 55 | if (result == IntPtr.Zero) 56 | return null; 57 | 58 | return new Sprite(result); 59 | } 60 | 61 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("Sprite", "UnityEngine"); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/SpriteMeshType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnityEngine 4 | { 5 | public enum SpriteMeshType 6 | { 7 | FullRect, 8 | Tight 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/SpriteRenderer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine 5 | { 6 | public sealed class SpriteRenderer : Renderer 7 | { 8 | public SpriteRenderer(IntPtr ptr) : base(ptr) { } 9 | 10 | public Sprite sprite 11 | { 12 | get => Instance_Class.GetProperty(nameof(sprite)).GetGetMethod().Invoke(this)?.GetValue(); 13 | set => Instance_Class.GetProperty(nameof(sprite)).GetSetMethod().Invoke(this, new IntPtr[] { value == null ? IntPtr.Zero : value.Pointer }); 14 | } 15 | 16 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("SpriteRenderer", "UnityEngine"); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/Texture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine 5 | { 6 | public class Texture : Object 7 | { 8 | public Texture(IntPtr ptr) : base(ptr) { } 9 | 10 | unsafe public virtual int width 11 | { 12 | get => Instance_Class.GetProperty(nameof(width)).GetGetMethod().Invoke(this).GetValue(); 13 | set => Instance_Class.GetProperty(nameof(width)).GetGetMethod().Invoke(this, new IntPtr[] { new IntPtr(&value) }); 14 | } 15 | 16 | unsafe public virtual int height 17 | { 18 | get => Instance_Class.GetProperty(nameof(height)).GetGetMethod().Invoke(this).GetValue(); 19 | set => Instance_Class.GetProperty(nameof(height)).GetGetMethod().Invoke(this, new IntPtr[] { new IntPtr(&value) }); 20 | } 21 | 22 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("Texture", "UnityEngine"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/Texture2D.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine 5 | { 6 | public sealed class Texture2D : Texture 7 | { 8 | public Texture2D(IntPtr ptr) : base(ptr) { } 9 | 10 | unsafe public Texture2D(int width, int height) : base(IntPtr.Zero) 11 | { 12 | Pointer = Import.Object.il2cpp_object_new(Instance_Class.Pointer); 13 | Instance_Class.GetMethod(".ctor", x => x.GetParameters().Length == 2).Invoke(Pointer, new IntPtr[] { new IntPtr(&width), new IntPtr(&height) }); 14 | } 15 | 16 | unsafe public Texture2D(int width, int height, TextureFormat textureFormat, bool mipChain) : base(IntPtr.Zero) 17 | { 18 | Pointer = Import.Object.il2cpp_object_new(Instance_Class.Pointer); 19 | Instance_Class.GetMethod(".ctor", x => x.GetParameters().Length == 4).Invoke(Pointer, new IntPtr[] { new IntPtr(&width), new IntPtr(&height), new IntPtr(&textureFormat), new IntPtr(&mipChain) }); 20 | } 21 | 22 | unsafe public void SetPixel(int x, int y, Color color) 23 | { 24 | Instance_Class.GetMethod(nameof(SetPixel), m => m.GetParameters().Length == 3).Invoke(this, new IntPtr[] { new IntPtr(&x), new IntPtr(&y), new IntPtr(&color) }); 25 | } 26 | 27 | unsafe public void ReadPixels(Rect source, int destX, int destY) 28 | { 29 | Instance_Class.GetMethod(nameof(ReadPixels), x => x.GetParameters().Length == 3).Invoke(this, new IntPtr[] { new IntPtr(&source), new IntPtr(&destX), new IntPtr(&destY) }); 30 | } 31 | unsafe public void SetPixels(Rect source, int destX, int destY) 32 | { 33 | Instance_Class.GetMethod(nameof(SetPixels), x => x.GetParameters().Length == 3).Invoke(this, new IntPtr[] { new IntPtr(&source), new IntPtr(&destX), new IntPtr(&destY) }); 34 | } 35 | 36 | unsafe public void SetPixels(Color[] colors) 37 | { 38 | IL2Array array = null; 39 | if (colors != null) 40 | { 41 | int len = colors.Length; 42 | array = new IL2Array(len, Color.Instance_Class); 43 | for (int i = 0; i < len; i++) 44 | { 45 | array[i] = colors[i]; 46 | } 47 | } 48 | Instance_Class.GetMethod(nameof(SetPixels), x => x.GetParameters().Length == 1 && x.GetParameters()[0].Name == "colors").Invoke(this, new IntPtr[] { array == null ? IntPtr.Zero : array.Pointer }); 49 | } 50 | public void Apply() 51 | { 52 | Instance_Class.GetMethod(nameof(Apply), x => x.GetParameters().Length == 0).Invoke(this); 53 | } 54 | 55 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("Texture2D", "UnityEngine"); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/TextureFormat.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnityEngine 4 | { 5 | public enum TextureFormat 6 | { 7 | Alpha8 = 1, 8 | ARGB4444, 9 | RGB24, 10 | RGBA32, 11 | ARGB32, 12 | RGB565 = 7, 13 | R16 = 9, 14 | DXT1, 15 | DXT5 = 12, 16 | RGBA4444, 17 | BGRA32, 18 | RHalf, 19 | RGHalf, 20 | RGBAHalf, 21 | RFloat, 22 | RGFloat, 23 | RGBAFloat, 24 | YUY2, 25 | RGB9e5Float, 26 | BC4 = 26, 27 | BC5, 28 | BC6H = 24, 29 | BC7, 30 | DXT1Crunched = 28, 31 | DXT5Crunched, 32 | PVRTC_RGB2, 33 | PVRTC_RGBA2, 34 | PVRTC_RGB4, 35 | PVRTC_RGBA4, 36 | ETC_RGB4, 37 | EAC_R = 41, 38 | EAC_R_SIGNED, 39 | EAC_RG, 40 | EAC_RG_SIGNED, 41 | ETC2_RGB, 42 | ETC2_RGBA1, 43 | ETC2_RGBA8, 44 | ASTC_4x4, 45 | ASTC_5x5, 46 | ASTC_6x6, 47 | ASTC_8x8, 48 | ASTC_10x10, 49 | ASTC_12x12, 50 | [Obsolete] 51 | ETC_RGB4_3DS = 60, 52 | [Obsolete] 53 | ETC_RGBA8_3DS, 54 | RG16, 55 | R8, 56 | ETC_RGB4Crunched, 57 | ETC2_RGBA8Crunched, 58 | ASTC_HDR_4x4, 59 | ASTC_HDR_5x5, 60 | ASTC_HDR_6x6, 61 | ASTC_HDR_8x8, 62 | ASTC_HDR_10x10, 63 | ASTC_HDR_12x12, 64 | RG32, 65 | RGB48, 66 | RGBA64, 67 | ASTC_RGB_4x4 = 48, 68 | ASTC_RGB_5x5, 69 | ASTC_RGB_6x6, 70 | ASTC_RGB_8x8, 71 | ASTC_RGB_10x10, 72 | ASTC_RGB_12x12, 73 | ASTC_RGBA_4x4, 74 | ASTC_RGBA_5x5, 75 | ASTC_RGBA_6x6, 76 | ASTC_RGBA_8x8, 77 | ASTC_RGBA_10x10, 78 | ASTC_RGBA_12x12 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/Time.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine 5 | { 6 | public static class Time 7 | { 8 | public static float time 9 | { 10 | get => Instance_Class.GetProperty(nameof(time)).GetGetMethod().Invoke().GetValue(); 11 | } 12 | 13 | public static float timeSinceLevelLoad 14 | { 15 | get => Instance_Class.GetProperty(nameof(timeSinceLevelLoad)).GetGetMethod().Invoke().GetValue(); 16 | } 17 | 18 | public static float deltaTime 19 | { 20 | get => Instance_Class.GetProperty(nameof(deltaTime)).GetGetMethod().Invoke().GetValue(); 21 | } 22 | 23 | public static float fixedTime 24 | { 25 | get => Instance_Class.GetProperty(nameof(fixedTime)).GetGetMethod().Invoke().GetValue(); 26 | } 27 | 28 | public static float unscaledTime 29 | { 30 | get => Instance_Class.GetProperty(nameof(unscaledTime)).GetGetMethod().Invoke().GetValue(); 31 | } 32 | 33 | public static float fixedUnscaledTime 34 | { 35 | get => Instance_Class.GetProperty(nameof(fixedUnscaledTime)).GetGetMethod().Invoke().GetValue(); 36 | } 37 | 38 | public static float unscaledDeltaTime 39 | { 40 | get => Instance_Class.GetProperty(nameof(unscaledDeltaTime)).GetGetMethod().Invoke().GetValue(); 41 | } 42 | 43 | public static float fixedUnscaledDeltaTime 44 | { 45 | get => Instance_Class.GetProperty(nameof(fixedUnscaledDeltaTime)).GetGetMethod().Invoke().GetValue(); 46 | } 47 | 48 | unsafe public static float fixedDeltaTime 49 | { 50 | get => Instance_Class.GetProperty(nameof(fixedDeltaTime)).GetGetMethod().Invoke().GetValue(); 51 | set => Instance_Class.GetProperty(nameof(fixedDeltaTime)).GetSetMethod().Invoke(new IntPtr[] { new IntPtr(&value) }); 52 | } 53 | 54 | public static float maximumDeltaTime 55 | { 56 | get => Instance_Class.GetProperty(nameof(maximumDeltaTime)).GetGetMethod().Invoke().GetValue(); 57 | } 58 | 59 | public static float smoothDeltaTime 60 | { 61 | get => Instance_Class.GetProperty(nameof(smoothDeltaTime)).GetGetMethod().Invoke().GetValue(); 62 | } 63 | 64 | unsafe public static float timeScale 65 | { 66 | get => Instance_Class.GetProperty(nameof(timeScale)).GetGetMethod().Invoke().GetValue(); 67 | set => Instance_Class.GetProperty(nameof(timeScale)).GetSetMethod().Invoke(new IntPtr[] { new IntPtr(&value) }); 68 | } 69 | 70 | public static int frameCount 71 | { 72 | get => Instance_Class.GetProperty(nameof(frameCount)).GetGetMethod().Invoke().GetValue(); 73 | } 74 | 75 | public static int renderedFrameCount 76 | { 77 | get => Instance_Class.GetProperty(nameof(renderedFrameCount)).GetGetMethod().Invoke().GetValue(); 78 | } 79 | 80 | public static float realtimeSinceStartup 81 | { 82 | get => Instance_Class.GetProperty(nameof(realtimeSinceStartup)).GetGetMethod().Invoke().GetValue(); 83 | } 84 | 85 | public static int captureFramerate 86 | { 87 | get => Instance_Class.GetProperty(nameof(captureFramerate)).GetGetMethod().Invoke().GetValue(); 88 | } 89 | 90 | public static bool inFixedTimeStep 91 | { 92 | get => Instance_Class.GetProperty(nameof(inFixedTimeStep)).GetGetMethod().Invoke().GetValue(); 93 | } 94 | 95 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("Time", "UnityEngine"); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/UnityString.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnityEngine 4 | { 5 | internal sealed class UnityString 6 | { 7 | public static string Format(string fmt, params object[] args) 8 | { 9 | return string.Format(fmt, args); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/Vector3Ex.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace UnityEngine 5 | { 6 | [StructLayout(LayoutKind.Sequential)] 7 | public struct Vector3Ex 8 | { 9 | /// 10 | /// Creates a new vector with given x, y, z components. 11 | /// 12 | /// 13 | /// 14 | /// 15 | public Vector3Ex(IntPtr x, IntPtr y, IntPtr z) 16 | { 17 | this.x = x; 18 | this.y = y; 19 | this.z = z; 20 | } 21 | 22 | 23 | 24 | // ========================================================= 25 | // VECTOR 3 const's 26 | // ========================================================= 27 | 28 | /// 29 | /// X component of the vector. 30 | /// 31 | public IntPtr x; 32 | 33 | /// 34 | /// Y component of the vector. 35 | /// 36 | public IntPtr y; 37 | 38 | /// 39 | /// Z component of the vector. 40 | /// 41 | public IntPtr z; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/WaitForSeconds.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using IL2CPP_Core.Objects; 3 | 4 | namespace UnityEngine 5 | { 6 | public class WaitForSeconds : YieldInstruction 7 | { 8 | public WaitForSeconds(IntPtr ptr) : base(ptr) { } 9 | 10 | unsafe public WaitForSeconds(float seconds) : base(IntPtr.Zero) 11 | { 12 | Pointer = Import.Object.il2cpp_object_new(Instance_Class.Pointer); 13 | Instance_Class.GetMethod(".ctor", x => x.GetParameters().Length == 1).Invoke(Pointer, new IntPtr[] { new IntPtr(&seconds) }); 14 | } 15 | 16 | unsafe public float m_Seconds 17 | { 18 | get => Instance_Class.GetField(nameof(m_Seconds)).GetValue(this).GetValue(); 19 | set => Instance_Class.GetField(nameof(m_Seconds)).SetValue(this, new IntPtr(&value)); 20 | } 21 | 22 | public static new IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("WaitForSeconds", "UnityEngine"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/UnityEngine.CoreModule/UnityEngine/YieldInstruction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using IL2CPP_Core.Objects; 4 | 5 | namespace UnityEngine 6 | { 7 | public class YieldInstruction : IL2Object 8 | { 9 | public YieldInstruction(IntPtr ptr) : base(ptr) { } 10 | 11 | unsafe public YieldInstruction() : base(IntPtr.Zero) 12 | { 13 | Pointer = Import.Object.il2cpp_object_new(Instance_Class.Pointer); 14 | Instance_Class.GetMethod(".ctor").Invoke(Pointer); 15 | } 16 | 17 | public static IL2Class Instance_Class = IL2CPP.AssemblyList["UnityEngine.CoreModule"].GetClass("YieldInstruction", "UnityEngine"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ares_logger/main/sdk/patch.cs: -------------------------------------------------------------------------------- 1 | using ares_logger.util; 2 | using IL2CPP_Core.Objects; 3 | using System; 4 | using System.Runtime.InteropServices; 5 | 6 | namespace ares_logger.sdk 7 | { 8 | unsafe internal class patch : IL2Object 9 | { 10 | internal IL2Method target; 11 | internal IntPtr orig; 12 | 13 | internal patch(IL2Method method, Delegate new_method) : base(IntPtr.Zero) 14 | { 15 | Pointer = new_method.Method.MethodHandle.GetFunctionPointer(); 16 | target = method; 17 | hook.create_hook(*(IntPtr*)method.Pointer, Pointer, out orig); 18 | Enabled = true; 19 | } 20 | 21 | public T create_delegate() where T : Delegate 22 | { 23 | return Marshal.GetDelegateForFunctionPointer(orig, typeof(T)) as T; 24 | } 25 | 26 | public bool Enabled 27 | { 28 | get => is_enabled; 29 | set 30 | { 31 | if (is_enabled = value) 32 | hook.enable_hook(*(IntPtr*)target.Pointer); 33 | else 34 | hook.disable_hook(*(IntPtr*)target.Pointer); 35 | } 36 | } 37 | 38 | private bool is_enabled = true; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /ares_logger/main/util/avatar.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ares_logger.main.util 8 | { 9 | public class avatar 10 | { 11 | public string TimeDetected { get; set; } 12 | 13 | public string AvatarID { get; set; } 14 | 15 | public string AvatarName { get; set; } 16 | 17 | public string AvatarDescription { get; set; } 18 | 19 | public string AuthorName { get; set; } 20 | 21 | public string AuthorID { get; set; } 22 | 23 | public string PCAssetURL { get; set; } 24 | 25 | public string QUESTAssetURL { get; set; } 26 | 27 | public string ImageURL { get; set; } 28 | 29 | public string ThumbnailURL { get; set; } 30 | 31 | public string UnityVersion { get; set; } 32 | 33 | public string Releasestatus { get; set; } 34 | 35 | public string Tags { get; set; } 36 | 37 | public string Pin { get; set; } 38 | 39 | public string PinCode { get; set; } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ares_logger/main/util/clipboard.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ares_logger.main.util 9 | { 10 | // system forms clipboard never worked 11 | // ref: stackoverflow 12 | internal class clipboard 13 | { 14 | [DllImport("user32.dll")] 15 | static extern IntPtr GetClipboardData(uint uFormat); 16 | [DllImport("user32.dll")] 17 | static extern bool IsClipboardFormatAvailable(uint format); 18 | [DllImport("user32.dll", SetLastError = true)] 19 | static extern bool OpenClipboard(IntPtr hWndNewOwner); 20 | [DllImport("user32.dll", SetLastError = true)] 21 | static extern bool CloseClipboard(); 22 | [DllImport("kernel32.dll")] 23 | static extern IntPtr GlobalLock(IntPtr hMem); 24 | [DllImport("kernel32.dll")] 25 | static extern bool GlobalUnlock(IntPtr hMem); 26 | 27 | const uint CF_UNICODETEXT = 13; 28 | 29 | public static string GetText() 30 | { 31 | if (!IsClipboardFormatAvailable(CF_UNICODETEXT)) 32 | return null; 33 | if (!OpenClipboard(IntPtr.Zero)) 34 | return null; 35 | 36 | string data = null; 37 | var hGlobal = GetClipboardData(CF_UNICODETEXT); 38 | if (hGlobal != IntPtr.Zero) 39 | { 40 | var lpwcstr = GlobalLock(hGlobal); 41 | if (lpwcstr != IntPtr.Zero) 42 | { 43 | data = Marshal.PtrToStringUni(lpwcstr); 44 | GlobalUnlock(lpwcstr); 45 | } 46 | } 47 | CloseClipboard(); 48 | 49 | return data; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /ares_logger/main/util/console.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ares_logger.main.util 8 | { 9 | public static class console_util 10 | { 11 | public static IEnumerable split_cmd(string commandLine) 12 | { 13 | bool inQuotes = false; 14 | 15 | return commandLine.split(c => 16 | { 17 | if (c == '\"') 18 | inQuotes = !inQuotes; 19 | 20 | return !inQuotes && c == ' '; 21 | }) 22 | .Select(arg => arg.Trim().trim_quotes('\"')) 23 | .Where(arg => !string.IsNullOrEmpty(arg)); 24 | } 25 | 26 | public static IEnumerable split(this string str, 27 | Func controller) 28 | { 29 | int nextPiece = 0; 30 | 31 | for (int c = 0; c < str.Length; c++) 32 | { 33 | if (controller(str[c])) 34 | { 35 | yield return str.Substring(nextPiece, c - nextPiece); 36 | nextPiece = c + 1; 37 | } 38 | } 39 | 40 | yield return str.Substring(nextPiece); 41 | } 42 | 43 | public static string trim_quotes(this string input, char quote) 44 | { 45 | if ((input.Length >= 2) && 46 | (input[0] == quote) && (input[input.Length - 1] == quote)) 47 | return input.Substring(1, input.Length - 2); 48 | 49 | return input; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /ares_logger/main/util/downloader.cs: -------------------------------------------------------------------------------- 1 | using ares_logger.main.config; 2 | using Assembly_CSharp; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Net; 8 | using System.Net.Http; 9 | using System.Text; 10 | using System.Threading.Tasks; 11 | using UnityEngine; 12 | 13 | namespace ares_logger.main.util 14 | { 15 | internal class downloader 16 | { 17 | public static string gen_mac() 18 | { 19 | var random = new Random(Environment.TickCount); 20 | byte[] bytes = new byte[20]; 21 | random.NextBytes(bytes); 22 | string HWID = string.Join("", bytes.Select(it => it.ToString("x2"))); 23 | return HWID; 24 | } 25 | 26 | public static void download(string url) 27 | { 28 | if (conf.handler.Config.enable_unsafe_features == false) return; 29 | 30 | // as close as to 1:1 i can get, this should be 100% safe but i'm still going to put this behind unsafe. 31 | ServicePointManager.Expect100Continue = true; 32 | ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; 33 | var handler = new HttpClientHandler 34 | { 35 | UseCookies = false 36 | }; 37 | HttpClient client = new HttpClient(handler); 38 | client.DefaultRequestHeaders.Clear(); 39 | client.DefaultRequestHeaders.Host = "api.vrchat.cloud"; 40 | client.DefaultRequestHeaders.Add("Accept", "*/*"); 41 | client.DefaultRequestHeaders.Add("Accept-Encoding", "deflate, gzip"); 42 | client.DefaultRequestHeaders.Add("User-Agent", "VRC.Core.BestHTTP"); 43 | client.DefaultRequestHeaders.Add("X-Client-Version", Application.version); 44 | client.DefaultRequestHeaders.Add("X-MacAddress", gen_mac()); 45 | client.DefaultRequestHeaders.Add("X-Platform", "standalonewindows"); 46 | client.DefaultRequestHeaders.Add("X-UnityVersion", Application.unityVersion); 47 | client.DefaultRequestHeaders.Add("Cookie", $"auth={VRCPlayer.Instance.player.api_user.authToken}; twoFactorAuth="); 48 | 49 | 50 | try 51 | { 52 | string downloadPath = $"{core.ares_dir}\\downloads"; 53 | if (!Directory.Exists(downloadPath)) 54 | { 55 | Directory.CreateDirectory(downloadPath); 56 | } 57 | HttpResponseMessage response = client.GetAsync(url).GetAwaiter().GetResult(); 58 | string path = downloadPath + "\\" + Guid.NewGuid().ToString() + ".vrca"; 59 | using FileStream fileStream = new FileStream(path, FileMode.CreateNew); 60 | response.Content.CopyToAsync(fileStream).GetAwaiter().GetResult(); 61 | log_sys.log("[download]: successfully downloaded avatar, saved to downloads folder at " + path, ConsoleColor.Green); 62 | } 63 | catch (HttpRequestException ex) 64 | { 65 | log_sys.log($"[download failure]: unable to download, e: {ex.Message} | in: {ex.InnerException.Message}", ConsoleColor.Red); 66 | } 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /ares_logger/main/util/hook.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ares_logger.util 9 | { 10 | internal class hook 11 | { 12 | public delegate void _create_hook(IntPtr pTarget, IntPtr pDetour, out IntPtr ppOrig); 13 | public delegate void _remove_hook(IntPtr pTarget); 14 | public delegate void _enable_hook(IntPtr pTarget); 15 | public delegate void _disable_hook(IntPtr pTarget); 16 | 17 | public static _create_hook create_hook { get; private set; } 18 | public static _remove_hook remove_hook { get; private set; } 19 | public static _enable_hook enable_hook { get; private set; } 20 | public static _disable_hook disable_hook { get; private set; } 21 | 22 | private static T create_delegate(IntPtr method) where T : Delegate 23 | { 24 | return Marshal.GetDelegateForFunctionPointer(method, typeof(T)) as T; 25 | } 26 | 27 | public static void setup_hook(IntPtr pcreate_hook, IntPtr premove_hook, IntPtr penable_hook, IntPtr pdisable_hook) 28 | { 29 | create_hook = create_delegate<_create_hook>(pcreate_hook); 30 | remove_hook = create_delegate<_remove_hook>(premove_hook); 31 | enable_hook = create_delegate<_enable_hook>(penable_hook); 32 | disable_hook = create_delegate<_disable_hook>(pdisable_hook); 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /ares_logger/main/util/json.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.Serialization.Json; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace ares_logger.util 10 | { 11 | public static class json where TType : class 12 | { 13 | /// 14 | /// Serializes an object to JSON 15 | /// 16 | public static string serialize(TType instance) 17 | { 18 | var serializer = new DataContractJsonSerializer(typeof(TType)); 19 | using (var stream = new MemoryStream()) 20 | { 21 | serializer.WriteObject(stream, instance); 22 | return Encoding.Default.GetString(stream.ToArray()); 23 | } 24 | } 25 | 26 | /// 27 | /// DeSerializes an object from JSON 28 | /// 29 | public static TType deserialize(string json) 30 | { 31 | using (var stream = new MemoryStream(Encoding.Default.GetBytes(json))) 32 | { 33 | var serializer = new DataContractJsonSerializer(typeof(TType)); 34 | return serializer.ReadObject(stream) as TType; 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /ares_logger/main/util/log_sys.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Text.RegularExpressions; 6 | using System.Threading.Tasks; 7 | 8 | namespace ares_logger.main.util 9 | { 10 | internal class log_sys 11 | { 12 | // credits: stackoverflow 13 | public static void log(string message, ConsoleColor color) 14 | { 15 | var pieces = Regex.Split(message, @"(\[[^\]]*\])"); 16 | Console.Write($"[{DateTime.Now.ToString("hh:mm:ss")}] "); 17 | 18 | for (int i = 0; i < pieces.Length; i++) 19 | { 20 | string piece = pieces[i]; 21 | 22 | if (piece.StartsWith("[") && piece.EndsWith("]")) 23 | { 24 | Console.ForegroundColor = color; 25 | piece = piece.Substring(1, piece.Length - 2); 26 | } 27 | 28 | Console.Write(piece); 29 | Console.ResetColor(); 30 | } 31 | 32 | Console.WriteLine(); 33 | } 34 | 35 | public static void log(string message) 36 | { 37 | Console.WriteLine($"[{DateTime.Now.ToString("hh:mm:ss")}] {message}"); 38 | } 39 | 40 | public static void debug_log(string message) 41 | { 42 | if (!core.ares_debug) return; 43 | 44 | if (core.ares_debug) 45 | { 46 | log($"[debug log]: {message}", ConsoleColor.Cyan); 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /ares_logger/main/util/world.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.Serialization; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ares_logger.main.util 9 | { 10 | [DataContract] 11 | public class world 12 | { 13 | [DataMember] 14 | public string TimeDetected { get; set; } 15 | 16 | [DataMember] 17 | public string WorldID { get; set; } 18 | 19 | [DataMember] 20 | public string WorldName { get; set; } 21 | 22 | [DataMember] 23 | public string WorldDescription { get; set; } 24 | 25 | [DataMember] 26 | public string AuthorName { get; set; } 27 | 28 | [DataMember] 29 | public string AuthorID { get; set; } 30 | 31 | [DataMember] 32 | public string PCAssetURL { get; set; } 33 | 34 | [DataMember] 35 | public string ImageURL { get; set; } 36 | 37 | [DataMember] 38 | public string ThumbnailURL { get; set; } 39 | 40 | [DataMember] 41 | public string UnityVersion { get; set; } 42 | 43 | [DataMember] 44 | public string Releasestatus { get; set; } 45 | 46 | [DataMember] 47 | public string Tags { get; set; } 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /ares_logger/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /clr_loader/clr_loader.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.2.32630.192 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clr_loader", "clr_loader.vcxproj", "{CC14121F-F8CD-4D34-8DF7-1A46B72FC840}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {CC14121F-F8CD-4D34-8DF7-1A46B72FC840}.Debug|x64.ActiveCfg = Debug|x64 17 | {CC14121F-F8CD-4D34-8DF7-1A46B72FC840}.Debug|x64.Build.0 = Debug|x64 18 | {CC14121F-F8CD-4D34-8DF7-1A46B72FC840}.Debug|x86.ActiveCfg = Debug|Win32 19 | {CC14121F-F8CD-4D34-8DF7-1A46B72FC840}.Debug|x86.Build.0 = Debug|Win32 20 | {CC14121F-F8CD-4D34-8DF7-1A46B72FC840}.Release|x64.ActiveCfg = Release|x64 21 | {CC14121F-F8CD-4D34-8DF7-1A46B72FC840}.Release|x64.Build.0 = Release|x64 22 | {CC14121F-F8CD-4D34-8DF7-1A46B72FC840}.Release|x86.ActiveCfg = Release|Win32 23 | {CC14121F-F8CD-4D34-8DF7-1A46B72FC840}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {5B48BFE1-5D48-4C1B-A714-B6922B9E1E13} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /clr_loader/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "pch.h" 3 | #include 4 | #include 5 | #include 6 | #pragma comment(lib, "mscoree.lib") 7 | #include 8 | 9 | #include "host.h" 10 | #include "include/MinHook.h" 11 | 12 | void create_hook(LPVOID pTarget, LPVOID pDetour, LPVOID *ppOriginal) 13 | { 14 | LPVOID orig; 15 | auto result = MH_CreateHook(pTarget, pDetour, &orig); 16 | if (result != MH_OK) 17 | { 18 | std::cout << "[clr loader] create hook failed, status: " << MH_StatusToString(result) << std::endl; 19 | return; 20 | } 21 | *ppOriginal = orig; 22 | } 23 | 24 | void remove_hook(LPVOID pTarget) 25 | { 26 | auto result = MH_RemoveHook(pTarget); 27 | if (result != MH_OK) 28 | { 29 | std::cout << "[clr loader] remove hook failed, status: " << MH_StatusToString(result) << std::endl; 30 | return; 31 | } 32 | } 33 | 34 | void enable_hook(LPVOID pTarget) 35 | { 36 | auto result = MH_EnableHook(pTarget); 37 | if (result != MH_OK) 38 | { 39 | std::cout << "[clr loader] enable hook failed, status: " << MH_StatusToString(result) << std::endl; 40 | return; 41 | } 42 | } 43 | 44 | void disable_hook(LPVOID pTarget) 45 | { 46 | auto result = MH_DisableHook(pTarget); 47 | if (result != MH_OK) 48 | { 49 | std::cout << "[clr loader] disable hook failed, status: " << MH_StatusToString(result) << std::endl; 50 | return; 51 | } 52 | } 53 | 54 | 55 | int main() 56 | { 57 | ICLRMetaHost* meta_host = NULL; 58 | ICLRRuntimeInfo* runtime_info = NULL; 59 | ICLRRuntimeHost* runtime_host = NULL; 60 | 61 | // alloc console if it does not already exist, if so then attach to console. 62 | if (!GetConsoleWindow()) 63 | if (!AllocConsole()) 64 | MessageBoxA(NULL, "failed to init console", "failure", MB_OK); 65 | 66 | AttachConsole(ATTACH_PARENT_PROCESS); 67 | 68 | FILE* fDummy; 69 | freopen_s(&fDummy, "CONIN$", "r", stdin); 70 | freopen_s(&fDummy, "CONOUT$", "w", stderr); 71 | freopen_s(&fDummy, "CONOUT$", "w", stdout); 72 | 73 | CLRCreateInstance(CLSID_CLRMetaHost, IID_ICLRMetaHost, ((LPVOID*)&meta_host)); 74 | meta_host->GetRuntime(L"v4.0.30319", IID_ICLRRuntimeInfo, (LPVOID*)&runtime_info); 75 | runtime_info->GetInterface(CLSID_CLRRuntimeHost, IID_ICLRRuntimeHost, (LPVOID*)&runtime_host); 76 | ICLRControl* clr_control = nullptr; 77 | runtime_host->GetCLRControl(&clr_control); 78 | 79 | host_ctrl* host_control = host_control = new host_ctrl(); 80 | runtime_host->SetHostControl(host_control); 81 | clr_control->SetAppDomainManagerType(L"ares_logger", L"ares_logger.handler.domain_handler"); 82 | 83 | runtime_host->Start(); 84 | 85 | INetDomain* net_domain = host_control->get_domainmanager(); 86 | net_domain->setup_hook( 87 | create_hook, 88 | remove_hook, 89 | enable_hook, 90 | disable_hook); 91 | net_domain->init(); 92 | 93 | 94 | runtime_info->Release(); 95 | meta_host->Release(); 96 | runtime_host->Release(); 97 | net_domain->Release(); 98 | 99 | return 0; 100 | } 101 | 102 | 103 | BOOL APIENTRY DllMain( HMODULE hModule, 104 | DWORD ul_reason_for_call, 105 | LPVOID lpReserved 106 | ) 107 | { 108 | switch (ul_reason_for_call) 109 | { 110 | case DLL_PROCESS_ATTACH: 111 | MH_Initialize(); 112 | main(); 113 | case DLL_THREAD_ATTACH: 114 | case DLL_THREAD_DETACH: 115 | case DLL_PROCESS_DETACH: 116 | break; 117 | } 118 | return TRUE; 119 | } 120 | 121 | -------------------------------------------------------------------------------- /clr_loader/framework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 4 | // Windows Header Files 5 | #include 6 | -------------------------------------------------------------------------------- /clr_loader/host.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | // this is per application, you will have to specify the guid that belongs to the appdomain that is open to COM. 5 | // this is filled out to work with my ares-logger project, if you have a different application you will need to change it accordingly. 6 | struct __declspec(uuid("A3FA5B56-22BA-4550-8016-915BF8A395A6")) INetDomain : IUnknown 7 | { 8 | virtual void init(); 9 | virtual void setup_hook(LPVOID create_hook, LPVOID remove_hook, LPVOID enable_hook, LPVOID disable_hook); 10 | }; 11 | 12 | 13 | class host_ctrl : public IHostControl 14 | { 15 | public: 16 | host_ctrl() 17 | { 18 | ref_count = 0; 19 | domain_manager = NULL; 20 | } 21 | virtual ~host_ctrl() 22 | { 23 | if (domain_manager != nullptr) 24 | { 25 | domain_manager->Release(); 26 | } 27 | } 28 | INetDomain* get_domainmanager() 29 | { 30 | if (domain_manager) 31 | { 32 | domain_manager->AddRef(); 33 | } 34 | return domain_manager; 35 | } 36 | HRESULT __stdcall GetHostManager(REFIID riid, void** ppv) 37 | { 38 | *ppv = NULL; 39 | return E_NOINTERFACE; 40 | } 41 | 42 | HRESULT __stdcall SetAppDomainManager(DWORD dwAppDomainID, IUnknown* pUnkAppDomainManager) 43 | { 44 | HRESULT hr = S_OK; 45 | hr = pUnkAppDomainManager->QueryInterface(__uuidof(INetDomain), (PVOID*)&domain_manager); 46 | return hr; 47 | } 48 | 49 | 50 | // required overrides by IUnknown 51 | HRESULT __stdcall QueryInterface(const IID& iid, void** ppv) 52 | { 53 | if (!ppv) return E_POINTER; 54 | *ppv = this; 55 | AddRef(); 56 | return S_OK; 57 | } 58 | ULONG __stdcall AddRef() 59 | { 60 | return InterlockedIncrement(&ref_count); 61 | } 62 | ULONG __stdcall Release() 63 | { 64 | if (InterlockedDecrement(&ref_count) == 0) 65 | { 66 | delete this; 67 | return 0; 68 | } 69 | return ref_count; 70 | } 71 | private: 72 | long ref_count; 73 | INetDomain* domain_manager; 74 | }; 75 | -------------------------------------------------------------------------------- /clr_loader/minhook/buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MinHook - The Minimalistic API Hooking Library for x64/x86 3 | * Copyright (C) 2009-2017 Tsuda Kageyu. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 20 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #pragma once 30 | 31 | // Size of each memory slot. 32 | #if defined(_M_X64) || defined(__x86_64__) 33 | #define MEMORY_SLOT_SIZE 64 34 | #else 35 | #define MEMORY_SLOT_SIZE 32 36 | #endif 37 | 38 | VOID InitializeBuffer(VOID); 39 | VOID UninitializeBuffer(VOID); 40 | LPVOID AllocateBuffer(LPVOID pOrigin); 41 | VOID FreeBuffer(LPVOID pBuffer); 42 | BOOL IsExecutableAddress(LPVOID pAddress); 43 | -------------------------------------------------------------------------------- /clr_loader/minhook/hde/hde32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Hacker Disassembler Engine 32 3 | * Copyright (c) 2006-2009, Vyacheslav Patkov. 4 | * All rights reserved. 5 | * 6 | * hde32.h: C/C++ header file 7 | * 8 | */ 9 | 10 | #ifndef _HDE32_H_ 11 | #define _HDE32_H_ 12 | 13 | /* stdint.h - C99 standard header 14 | * http://en.wikipedia.org/wiki/stdint.h 15 | * 16 | * if your compiler doesn't contain "stdint.h" header (for 17 | * example, Microsoft Visual C++), you can download file: 18 | * http://www.azillionmonkeys.com/qed/pstdint.h 19 | * and change next line to: 20 | * #include "pstdint.h" 21 | */ 22 | #include "pstdint.h" 23 | 24 | #define F_MODRM 0x00000001 25 | #define F_SIB 0x00000002 26 | #define F_IMM8 0x00000004 27 | #define F_IMM16 0x00000008 28 | #define F_IMM32 0x00000010 29 | #define F_DISP8 0x00000020 30 | #define F_DISP16 0x00000040 31 | #define F_DISP32 0x00000080 32 | #define F_RELATIVE 0x00000100 33 | #define F_2IMM16 0x00000800 34 | #define F_ERROR 0x00001000 35 | #define F_ERROR_OPCODE 0x00002000 36 | #define F_ERROR_LENGTH 0x00004000 37 | #define F_ERROR_LOCK 0x00008000 38 | #define F_ERROR_OPERAND 0x00010000 39 | #define F_PREFIX_REPNZ 0x01000000 40 | #define F_PREFIX_REPX 0x02000000 41 | #define F_PREFIX_REP 0x03000000 42 | #define F_PREFIX_66 0x04000000 43 | #define F_PREFIX_67 0x08000000 44 | #define F_PREFIX_LOCK 0x10000000 45 | #define F_PREFIX_SEG 0x20000000 46 | #define F_PREFIX_ANY 0x3f000000 47 | 48 | #define PREFIX_SEGMENT_CS 0x2e 49 | #define PREFIX_SEGMENT_SS 0x36 50 | #define PREFIX_SEGMENT_DS 0x3e 51 | #define PREFIX_SEGMENT_ES 0x26 52 | #define PREFIX_SEGMENT_FS 0x64 53 | #define PREFIX_SEGMENT_GS 0x65 54 | #define PREFIX_LOCK 0xf0 55 | #define PREFIX_REPNZ 0xf2 56 | #define PREFIX_REPX 0xf3 57 | #define PREFIX_OPERAND_SIZE 0x66 58 | #define PREFIX_ADDRESS_SIZE 0x67 59 | 60 | #pragma pack(push,1) 61 | 62 | typedef struct { 63 | uint8_t len; 64 | uint8_t p_rep; 65 | uint8_t p_lock; 66 | uint8_t p_seg; 67 | uint8_t p_66; 68 | uint8_t p_67; 69 | uint8_t opcode; 70 | uint8_t opcode2; 71 | uint8_t modrm; 72 | uint8_t modrm_mod; 73 | uint8_t modrm_reg; 74 | uint8_t modrm_rm; 75 | uint8_t sib; 76 | uint8_t sib_scale; 77 | uint8_t sib_index; 78 | uint8_t sib_base; 79 | union { 80 | uint8_t imm8; 81 | uint16_t imm16; 82 | uint32_t imm32; 83 | } imm; 84 | union { 85 | uint8_t disp8; 86 | uint16_t disp16; 87 | uint32_t disp32; 88 | } disp; 89 | uint32_t flags; 90 | } hde32s; 91 | 92 | #pragma pack(pop) 93 | 94 | #ifdef __cplusplus 95 | extern "C" { 96 | #endif 97 | 98 | /* __cdecl */ 99 | unsigned int hde32_disasm(const void *code, hde32s *hs); 100 | 101 | #ifdef __cplusplus 102 | } 103 | #endif 104 | 105 | #endif /* _HDE32_H_ */ 106 | -------------------------------------------------------------------------------- /clr_loader/minhook/hde/hde64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Hacker Disassembler Engine 64 3 | * Copyright (c) 2008-2009, Vyacheslav Patkov. 4 | * All rights reserved. 5 | * 6 | * hde64.h: C/C++ header file 7 | * 8 | */ 9 | 10 | #ifndef _HDE64_H_ 11 | #define _HDE64_H_ 12 | 13 | /* stdint.h - C99 standard header 14 | * http://en.wikipedia.org/wiki/stdint.h 15 | * 16 | * if your compiler doesn't contain "stdint.h" header (for 17 | * example, Microsoft Visual C++), you can download file: 18 | * http://www.azillionmonkeys.com/qed/pstdint.h 19 | * and change next line to: 20 | * #include "pstdint.h" 21 | */ 22 | #include "pstdint.h" 23 | 24 | #define F_MODRM 0x00000001 25 | #define F_SIB 0x00000002 26 | #define F_IMM8 0x00000004 27 | #define F_IMM16 0x00000008 28 | #define F_IMM32 0x00000010 29 | #define F_IMM64 0x00000020 30 | #define F_DISP8 0x00000040 31 | #define F_DISP16 0x00000080 32 | #define F_DISP32 0x00000100 33 | #define F_RELATIVE 0x00000200 34 | #define F_ERROR 0x00001000 35 | #define F_ERROR_OPCODE 0x00002000 36 | #define F_ERROR_LENGTH 0x00004000 37 | #define F_ERROR_LOCK 0x00008000 38 | #define F_ERROR_OPERAND 0x00010000 39 | #define F_PREFIX_REPNZ 0x01000000 40 | #define F_PREFIX_REPX 0x02000000 41 | #define F_PREFIX_REP 0x03000000 42 | #define F_PREFIX_66 0x04000000 43 | #define F_PREFIX_67 0x08000000 44 | #define F_PREFIX_LOCK 0x10000000 45 | #define F_PREFIX_SEG 0x20000000 46 | #define F_PREFIX_REX 0x40000000 47 | #define F_PREFIX_ANY 0x7f000000 48 | 49 | #define PREFIX_SEGMENT_CS 0x2e 50 | #define PREFIX_SEGMENT_SS 0x36 51 | #define PREFIX_SEGMENT_DS 0x3e 52 | #define PREFIX_SEGMENT_ES 0x26 53 | #define PREFIX_SEGMENT_FS 0x64 54 | #define PREFIX_SEGMENT_GS 0x65 55 | #define PREFIX_LOCK 0xf0 56 | #define PREFIX_REPNZ 0xf2 57 | #define PREFIX_REPX 0xf3 58 | #define PREFIX_OPERAND_SIZE 0x66 59 | #define PREFIX_ADDRESS_SIZE 0x67 60 | 61 | #pragma pack(push,1) 62 | 63 | typedef struct { 64 | uint8_t len; 65 | uint8_t p_rep; 66 | uint8_t p_lock; 67 | uint8_t p_seg; 68 | uint8_t p_66; 69 | uint8_t p_67; 70 | uint8_t rex; 71 | uint8_t rex_w; 72 | uint8_t rex_r; 73 | uint8_t rex_x; 74 | uint8_t rex_b; 75 | uint8_t opcode; 76 | uint8_t opcode2; 77 | uint8_t modrm; 78 | uint8_t modrm_mod; 79 | uint8_t modrm_reg; 80 | uint8_t modrm_rm; 81 | uint8_t sib; 82 | uint8_t sib_scale; 83 | uint8_t sib_index; 84 | uint8_t sib_base; 85 | union { 86 | uint8_t imm8; 87 | uint16_t imm16; 88 | uint32_t imm32; 89 | uint64_t imm64; 90 | } imm; 91 | union { 92 | uint8_t disp8; 93 | uint16_t disp16; 94 | uint32_t disp32; 95 | } disp; 96 | uint32_t flags; 97 | } hde64s; 98 | 99 | #pragma pack(pop) 100 | 101 | #ifdef __cplusplus 102 | extern "C" { 103 | #endif 104 | 105 | /* __cdecl */ 106 | unsigned int hde64_disasm(const void *code, hde64s *hs); 107 | 108 | #ifdef __cplusplus 109 | } 110 | #endif 111 | 112 | #endif /* _HDE64_H_ */ 113 | -------------------------------------------------------------------------------- /clr_loader/minhook/hde/pstdint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MinHook - The Minimalistic API Hooking Library for x64/x86 3 | * Copyright (C) 2009-2017 Tsuda Kageyu. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #pragma once 28 | 29 | #include 30 | 31 | // Integer types for HDE. 32 | typedef INT8 int8_t; 33 | typedef INT16 int16_t; 34 | typedef INT32 int32_t; 35 | typedef INT64 int64_t; 36 | typedef UINT8 uint8_t; 37 | typedef UINT16 uint16_t; 38 | typedef UINT32 uint32_t; 39 | typedef UINT64 uint64_t; 40 | -------------------------------------------------------------------------------- /clr_loader/minhook/hde/table32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Hacker Disassembler Engine 32 C 3 | * Copyright (c) 2008-2009, Vyacheslav Patkov. 4 | * All rights reserved. 5 | * 6 | */ 7 | 8 | #define C_NONE 0x00 9 | #define C_MODRM 0x01 10 | #define C_IMM8 0x02 11 | #define C_IMM16 0x04 12 | #define C_IMM_P66 0x10 13 | #define C_REL8 0x20 14 | #define C_REL32 0x40 15 | #define C_GROUP 0x80 16 | #define C_ERROR 0xff 17 | 18 | #define PRE_ANY 0x00 19 | #define PRE_NONE 0x01 20 | #define PRE_F2 0x02 21 | #define PRE_F3 0x04 22 | #define PRE_66 0x08 23 | #define PRE_67 0x10 24 | #define PRE_LOCK 0x20 25 | #define PRE_SEG 0x40 26 | #define PRE_ALL 0xff 27 | 28 | #define DELTA_OPCODES 0x4a 29 | #define DELTA_FPU_REG 0xf1 30 | #define DELTA_FPU_MODRM 0xf8 31 | #define DELTA_PREFIXES 0x130 32 | #define DELTA_OP_LOCK_OK 0x1a1 33 | #define DELTA_OP2_LOCK_OK 0x1b9 34 | #define DELTA_OP_ONLY_MEM 0x1cb 35 | #define DELTA_OP2_ONLY_MEM 0x1da 36 | 37 | unsigned char hde32_table[] = { 38 | 0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3, 39 | 0xa8,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xac,0xaa,0xb2,0xaa,0x9f,0x9f, 40 | 0x9f,0x9f,0xb5,0xa3,0xa3,0xa4,0xaa,0xaa,0xba,0xaa,0x96,0xaa,0xa8,0xaa,0xc3, 41 | 0xc3,0x96,0x96,0xb7,0xae,0xd6,0xbd,0xa3,0xc5,0xa3,0xa3,0x9f,0xc3,0x9c,0xaa, 42 | 0xaa,0xac,0xaa,0xbf,0x03,0x7f,0x11,0x7f,0x01,0x7f,0x01,0x3f,0x01,0x01,0x90, 43 | 0x82,0x7d,0x97,0x59,0x59,0x59,0x59,0x59,0x7f,0x59,0x59,0x60,0x7d,0x7f,0x7f, 44 | 0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x9a,0x88,0x7d, 45 | 0x59,0x50,0x50,0x50,0x50,0x59,0x59,0x59,0x59,0x61,0x94,0x61,0x9e,0x59,0x59, 46 | 0x85,0x59,0x92,0xa3,0x60,0x60,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59, 47 | 0x59,0x59,0x9f,0x01,0x03,0x01,0x04,0x03,0xd5,0x03,0xcc,0x01,0xbc,0x03,0xf0, 48 | 0x10,0x10,0x10,0x10,0x50,0x50,0x50,0x50,0x14,0x20,0x20,0x20,0x20,0x01,0x01, 49 | 0x01,0x01,0xc4,0x02,0x10,0x00,0x00,0x00,0x00,0x01,0x01,0xc0,0xc2,0x10,0x11, 50 | 0x02,0x03,0x11,0x03,0x03,0x04,0x00,0x00,0x14,0x00,0x02,0x00,0x00,0xc6,0xc8, 51 | 0x02,0x02,0x02,0x02,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0xff,0xca, 52 | 0x01,0x01,0x01,0x00,0x06,0x00,0x04,0x00,0xc0,0xc2,0x01,0x01,0x03,0x01,0xff, 53 | 0xff,0x01,0x00,0x03,0xc4,0xc4,0xc6,0x03,0x01,0x01,0x01,0xff,0x03,0x03,0x03, 54 | 0xc8,0x40,0x00,0x0a,0x00,0x04,0x00,0x00,0x00,0x00,0x7f,0x00,0x33,0x01,0x00, 55 | 0x00,0x00,0x00,0x00,0x00,0xff,0xbf,0xff,0xff,0x00,0x00,0x00,0x00,0x07,0x00, 56 | 0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 57 | 0x00,0xff,0xff,0x00,0x00,0x00,0xbf,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 58 | 0x7f,0x00,0x00,0xff,0x4a,0x4a,0x4a,0x4a,0x4b,0x52,0x4a,0x4a,0x4a,0x4a,0x4f, 59 | 0x4c,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x55,0x45,0x40,0x4a,0x4a,0x4a, 60 | 0x45,0x59,0x4d,0x46,0x4a,0x5d,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a, 61 | 0x4a,0x4a,0x4a,0x4a,0x4a,0x61,0x63,0x67,0x4e,0x4a,0x4a,0x6b,0x6d,0x4a,0x4a, 62 | 0x45,0x6d,0x4a,0x4a,0x44,0x45,0x4a,0x4a,0x00,0x00,0x00,0x02,0x0d,0x06,0x06, 63 | 0x06,0x06,0x0e,0x00,0x00,0x00,0x00,0x06,0x06,0x06,0x00,0x06,0x06,0x02,0x06, 64 | 0x00,0x0a,0x0a,0x07,0x07,0x06,0x02,0x05,0x05,0x02,0x02,0x00,0x00,0x04,0x04, 65 | 0x04,0x04,0x00,0x00,0x00,0x0e,0x05,0x06,0x06,0x06,0x01,0x06,0x00,0x00,0x08, 66 | 0x00,0x10,0x00,0x18,0x00,0x20,0x00,0x28,0x00,0x30,0x00,0x80,0x01,0x82,0x01, 67 | 0x86,0x00,0xf6,0xcf,0xfe,0x3f,0xab,0x00,0xb0,0x00,0xb1,0x00,0xb3,0x00,0xba, 68 | 0xf8,0xbb,0x00,0xc0,0x00,0xc1,0x00,0xc7,0xbf,0x62,0xff,0x00,0x8d,0xff,0x00, 69 | 0xc4,0xff,0x00,0xc5,0xff,0x00,0xff,0xff,0xeb,0x01,0xff,0x0e,0x12,0x08,0x00, 70 | 0x13,0x09,0x00,0x16,0x08,0x00,0x17,0x09,0x00,0x2b,0x09,0x00,0xae,0xff,0x07, 71 | 0xb2,0xff,0x00,0xb4,0xff,0x00,0xb5,0xff,0x00,0xc3,0x01,0x00,0xc7,0xff,0xbf, 72 | 0xe7,0x08,0x00,0xf0,0x02,0x00 73 | }; 74 | -------------------------------------------------------------------------------- /clr_loader/minhook/hde/table64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Hacker Disassembler Engine 64 C 3 | * Copyright (c) 2008-2009, Vyacheslav Patkov. 4 | * All rights reserved. 5 | * 6 | */ 7 | 8 | #define C_NONE 0x00 9 | #define C_MODRM 0x01 10 | #define C_IMM8 0x02 11 | #define C_IMM16 0x04 12 | #define C_IMM_P66 0x10 13 | #define C_REL8 0x20 14 | #define C_REL32 0x40 15 | #define C_GROUP 0x80 16 | #define C_ERROR 0xff 17 | 18 | #define PRE_ANY 0x00 19 | #define PRE_NONE 0x01 20 | #define PRE_F2 0x02 21 | #define PRE_F3 0x04 22 | #define PRE_66 0x08 23 | #define PRE_67 0x10 24 | #define PRE_LOCK 0x20 25 | #define PRE_SEG 0x40 26 | #define PRE_ALL 0xff 27 | 28 | #define DELTA_OPCODES 0x4a 29 | #define DELTA_FPU_REG 0xfd 30 | #define DELTA_FPU_MODRM 0x104 31 | #define DELTA_PREFIXES 0x13c 32 | #define DELTA_OP_LOCK_OK 0x1ae 33 | #define DELTA_OP2_LOCK_OK 0x1c6 34 | #define DELTA_OP_ONLY_MEM 0x1d8 35 | #define DELTA_OP2_ONLY_MEM 0x1e7 36 | 37 | unsigned char hde64_table[] = { 38 | 0xa5,0xaa,0xa5,0xb8,0xa5,0xaa,0xa5,0xaa,0xa5,0xb8,0xa5,0xb8,0xa5,0xb8,0xa5, 39 | 0xb8,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xac,0xc0,0xcc,0xc0,0xa1,0xa1, 40 | 0xa1,0xa1,0xb1,0xa5,0xa5,0xa6,0xc0,0xc0,0xd7,0xda,0xe0,0xc0,0xe4,0xc0,0xea, 41 | 0xea,0xe0,0xe0,0x98,0xc8,0xee,0xf1,0xa5,0xd3,0xa5,0xa5,0xa1,0xea,0x9e,0xc0, 42 | 0xc0,0xc2,0xc0,0xe6,0x03,0x7f,0x11,0x7f,0x01,0x7f,0x01,0x3f,0x01,0x01,0xab, 43 | 0x8b,0x90,0x64,0x5b,0x5b,0x5b,0x5b,0x5b,0x92,0x5b,0x5b,0x76,0x90,0x92,0x92, 44 | 0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x6a,0x73,0x90, 45 | 0x5b,0x52,0x52,0x52,0x52,0x5b,0x5b,0x5b,0x5b,0x77,0x7c,0x77,0x85,0x5b,0x5b, 46 | 0x70,0x5b,0x7a,0xaf,0x76,0x76,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b, 47 | 0x5b,0x5b,0x86,0x01,0x03,0x01,0x04,0x03,0xd5,0x03,0xd5,0x03,0xcc,0x01,0xbc, 48 | 0x03,0xf0,0x03,0x03,0x04,0x00,0x50,0x50,0x50,0x50,0xff,0x20,0x20,0x20,0x20, 49 | 0x01,0x01,0x01,0x01,0xc4,0x02,0x10,0xff,0xff,0xff,0x01,0x00,0x03,0x11,0xff, 50 | 0x03,0xc4,0xc6,0xc8,0x02,0x10,0x00,0xff,0xcc,0x01,0x01,0x01,0x00,0x00,0x00, 51 | 0x00,0x01,0x01,0x03,0x01,0xff,0xff,0xc0,0xc2,0x10,0x11,0x02,0x03,0x01,0x01, 52 | 0x01,0xff,0xff,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x10, 53 | 0x10,0x10,0x10,0x02,0x10,0x00,0x00,0xc6,0xc8,0x02,0x02,0x02,0x02,0x06,0x00, 54 | 0x04,0x00,0x02,0xff,0x00,0xc0,0xc2,0x01,0x01,0x03,0x03,0x03,0xca,0x40,0x00, 55 | 0x0a,0x00,0x04,0x00,0x00,0x00,0x00,0x7f,0x00,0x33,0x01,0x00,0x00,0x00,0x00, 56 | 0x00,0x00,0xff,0xbf,0xff,0xff,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0xff,0x00, 57 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff, 58 | 0x00,0x00,0x00,0xbf,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0x00,0x00, 59 | 0xff,0x40,0x40,0x40,0x40,0x41,0x49,0x40,0x40,0x40,0x40,0x4c,0x42,0x40,0x40, 60 | 0x40,0x40,0x40,0x40,0x40,0x40,0x4f,0x44,0x53,0x40,0x40,0x40,0x44,0x57,0x43, 61 | 0x5c,0x40,0x60,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, 62 | 0x40,0x40,0x64,0x66,0x6e,0x6b,0x40,0x40,0x6a,0x46,0x40,0x40,0x44,0x46,0x40, 63 | 0x40,0x5b,0x44,0x40,0x40,0x00,0x00,0x00,0x00,0x06,0x06,0x06,0x06,0x01,0x06, 64 | 0x06,0x02,0x06,0x06,0x00,0x06,0x00,0x0a,0x0a,0x00,0x00,0x00,0x02,0x07,0x07, 65 | 0x06,0x02,0x0d,0x06,0x06,0x06,0x0e,0x05,0x05,0x02,0x02,0x00,0x00,0x04,0x04, 66 | 0x04,0x04,0x05,0x06,0x06,0x06,0x00,0x00,0x00,0x0e,0x00,0x00,0x08,0x00,0x10, 67 | 0x00,0x18,0x00,0x20,0x00,0x28,0x00,0x30,0x00,0x80,0x01,0x82,0x01,0x86,0x00, 68 | 0xf6,0xcf,0xfe,0x3f,0xab,0x00,0xb0,0x00,0xb1,0x00,0xb3,0x00,0xba,0xf8,0xbb, 69 | 0x00,0xc0,0x00,0xc1,0x00,0xc7,0xbf,0x62,0xff,0x00,0x8d,0xff,0x00,0xc4,0xff, 70 | 0x00,0xc5,0xff,0x00,0xff,0xff,0xeb,0x01,0xff,0x0e,0x12,0x08,0x00,0x13,0x09, 71 | 0x00,0x16,0x08,0x00,0x17,0x09,0x00,0x2b,0x09,0x00,0xae,0xff,0x07,0xb2,0xff, 72 | 0x00,0xb4,0xff,0x00,0xb5,0xff,0x00,0xc3,0x01,0x00,0xc7,0xff,0xbf,0xe7,0x08, 73 | 0x00,0xf0,0x02,0x00 74 | }; 75 | -------------------------------------------------------------------------------- /clr_loader/minhook/trampoline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MinHook - The Minimalistic API Hooking Library for x64/x86 3 | * Copyright (C) 2009-2017 Tsuda Kageyu. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 20 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #pragma once 30 | 31 | #pragma pack(push, 1) 32 | 33 | // Structs for writing x86/x64 instructions. 34 | 35 | // 8-bit relative jump. 36 | typedef struct _JMP_REL_SHORT 37 | { 38 | UINT8 opcode; // EB xx: JMP +2+xx 39 | UINT8 operand; 40 | } JMP_REL_SHORT, *PJMP_REL_SHORT; 41 | 42 | // 32-bit direct relative jump/call. 43 | typedef struct _JMP_REL 44 | { 45 | UINT8 opcode; // E9/E8 xxxxxxxx: JMP/CALL +5+xxxxxxxx 46 | UINT32 operand; // Relative destination address 47 | } JMP_REL, *PJMP_REL, CALL_REL; 48 | 49 | // 64-bit indirect absolute jump. 50 | typedef struct _JMP_ABS 51 | { 52 | UINT8 opcode0; // FF25 00000000: JMP [+6] 53 | UINT8 opcode1; 54 | UINT32 dummy; 55 | UINT64 address; // Absolute destination address 56 | } JMP_ABS, *PJMP_ABS; 57 | 58 | // 64-bit indirect absolute call. 59 | typedef struct _CALL_ABS 60 | { 61 | UINT8 opcode0; // FF15 00000002: CALL [+6] 62 | UINT8 opcode1; 63 | UINT32 dummy0; 64 | UINT8 dummy1; // EB 08: JMP +10 65 | UINT8 dummy2; 66 | UINT64 address; // Absolute destination address 67 | } CALL_ABS; 68 | 69 | // 32-bit direct relative conditional jumps. 70 | typedef struct _JCC_REL 71 | { 72 | UINT8 opcode0; // 0F8* xxxxxxxx: J** +6+xxxxxxxx 73 | UINT8 opcode1; 74 | UINT32 operand; // Relative destination address 75 | } JCC_REL; 76 | 77 | // 64bit indirect absolute conditional jumps that x64 lacks. 78 | typedef struct _JCC_ABS 79 | { 80 | UINT8 opcode; // 7* 0E: J** +16 81 | UINT8 dummy0; 82 | UINT8 dummy1; // FF25 00000000: JMP [+6] 83 | UINT8 dummy2; 84 | UINT32 dummy3; 85 | UINT64 address; // Absolute destination address 86 | } JCC_ABS; 87 | 88 | #pragma pack(pop) 89 | 90 | typedef struct _TRAMPOLINE 91 | { 92 | LPVOID pTarget; // [In] Address of the target function. 93 | LPVOID pDetour; // [In] Address of the detour function. 94 | LPVOID pTrampoline; // [In] Buffer address for the trampoline and relay function. 95 | 96 | #if defined(_M_X64) || defined(__x86_64__) 97 | LPVOID pRelay; // [Out] Address of the relay function. 98 | #endif 99 | BOOL patchAbove; // [Out] Should use the hot patch area? 100 | UINT nIP; // [Out] Number of the instruction boundaries. 101 | UINT8 oldIPs[8]; // [Out] Instruction boundaries of the target function. 102 | UINT8 newIPs[8]; // [Out] Instruction boundaries of the trampoline function. 103 | } TRAMPOLINE, *PTRAMPOLINE; 104 | 105 | BOOL CreateTrampolineFunction(PTRAMPOLINE ct); 106 | -------------------------------------------------------------------------------- /clr_loader/pch.cpp: -------------------------------------------------------------------------------- 1 | // pch.cpp: source file corresponding to the pre-compiled header 2 | 3 | #include "pch.h" 4 | 5 | // When you are using pre-compiled headers, this source file is necessary for compilation to succeed. 6 | -------------------------------------------------------------------------------- /clr_loader/pch.h: -------------------------------------------------------------------------------- 1 | // pch.h: This is a precompiled header file. 2 | // Files listed below are compiled only once, improving build performance for future builds. 3 | // This also affects IntelliSense performance, including code completion and many code browsing features. 4 | // However, files listed here are ALL re-compiled if any one of them is updated between builds. 5 | // Do not add files here that you will be updating frequently as this negates the performance advantage. 6 | 7 | #ifndef PCH_H 8 | #define PCH_H 9 | 10 | // add headers that you want to pre-compile here 11 | #include "framework.h" 12 | 13 | #endif //PCH_H 14 | -------------------------------------------------------------------------------- /face_injector_v2/api/drvutils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void start_driver() 4 | { 5 | driver().handle_driver(); 6 | 7 | if (!driver().is_loaded()) 8 | { 9 | cout << xor_a("driver initialize...") << endl; 10 | mmap_driver(22); 11 | } 12 | 13 | driver().handle_driver(); 14 | driver().is_loaded() ? cout << xor_a("driver initialized!") << endl : cout << xor_a("driver initialize error =<") << endl; 15 | 16 | // fallback incase provider 22 fails. 17 | if (!driver().is_loaded()) 18 | { 19 | cout << "driver init retry..." << endl; 20 | mmap_driver(19); 21 | 22 | driver().handle_driver(); 23 | driver().is_loaded() ? cout << xor_a("driver retry success!") << endl : cout << xor_a("first retry failed") << endl; 24 | } 25 | 26 | // fallback incase provider 19 fails. 27 | if (!driver().is_loaded()) 28 | { 29 | cout << "driver init retry #2..." << endl; 30 | mmap_driver(15); 31 | 32 | driver().handle_driver(); 33 | driver().is_loaded() ? cout << xor_a("driver retry #2 success!") << endl : cout << xor_a("final retry failed, make sure your anti-virus is not blocking the vulnerable driver.") << endl; 34 | if (!driver().is_loaded()) { system("pause"); std::terminate(); } 35 | } 36 | 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /face_injector_v2/api/utilit.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #pragma warning(disable : 4005) 5 | #include 6 | #pragma warning(default : 4005) 7 | 8 | inline NTSTATUS last_nt_status() 9 | { 10 | return *(NTSTATUS*)((unsigned char*)NtCurrentTeb() + (0x598 + 0x197 * sizeof(void*))); 11 | } 12 | inline NTSTATUS last_nt_status(NTSTATUS status) 13 | { 14 | return *(NTSTATUS*)((unsigned char*)NtCurrentTeb() + (0x598 + 0x197 * sizeof(void*))) = status; 15 | } 16 | class utilit 17 | { 18 | public: 19 | static std::wstring get_parent(const std::wstring& path) 20 | { 21 | if (path.empty()) 22 | return path; 23 | 24 | auto idx = path.rfind(L'\\'); 25 | if (idx == path.npos) 26 | idx = path.rfind(L'/'); 27 | 28 | if (idx != path.npos) 29 | return path.substr(0, idx); 30 | else 31 | return path; 32 | } 33 | static std::wstring get_exe_directory() 34 | { 35 | wchar_t imgName[MAX_PATH] = { 0 }; 36 | GetModuleFileNameW(NULL, imgName, MAX_PATH); 37 | return get_parent(imgName); 38 | } 39 | static NTSTATUS set_priviledge(const LPCWSTR name) 40 | { 41 | TOKEN_PRIVILEGES Priv, PrivOld; 42 | DWORD cbPriv = sizeof(PrivOld); 43 | HANDLE hToken; 44 | 45 | if (!OpenThreadToken(GetCurrentThread(), TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES, FALSE, &hToken)) 46 | { 47 | if (GetLastError() != ERROR_NO_TOKEN) 48 | return last_nt_status(); 49 | 50 | if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES, &hToken)) 51 | return last_nt_status(); 52 | } 53 | 54 | Priv.PrivilegeCount = 1; 55 | Priv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; 56 | LookupPrivilegeValueW(NULL, name, &Priv.Privileges[0].Luid); 57 | 58 | if (!AdjustTokenPrivileges(hToken, FALSE, &Priv, sizeof(Priv), &PrivOld, &cbPriv)) 59 | { 60 | CloseHandle(hToken); 61 | return last_nt_status(); 62 | } 63 | 64 | if (GetLastError() == ERROR_NOT_ALL_ASSIGNED) 65 | { 66 | CloseHandle(hToken); 67 | return last_nt_status(); 68 | } 69 | 70 | return STATUS_SUCCESS; 71 | } 72 | }; 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /face_injector_v2/api/xor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | template struct EnsureCompileTime { 4 | enum : int { 5 | Value = X 6 | }; 7 | }; 8 | #define Seed ((__TIME__[7] - '0') * 1 + (__TIME__[6] - '0') * 10 + \ 9 | (__TIME__[4] - '0') * 60 + (__TIME__[3] - '0') * 600 + \ 10 | (__TIME__[1] - '0') * 3600 + (__TIME__[0] - '0') * 36000) 11 | 12 | __forceinline constexpr int LinearCongruentGenerator(int Rounds) { 13 | return 1013904223 + 1664525 * ((Rounds > 0) ? LinearCongruentGenerator(Rounds - 1) : Seed & 0xFFFFFFFF); 14 | } 15 | #define Random() EnsureCompileTime::Value 16 | #define RandomNumber(Min, Max) (Min + (Random() % (Max - Min + 1))) 17 | template struct IndexList {}; 18 | template struct Append; 19 | template struct Append, Right> { 20 | typedef IndexList Result; 21 | }; 22 | template struct ConstructIndexList { 23 | typedef typename Append::Result, N - 1>::Result Result; 24 | }; 25 | template <> struct ConstructIndexList<0> { 26 | typedef IndexList<> Result; 27 | }; 28 | const char XORKEY_A = static_cast(0x13); 29 | const wchar_t XORKEY_W = static_cast(0x133); 30 | __declspec(noinline) constexpr char EncryptCharacterA(const char Character, int Index) { 31 | return Character ^ (XORKEY_A + Index); 32 | } 33 | template class CingA; 34 | template class CingA > { 35 | private: 36 | char Value[sizeof...(Index) + 1]; 37 | public: 38 | __forceinline constexpr CingA(const char* const String) 39 | : Value{ EncryptCharacterA(String[Index], Index)... } {} 40 | 41 | __forceinline char* decrypt() { 42 | for (int t = 0; t < sizeof...(Index); t++) { 43 | Value[t] = Value[t] ^ (XORKEY_A + t); 44 | } 45 | Value[sizeof...(Index)] = '\0'; 46 | return Value; 47 | } 48 | 49 | __forceinline char* get() { 50 | return Value; 51 | } 52 | }; 53 | __declspec(noinline) constexpr wchar_t EncryptCharacterW(const wchar_t Character, int Index) { 54 | return Character ^ (XORKEY_W + Index); 55 | } 56 | template class CingW; 57 | template class CingW > { 58 | private: 59 | wchar_t Value[sizeof...(Index) + 1]; 60 | public: 61 | __forceinline constexpr CingW(const wchar_t* const String) 62 | : Value{ EncryptCharacterW(String[Index], Index)... } {} 63 | 64 | __forceinline wchar_t* decrypt() { 65 | for (int t = 0; t < sizeof...(Index); t++) { 66 | Value[t] = Value[t] ^ (XORKEY_W + t); 67 | } 68 | Value[sizeof...(Index)] = '\0\0'; 69 | return Value; 70 | } 71 | 72 | __forceinline wchar_t* get() { 73 | return Value; 74 | } 75 | }; 76 | 77 | #define xor_a( String ) ( CingA::Result>( String ).decrypt() ) 78 | #define xor_w( String ) ( CingW::Result>( String ).decrypt() ) 79 | -------------------------------------------------------------------------------- /face_injector_v2/define/stdafx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #pragma comment(lib, "shlwapi.lib") 42 | #pragma comment(lib, "ntdll.lib") 43 | #pragma comment(lib, "Advapi32.lib") 44 | 45 | using namespace std; 46 | #define StrToWStr(s) (wstring(s, &s[strlen(s)]).c_str()) 47 | extern "C" NTSYSAPI PIMAGE_NT_HEADERS NTAPI RtlImageNtHeader(PVOID Base); 48 | 49 | -------------------------------------------------------------------------------- /face_injector_v2/driver/defines.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /////////////////////////////////////////////////////////// 4 | #define offset_io_mirrore 0x2338 5 | #define file_device_mirrore 0x3009 6 | /////////////////////////////////////////////////////////// 7 | 8 | /////////////////////////////////////////////////////////// 9 | #define ioctl_get_module_information (ULONG)CTL_CODE(file_device_mirrore, offset_io_mirrore + 0x0010, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) 10 | #define ioctl_copy_memory (ULONG)CTL_CODE(file_device_mirrore, offset_io_mirrore + 0x0050, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) 11 | #define ioctl_protect_memory (ULONG)CTL_CODE(file_device_mirrore, offset_io_mirrore + 0x0100, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) 12 | #define ioctl_alloc_memory (ULONG)CTL_CODE(file_device_mirrore, offset_io_mirrore + 0x0150, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) 13 | #define ioctl_free_memory (ULONG)CTL_CODE(file_device_mirrore, offset_io_mirrore + 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) 14 | /////////////////////////////////////////////////////////// 15 | 16 | /////////////////////////////////////////////////////////// 17 | typedef struct _set_module_information 18 | { 19 | ULONG pid; 20 | wchar_t sz_name[32]; 21 | } set_module_information, *pset_module_information; 22 | 23 | typedef struct _get_module_information 24 | { 25 | ULONGLONG base_image; 26 | ULONGLONG size_of_image; 27 | } get_module_information, *pget_module_information; 28 | 29 | typedef struct _copy_memory 30 | { 31 | ULONGLONG buffer; 32 | ULONGLONG address; 33 | ULONGLONG size; 34 | ULONG pid; 35 | BOOLEAN write; 36 | } copy_memory, *pcopy_memory; 37 | 38 | typedef struct _protect_memory 39 | { 40 | ULONG pid; 41 | ULONGLONG address; 42 | ULONGLONG size; 43 | PDWORD new_protect; 44 | } protect_memory, *pprotect_memory; 45 | 46 | typedef struct _alloc_memory 47 | { 48 | ULONG pid; 49 | ULONGLONG out_address; 50 | ULONGLONG size; 51 | ULONG protect; 52 | } alloc_memory, *palloc_memory; 53 | 54 | typedef struct _free_memory 55 | { 56 | ULONG pid; 57 | ULONGLONG address; 58 | } free_memory, *pfree_memory; 59 | /////////////////////////////////////////////////////////// 60 | 61 | -------------------------------------------------------------------------------- /face_injector_v2/driver/driver.cpp: -------------------------------------------------------------------------------- 1 | #include "driver.h" 2 | #include "../api/xor.h" 3 | 4 | #define DVR_DEVICE_FILE xor_w(L"\\\\.\\EIQDV") 5 | 6 | c_driver::c_driver() 7 | { 8 | /**/ 9 | } 10 | NTSTATUS c_driver::send_serivce(ULONG ioctl_code, LPVOID io, DWORD size) 11 | { 12 | if (h_driver == INVALID_HANDLE_VALUE) 13 | return STATUS_DEVICE_DOES_NOT_EXIST; 14 | 15 | if (!DeviceIoControl(h_driver, ioctl_code, io, size, nullptr, 0, NULL, NULL)) 16 | return STATUS_UNSUCCESSFUL; 17 | 18 | return STATUS_SUCCESS; 19 | } 20 | void c_driver::attach_process(DWORD pid) 21 | { 22 | process_id = pid; 23 | } 24 | NTSTATUS c_driver::get_module_information_ex(const wchar_t* name, pget_module_information mod) 25 | { 26 | if (h_driver == INVALID_HANDLE_VALUE) 27 | return STATUS_DEVICE_DOES_NOT_EXIST; 28 | 29 | set_module_information req = { 0 }; 30 | 31 | req.pid = process_id; 32 | wcscpy_s(req.sz_name, name); 33 | 34 | if (!DeviceIoControl(h_driver, ioctl_get_module_information, &req, sizeof(req), mod, sizeof(get_module_information), 0, NULL)) 35 | return STATUS_UNSUCCESSFUL; 36 | 37 | return STATUS_SUCCESS; 38 | } 39 | NTSTATUS c_driver::read_memory_ex(PVOID base, PVOID buffer, DWORD size) 40 | { 41 | copy_memory req = { 0 }; 42 | 43 | req.pid = process_id; 44 | req.address = reinterpret_cast(base); 45 | req.buffer = reinterpret_cast(buffer); 46 | req.size = (uint64_t)size; 47 | req.write = FALSE; 48 | 49 | return send_serivce(ioctl_copy_memory, &req, sizeof(req)); 50 | } 51 | NTSTATUS c_driver::write_memory_ex(PVOID base, PVOID buffer, DWORD size) 52 | { 53 | copy_memory req = { 0 }; 54 | 55 | req.pid = process_id; 56 | req.address = reinterpret_cast(base); 57 | req.buffer = reinterpret_cast(buffer); 58 | req.size = (uint64_t)size; 59 | req.write = TRUE; 60 | 61 | return send_serivce(ioctl_copy_memory, &req, sizeof(req)); 62 | } 63 | NTSTATUS c_driver::protect_memory_ex(uint64_t base, uint64_t size, PDWORD protection) 64 | { 65 | protect_memory req = { 0 }; 66 | 67 | req.pid = process_id; 68 | req.address = base; 69 | req.size = size; 70 | req.new_protect = protection; 71 | 72 | return send_serivce(ioctl_protect_memory, &req, sizeof(req)); 73 | } 74 | PVOID c_driver::alloc_memory_ex(DWORD size, DWORD protect) 75 | { 76 | PVOID p_out_address = NULL; 77 | alloc_memory req = { 0 }; 78 | 79 | req.pid = process_id; 80 | req.out_address = reinterpret_cast(&p_out_address); 81 | req.size = size; 82 | req.protect = protect; 83 | 84 | send_serivce(ioctl_alloc_memory, &req, sizeof(req)); 85 | 86 | return p_out_address; 87 | } 88 | NTSTATUS c_driver::free_memory_ex(PVOID address) 89 | { 90 | free_memory req = { 0 }; 91 | 92 | req.pid = process_id; 93 | req.address = reinterpret_cast(address); 94 | 95 | return send_serivce(ioctl_free_memory, &req, sizeof(req)); 96 | } 97 | void c_driver::handle_driver() 98 | { 99 | h_driver = CreateFileW(DVR_DEVICE_FILE, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); 100 | } 101 | c_driver::~c_driver() 102 | { 103 | CloseHandle(h_driver); 104 | } 105 | c_driver& c_driver::singleton() 106 | { 107 | static c_driver p_object; 108 | return p_object; 109 | } -------------------------------------------------------------------------------- /face_injector_v2/driver/driver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #pragma warning(disable : 4005) 5 | #include 6 | #pragma warning(default : 4005) 7 | #include "defines.h" 8 | 9 | class c_driver 10 | { 11 | public: 12 | c_driver(); 13 | ~c_driver(); 14 | 15 | DWORD process_id = 0; 16 | 17 | static c_driver& singleton(); 18 | void handle_driver(); 19 | void attach_process(DWORD pid); 20 | 21 | NTSTATUS send_serivce(ULONG ioctl_code, LPVOID io, DWORD size); 22 | NTSTATUS get_module_information_ex(const wchar_t* name, pget_module_information mod); 23 | NTSTATUS read_memory_ex(PVOID base, PVOID buffer, DWORD size); 24 | NTSTATUS write_memory_ex(PVOID base, PVOID buffer, DWORD size); 25 | NTSTATUS protect_memory_ex(uint64_t base, uint64_t size, PDWORD protection); 26 | PVOID alloc_memory_ex(DWORD size, DWORD protect); 27 | NTSTATUS free_memory_ex(PVOID address); 28 | 29 | inline bool is_loaded() const { return h_driver != INVALID_HANDLE_VALUE; } 30 | private: 31 | c_driver(const c_driver&) = delete; 32 | c_driver& operator = (const c_driver&) = delete; 33 | HANDLE h_driver = INVALID_HANDLE_VALUE; 34 | }; 35 | 36 | inline c_driver& driver() 37 | { 38 | return c_driver::singleton(); 39 | } 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /face_injector_v2/inject/utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | PVOID get_dll_by_file(LPCWSTR file_path) 5 | { 6 | HANDLE h_dll = CreateFileW(file_path, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); 7 | if (h_dll == INVALID_HANDLE_VALUE) 8 | return NULL; 9 | 10 | DWORD dll_file_sz = GetFileSize(h_dll, NULL); 11 | PVOID dll_buffer = VirtualAlloc(NULL, dll_file_sz, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); 12 | 13 | if (!ReadFile(h_dll, dll_buffer, dll_file_sz, NULL, FALSE) || *(PDWORD)dll_buffer != 9460301) 14 | { 15 | VirtualFree(dll_buffer, 0, MEM_RELEASE); 16 | goto exit; 17 | } 18 | 19 | exit: 20 | CloseHandle(h_dll); 21 | return dll_buffer; 22 | } 23 | 24 | std::wstring to_fast_convert_wchar(PCCH a) 25 | { 26 | std::wstring out_str; 27 | 28 | for (int i = 0; i < strlen(a) + 1; i++) 29 | out_str.push_back((const wchar_t)a[i]); 30 | 31 | return out_str; 32 | } 33 | 34 | DWORD get_process_id_and_thread_id_by_window_class(LPCSTR window_class_name, PDWORD p_thread_id) 35 | { 36 | DWORD process_id = 0; 37 | while (!process_id) 38 | { 39 | *p_thread_id = GetWindowThreadProcessId(FindWindow(window_class_name, NULL), &process_id); Sleep(20); 40 | } return process_id; 41 | } 42 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 43 | 44 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 45 | DWORD get_process_id_by_name(PCSTR name) 46 | { 47 | DWORD pid = 0; 48 | 49 | HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); 50 | PROCESSENTRY32 process; 51 | ZeroMemory(&process, sizeof(process)); 52 | process.dwSize = sizeof(process); 53 | 54 | if (Process32First(snapshot, &process)) 55 | { 56 | do 57 | { 58 | if (string(process.szExeFile) == string(name)) 59 | { 60 | pid = process.th32ProcessID; 61 | break; 62 | } 63 | } while (Process32Next(snapshot, &process)); 64 | } 65 | 66 | CloseHandle(snapshot); 67 | return pid; 68 | } 69 | 70 | string get_process_name_by_pid(DWORD process_id) 71 | { 72 | PROCESSENTRY32 processInfo; 73 | processInfo.dwSize = sizeof(processInfo); 74 | HANDLE processesSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL); 75 | if (processesSnapshot == INVALID_HANDLE_VALUE) 76 | return 0; 77 | 78 | for (BOOL bok = Process32First(processesSnapshot, &processInfo); bok; bok = Process32Next(processesSnapshot, &processInfo)) 79 | { 80 | if (process_id == processInfo.th32ProcessID) 81 | { 82 | return processInfo.szExeFile; 83 | } 84 | } 85 | 86 | CloseHandle(processesSnapshot); 87 | return string(); 88 | } 89 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 90 | -------------------------------------------------------------------------------- /face_injector_v2/main.cpp: -------------------------------------------------------------------------------- 1 | #include "define/stdafx.h" 2 | #include "api/xor.h" 3 | #include "api/api.h" 4 | #include "driver/driver.h" 5 | #include "inject/injector.h" 6 | #include "api/drvutils.h" 7 | #include 8 | #include 9 | #include 10 | #pragma comment(lib, "urlmon.lib") 11 | 12 | int main() 13 | { 14 | start_driver(); 15 | cout << endl; 16 | 17 | string text; 18 | ifstream file("vrchat.txt"); 19 | 20 | while (getline(file, text)) { 21 | cout << "saved vrchat dir: " << text << std::endl; 22 | } 23 | 24 | file.close(); 25 | 26 | if (text == "") 27 | { 28 | HKEY key; 29 | // this explicitly will expect someone to be on 64 bit windows, who the fuck uses 32 bit windows anymore 30 | RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\WOW6432Node\\Valve\\Steam", 0, KEY_READ, &key); 31 | 32 | unsigned long type = REG_SZ, size = 1024; 33 | char res[1024] = ""; 34 | RegQueryValueEx(key, 35 | "InstallPath", 36 | NULL, 37 | &type, 38 | (LPBYTE)&res[0], 39 | &size); 40 | RegCloseKey(key); 41 | 42 | string vrc_path = basic_string(res) + "\\steamapps\\common\\VRChat"; 43 | std::cout << "potential vrc path: " << vrc_path << std::endl; 44 | std::cout << "checking..."; 45 | if (std::filesystem::is_directory(vrc_path) == false) 46 | { 47 | cout << std::endl << std::endl << "failed to find vrchat directory, please enter your vrchat directory." << std::endl; 48 | 49 | vrc_path = ""; 50 | getline(std::cin, vrc_path); 51 | 52 | const std::filesystem::path path = std::filesystem::u8path(vrc_path); 53 | 54 | if (std::filesystem::is_directory(path) == false) 55 | { 56 | cout << "not a valid directory." << std::endl; 57 | system("pause"); 58 | return 0; 59 | } 60 | 61 | ofstream write_file; 62 | write_file.open("vrchat.txt"); 63 | write_file << vrc_path; 64 | write_file.close(); 65 | } 66 | else { std::cout << " valid!" << std::endl << std::endl; } 67 | text = vrc_path; 68 | } 69 | 70 | std::cout << std::endl << "downloading files..." << std::endl; 71 | 72 | auto log_res = URLDownloadToFile(0, "https://ares-mod.com/logger/ares_logger.dll", (text + "\\ares_logger.dll").c_str(), 0, NULL); 73 | _com_error log_err(log_res); 74 | LPCTSTR log_msg = log_err.ErrorMessage(); 75 | 76 | if (log_res != S_OK) std::cout << "failed to download logger, msg: " << log_msg << std::endl; 77 | 78 | auto ldr_res = URLDownloadToFile(0, "https://ares-mod.com/logger/clr_loader.dll", "clr_loader.dll", 0, NULL); 79 | _com_error ldr_err(ldr_res); 80 | LPCTSTR ldr_msg = ldr_err.ErrorMessage(); 81 | 82 | if (ldr_res != S_OK) std::cout << "failed to download loader, msg: " << ldr_msg << std::endl; 83 | 84 | auto dep_res = URLDownloadToFile(0, "https://ares-mod.com/logger/json.dll", (text + "\\Newtonsoft.Json.dll").c_str(), 0, NULL); 85 | _com_error dep_err(dep_res); 86 | LPCTSTR dep_msg = dep_err.ErrorMessage(); 87 | 88 | if (dep_res != S_OK) std::cout << "failed to download dependency, msg: " << dep_msg << std::endl; 89 | 90 | if (log_res == S_OK && ldr_res == S_OK && dep_res == S_OK) std::cout << "successfully downloaded all required files" << std::endl << std::endl; 91 | else { std::cout << "unable to download a required file, check your internet connection." << std::endl; system("pause"); return 0; } 92 | 93 | char type; 94 | do 95 | { 96 | std::cout << "start vrchat? (this will start it in non-vr mode) y/n" << std::endl; 97 | std::cin >> type; 98 | } while (!std::cin.fail() && type != 'y' && type != 'n'); 99 | 100 | if (type == 'y') ShellExecuteW(NULL, L"open", L"steam://rungameid/438100", NULL, NULL, 1); 101 | if (type == 'n') std::cout << "you may start vrchat on your own." << std::endl; 102 | std::cout << std::endl; 103 | 104 | face_injecor_v2(xor_a("UnityWndClass"), xor_w(L"clr_loader.dll")); 105 | 106 | remove("clr_loader.dll"); 107 | 108 | cout << endl; 109 | system("pause"); 110 | } --------------------------------------------------------------------------------