16
16
using BF = System . Reflection . BindingFlags ;
17
17
using UnityExplorer . Core . Config ;
18
18
using UnhollowerBaseLib . Attributes ;
19
+ using UnityEngine ;
19
20
20
21
namespace UnityExplorer
21
22
{
@@ -25,10 +26,15 @@ protected override void Initialize()
25
26
{
26
27
base . Initialize ( ) ;
27
28
29
+ float start = Time . realtimeSinceStartup ;
28
30
TryLoadGameModules ( ) ;
31
+ ExplorerCore . Log ( $ "Loaded Unhollowed modules in { Time . realtimeSinceStartup - start } seconds") ;
29
32
33
+ start = Time . realtimeSinceStartup ;
30
34
BuildDeobfuscationCache ( ) ;
31
35
OnTypeLoaded += TryCacheDeobfuscatedType ;
36
+ ExplorerCore . Log ( $ "Setup IL2CPP reflection in { Time . realtimeSinceStartup - start } seconds, " +
37
+ $ "deobfuscated types count: { DeobfuscatedTypes . Count } ") ;
32
38
}
33
39
34
40
#region IL2CPP Extern and pointers
@@ -67,19 +73,11 @@ public static bool Il2CppTypeNotNull(Type type, out IntPtr il2cppPtr)
67
73
68
74
private static void BuildDeobfuscationCache ( )
69
75
{
70
- float start = UnityEngine . Time . realtimeSinceStartup ;
71
-
72
76
foreach ( var asm in AppDomain . CurrentDomain . GetAssemblies ( ) )
73
77
{
74
78
foreach ( var type in asm . TryGetTypes ( ) )
75
79
TryCacheDeobfuscatedType ( type ) ;
76
80
}
77
-
78
- if ( DeobfuscatedTypes . Count > 0 )
79
- {
80
- ExplorerCore . Log ( $ "Built deobfuscation cache in { UnityEngine . Time . realtimeSinceStartup - start } seconds, " +
81
- $ "initial count: { DeobfuscatedTypes . Count } ") ;
82
- }
83
81
}
84
82
85
83
private static void TryCacheDeobfuscatedType ( Type type )
0 commit comments