mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
Allow base unity libraries to be given to unhollower
This commit is contained in:
1 file changed
+18
-6
@@ -96,17 +96,15 @@ namespace BepInEx.IL2CPP
|
||||
{
|
||||
listener.DoPreloaderLog("Generating Il2CppUnhollower assemblies", LogLevel.Message);
|
||||
|
||||
if (Directory.Exists(Preloader.IL2CPPUnhollowedPath))
|
||||
Directory.Delete(Preloader.IL2CPPUnhollowedPath, true);
|
||||
|
||||
Directory.CreateDirectory(Preloader.IL2CPPUnhollowedPath);
|
||||
|
||||
foreach (var dllFile in Directory.EnumerateFiles(Preloader.IL2CPPUnhollowedPath, "*.dll", SearchOption.TopDirectoryOnly))
|
||||
File.Delete(dllFile);
|
||||
|
||||
string tempDumperDirectory = Path.Combine(Preloader.IL2CPPUnhollowedPath, "temp");
|
||||
Directory.CreateDirectory(tempDumperDirectory);
|
||||
|
||||
|
||||
|
||||
|
||||
var dumperConfig = new Config
|
||||
{
|
||||
GenerateScript = false,
|
||||
@@ -130,12 +128,26 @@ namespace BepInEx.IL2CPP
|
||||
UnhollowerBaseLib.LogSupport.TraceHandler += s => listener.DoUnhollowerLog(s, LogLevel.Debug);
|
||||
UnhollowerBaseLib.LogSupport.ErrorHandler += s => listener.DoUnhollowerLog(s, LogLevel.Error);
|
||||
|
||||
|
||||
string unityBaseLibDir = Path.Combine(Preloader.IL2CPPUnhollowedPath, "base");
|
||||
|
||||
if (Directory.Exists(unityBaseLibDir))
|
||||
{
|
||||
listener.DoPreloaderLog("Found base unity libraries", LogLevel.Debug);
|
||||
}
|
||||
else
|
||||
{
|
||||
unityBaseLibDir = null;
|
||||
}
|
||||
|
||||
|
||||
var unhollowerOptions = new UnhollowerOptions
|
||||
{
|
||||
GameAssemblyPath = GameAssemblyPath,
|
||||
MscorlibPath = Path.Combine(Paths.GameRootPath, "mono", "Managed", "mscorlib.dll"),
|
||||
SourceDir = Path.Combine(tempDumperDirectory, "DummyDll"),
|
||||
OutputDir = Preloader.IL2CPPUnhollowedPath
|
||||
OutputDir = Preloader.IL2CPPUnhollowedPath,
|
||||
UnityBaseLibsDir = unityBaseLibDir
|
||||
};
|
||||
|
||||
AssemblyUnhollower.Program.Main(unhollowerOptions);
|
||||
|
||||
Reference in new issue
Block a user