mirror of
https://github.com/GrahamKracker/UnityExplorer.git
synced 2025-07-18 17:17:52 +08:00
Implemented the console log, some cleanups
This commit is contained in:
@ -14,13 +14,16 @@ using System.Diagnostics.CodeAnalysis;
|
||||
using UnityExplorer.Core;
|
||||
using CppType = Il2CppSystem.Type;
|
||||
using BF = System.Reflection.BindingFlags;
|
||||
using UnityExplorer.Core.Config;
|
||||
|
||||
namespace UnityExplorer
|
||||
{
|
||||
public class Il2CppReflection : ReflectionUtility
|
||||
{
|
||||
public Il2CppReflection()
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
TryLoadGameModules();
|
||||
|
||||
BuildDeobfuscationCache();
|
||||
@ -70,7 +73,7 @@ namespace UnityExplorer
|
||||
}
|
||||
|
||||
if (DeobfuscatedTypes.Count > 0)
|
||||
ExplorerCore.Log($"Built deobfuscation cache, count: {DeobfuscatedTypes.Count}");
|
||||
ExplorerCore.Log($"Built IL2CPP deobfuscation cache, initial count: {DeobfuscatedTypes.Count}");
|
||||
}
|
||||
|
||||
private static void TryCacheDeobfuscatedType(Type type)
|
||||
|
@ -17,16 +17,25 @@ namespace UnityExplorer
|
||||
{
|
||||
public const BF FLAGS = BF.Public | BF.Instance | BF.NonPublic | BF.Static;
|
||||
|
||||
internal static readonly ReflectionUtility Instance =
|
||||
internal static ReflectionUtility Instance;
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
Instance =
|
||||
#if CPP
|
||||
new Il2CppReflection();
|
||||
#else
|
||||
new ReflectionUtility();
|
||||
#endif
|
||||
Instance.Initialize();
|
||||
}
|
||||
|
||||
static ReflectionUtility()
|
||||
protected virtual void Initialize()
|
||||
{
|
||||
SetupTypeCache();
|
||||
|
||||
LoadBlacklistString(ConfigManager.Reflection_Signature_Blacklist.Value);
|
||||
ConfigManager.Reflection_Signature_Blacklist.OnValueChanged += LoadBlacklistString;
|
||||
}
|
||||
|
||||
#region Type cache
|
||||
@ -409,7 +418,12 @@ namespace UnityExplorer
|
||||
public static void LoadBlacklistString(string blacklist)
|
||||
{
|
||||
if (string.Equals(blacklist, "DEFAULT", StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
blacklist = Instance.DefaultReflectionBlacklist;
|
||||
ConfigManager.Reflection_Signature_Blacklist.Value = blacklist;
|
||||
ConfigManager.Handler.SaveConfig();
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(blacklist))
|
||||
return;
|
||||
|
Reference in New Issue
Block a user