14
14
using Il2CppDumper ;
15
15
using Mono . Cecil ;
16
16
using UnhollowerBaseLib ;
17
- using AssemblyUnhollowerRunner = AssemblyUnhollower . Program ;
18
17
using Logger = BepInEx . Logging . Logger ;
19
18
20
19
namespace BepInEx . IL2CPP ;
@@ -93,7 +92,7 @@ static void HashString(ICryptoTransform hash, string str)
93
92
}
94
93
95
94
// Hash some common dependencies as they can affect output
96
- HashString ( md5 , typeof ( AssemblyUnhollowerRunner ) . Assembly . GetName ( ) . Version . ToString ( ) ) ;
95
+ HashString ( md5 , typeof ( UnhollowedAssemblyGenerator ) . Assembly . GetName ( ) . Version . ToString ( ) ) ;
97
96
HashString ( md5 , typeof ( Cpp2IlApi ) . Assembly . GetName ( ) . Version . ToString ( ) ) ;
98
97
HashString ( md5 , typeof ( Il2CppDumper . Il2CppDumper ) . Assembly . GetName ( ) . Version . ToString ( ) ) ;
99
98
@@ -145,9 +144,9 @@ public static void GenerateAssemblies()
145
144
} ) ;
146
145
147
146
var runner =
148
- ( AppDomainRunner ) AppDomainHelper . CreateInstanceAndUnwrap ( domain ,
149
- typeof ( AppDomainRunner ) . Assembly . FullName ,
150
- typeof ( AppDomainRunner ) . FullName ) ;
147
+ ( AppDomainRunner ) AppDomainHelper . CreateInstanceAndUnwrap ( domain ,
148
+ typeof ( AppDomainRunner ) . Assembly . FullName ,
149
+ typeof ( AppDomainRunner ) . FullName ) ;
151
150
152
151
runner . Setup ( Paths . ExecutablePath , Preloader . IL2CPPUnhollowedPath , Paths . BepInExRootPath ,
153
152
Paths . ManagedPath ) ;
@@ -341,29 +340,9 @@ private void GenerateAssembliesInternal(AppDomainListener listener,
341
340
if ( File . Exists ( renameMapLocation ) )
342
341
{
343
342
listener . DoPreloaderLog ( "Parsing deobfuscation rename mappings" , LogLevel . Info ) ;
344
-
345
- using var fileStream =
346
- new FileStream ( renameMapLocation , FileMode . Open , FileAccess . Read , FileShare . Read ) ;
347
- using var gzipStream = new GZipStream ( fileStream , CompressionMode . Decompress ) ;
348
-
349
- using var reader = new StreamReader ( gzipStream , Encoding . UTF8 , false ) ;
350
- while ( ! reader . EndOfStream )
351
- {
352
- var line = reader . ReadLine ( ) ;
353
-
354
- if ( string . IsNullOrWhiteSpace ( line ) || line . StartsWith ( "#" ) )
355
- continue ;
356
-
357
- var mapping = line . Split ( ';' ) ;
358
-
359
- if ( mapping . Length != 2 )
360
- continue ;
361
-
362
- unhollowerOptions . RenameMap [ mapping [ 0 ] ] = mapping [ 1 ] ;
363
- }
343
+ unhollowerOptions . ReadRenameMap ( renameMapLocation ) ;
364
344
}
365
345
366
-
367
346
listener . DoPreloaderLog ( "Executing Il2CppUnhollower generator" , LogLevel . Info ) ;
368
347
369
348
LogSupport . InfoHandler += s => listener . DoUnhollowerLog ( s . Trim ( ) , LogLevel . Info ) ;
@@ -373,7 +352,7 @@ private void GenerateAssembliesInternal(AppDomainListener listener,
373
352
374
353
try
375
354
{
376
- AssemblyUnhollowerRunner . Main ( unhollowerOptions ) ;
355
+ UnhollowedAssemblyGenerator . GenerateUnhollowedAssemblies ( unhollowerOptions ) ;
377
356
}
378
357
catch ( Exception e )
379
358
{
0 commit comments