Ejemplo n.º 1
0
        public void Disassemble(ModuleDef module, BamlDocument document)
        {
            WriteText("Signature:      \t");
            WriteString(document.Signature);
            output.WriteLine();

            WriteText("Reader Version: \t");
            WriteVersion(document.ReaderVersion);
            output.WriteLine();

            WriteText("Updater Version:\t");
            WriteVersion(document.UpdaterVersion);
            output.WriteLine();

            WriteText("Writer Version: \t");
            WriteVersion(document.WriterVersion);
            output.WriteLine();

            WriteText("Record #:       \t");
            output.Write(document.Count.ToString(CultureInfo.InvariantCulture), BoxedTextColor.Number);
            output.WriteLine();

            output.WriteLine();

            var ctx = BamlContext.ConstructContext(module, document, token);

            scopeStack.Clear();
            foreach (var record in document)
            {
                token.ThrowIfCancellationRequested();
                DisassembleRecord(ctx, record);
            }
        }
Ejemplo n.º 2
0
        public static XamlContext Construct(ModuleDef module, BamlDocument document, CancellationToken token)
        {
            var ctx = new XamlContext(module);

            ctx.CancellationToken = token;

            ctx.Baml     = BamlContext.ConstructContext(module, document, token);
            ctx.RootNode = BamlNode.Parse(document, token);

            ctx.BuildPIMappings(document);
            ctx.BuildNodeMap(ctx.RootNode as BamlBlockNode, new RecursionCounter());

            return(ctx);
        }
Ejemplo n.º 3
0
        public static XamlContext Construct(IDecompilerTypeSystem typeSystem, BamlDocument document, CancellationToken token, BamlDecompilerOptions bamlDecompilerOptions)
        {
            var ctx = new XamlContext(typeSystem);

            ctx.CancellationToken     = token;
            ctx.BamlDecompilerOptions = bamlDecompilerOptions ?? new BamlDecompilerOptions();

            ctx.Baml     = BamlContext.ConstructContext(typeSystem, document, token);
            ctx.RootNode = BamlNode.Parse(document, token);

            ctx.BuildPIMappings(document);
            ctx.BuildNodeMap(ctx.RootNode as BamlBlockNode);

            return(ctx);
        }