Merge pull request #321 from js6pak/ConfigDumpDummyAssemblies

Add ConfigDumpDummyAssemblies
This commit is contained in:
Geoffrey Horsington authored and GitHub committed 2021-10-23 20:23:14 +03:00
commit 74ebe80da8
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,