ConfigDumpDummyAssemblies

This commit is contained in:
js6pak committed 2021-10-23 19:17:09 +02:00
1 parent 337d20c97b
commit b746f57add
1 file changed
+16
+16
View File
@@ -44,6 +44,11 @@ namespace BepInEx.IL2CPP
.AppendLine("Cpp2IL - Experimental, may provide better results than Il2CppDumper. Required for use with BepInEx.MelonLoader.Loader.")
.ToString());
private static readonly ConfigEntry<bool> ConfigDumpDummyAssemblies = ConfigFile.CoreConfig.Bind(
"IL2CPP", "DumpDummyAssemblies",
false,
"If enabled, BepInEx will save dummy assemblies generated by an il2cpp dumper into BepInEx/dummy.");
private static ManualLogSource Il2cppDumperLogger = null;
public static string GameAssemblyPath => Path.Combine(Paths.GameRootPath, "GameAssembly.dll");
@@ -245,6 +250,17 @@ namespace BepInEx.IL2CPP
stopwatch.Stop();
listener.DoDumperLog("Total time: " + stopwatch.Elapsed, LogLevel.Info);
if (ConfigDumpDummyAssemblies.Value)
{
var dummyPath = Path.Combine(Paths.BepInExRootPath, "dummy");
Directory.CreateDirectory(dummyPath);
foreach (var assemblyDefinition in sourceAssemblies)
{
assemblyDefinition.Write(Path.Combine(dummyPath, assemblyDefinition.Name.Name + ".dll"));
}
}
var unhollowerOptions = new UnhollowerOptions
{
GameAssemblyPath = GameAssemblyPath,