Beispiel #1
0
        private void Rebuild(DevirtualisationOptions options, DevirtualisationContext context)
        {
            bool rebuildRuntimeImage = options.RenameSymbols && !options.RuntimeIsEmbedded;

            Logger.Log(Tag, $"Reassembling image...");
            SerializeImageToDisk(options, context, context.TargetModule, Path.GetFileName(options.InputFile));

            if (rebuildRuntimeImage)
            {
                Logger.Log(Tag, $"Reassembling runtime image...");
                SerializeImageToDisk(options, context, context.RuntimeModule, Path.GetFileName(context.Options.RuntimeFile));
            }
        }
Beispiel #2
0
        private void Rebuild(DevirtualisationOptions options, DevirtualisationContext context, bool rebuildRuntimeImage)
        {
            Logger.Log(Tag, $"Reassembling file...");
            context.TargetAssembly.Write(
                Path.Combine(options.OutputOptions.RootDirectory, Path.GetFileName(options.InputFile)),
                new CompactNetAssemblyBuilder(context.TargetAssembly));

            if (rebuildRuntimeImage)
            {
                context.RuntimeAssembly.Write(
                    Path.Combine(options.OutputOptions.RootDirectory, Path.GetFileName(context.Options.RuntimeFile)),
                    new CompactNetAssemblyBuilder(context.RuntimeAssembly));
            }
        }
Beispiel #3
0
 private void RemoveFinalTraces(DevirtualisationOptions options, DevirtualisationContext context)
 {
     // Remove #koi stream.
     if (!context.AllVirtualisedMethodsRecompiled)
     {
         var header = context.TargetImage.Header;
         Logger.Debug(Tag, "Removing #Koi metadata stream...");
         header.StreamHeaders.Remove(header.GetStream <KoiStream>().StreamHeader);
     }
     else
     {
         Logger.Debug(Tag, "Not removing koi stream as some exports were ignored.");
     }
 }