Exemplo n.º 1
0
        private PdbRoot ReadRoot(PdbStream streamRoot)
        {
            Argument.IsNotNull(() => streamRoot);

            var root = new PdbRoot(streamRoot);

            using (var brDirectory = StreamReader(streamRoot))
            {
                var streamCount = brDirectory.ReadInt32();
                if (streamCount != 0x0131CA0B)
                {
                    var streams = root.Streams;
                    for (var i = 0; i < streamCount; i++)
                    {
                        var stream = new PdbStream();
                        streams.Add(stream);

                        var byteCount = brDirectory.ReadInt32();
                        stream.ByteCount = byteCount;

                        var pageCount = CountPages(byteCount);
                        stream.Pages = new int[pageCount];
                    }

                    for (var i = 0; i < streamCount; i++)
                    {
                        for (var j = 0; j < streams[i].Pages.Length; j++)
                        {
                            var page = brDirectory.ReadInt32();
                            streams[i].Pages[j] = page;
                        }
                    }
                }
            }

            return(root);
        }
Exemplo n.º 2
0
        private PdbRoot ReadRoot(PdbStream streamRoot)
        {
            Argument.IsNotNull(() => streamRoot);

            var root = new PdbRoot(streamRoot);
            using (var brDirectory = StreamReader(streamRoot))
            {
                var streamCount = brDirectory.ReadInt32();
                if (streamCount != 0x0131CA0B)
                {
                    var streams = root.Streams;
                    for (var i = 0; i < streamCount; i++)
                    {
                        var stream = new PdbStream();
                        streams.Add(stream);

                        var byteCount = brDirectory.ReadInt32();
                        stream.ByteCount = byteCount;

                        var pageCount = CountPages(byteCount);
                        stream.Pages = new int[pageCount];
                    }

                    for (var i = 0; i < streamCount; i++)
                    {
                        for (var j = 0; j < streams[i].Pages.Length; j++)
                        {
                            var page = brDirectory.ReadInt32();
                            streams[i].Pages[j] = page;
                        }
                    }
                }
            }

            return root;
        }