Пример #1
0
    public override void Run(BuildContext context)
    {
        var dumperConfig = new Il2CppDumper.Config
        {
            //GenerateScript = false,
            GenerateDummyDll = true
        };

        Console.WriteLine("Test2");

        context.Information("Generating Il2CppDumper intermediate assemblies");

        var gameAssemblyPath = Path.Combine(context.AmongUsPath, "GameAssembly.dll");

        if (!Directory.Exists(context.TempPath))
        {
            Directory.CreateDirectory(context.TempPath);
        }

        Il2CppDumper.Il2CppDumper.PerformDump(
            gameAssemblyPath,
            Path.Combine(context.AmongUsPath, "Among Us_Data", "il2cpp_data", "Metadata", "global-metadata.dat"),
            context.TempPath, dumperConfig, context.Debug
            );

        context.Information("Executing Il2CppUnhollower generator");

        UnhollowerBaseLib.LogSupport.InfoHandler    += context.Information;
        UnhollowerBaseLib.LogSupport.WarningHandler += context.Warning;
        UnhollowerBaseLib.LogSupport.TraceHandler   += context.Debug;
        UnhollowerBaseLib.LogSupport.ErrorHandler   += context.Error;

        var unhollowerOptions = new UnhollowerOptions
        {
            GameAssemblyPath     = gameAssemblyPath,
            MscorlibPath         = Path.Combine(context.AmongUsPath, "mono", "Managed", "mscorlib.dll"),
            SourceDir            = Path.Combine(context.TempPath, "DummyDll"),
            OutputDir            = Path.Combine(context.AmongUsPath, "BepInEx", "unhollowed"),
            UnityBaseLibsDir     = Path.Combine(context.AmongUsPath, "BepInEx", "unity-libs"),
            NoCopyUnhollowerLibs = true
        };

        AssemblyUnhollower.Program.Main(unhollowerOptions);
    }