Beispiel #1
0
        public PortableExecutableInfo(string path)
        {
            this.imagePath = path;

            using(Stream stream = OpenImage())
            {
                using (BinaryParser br = new BinaryParser(stream))
                {
                    dosHeader = DosHeader.Parse(br);

                    br.SkipTo(dosHeader.CoffHeaderOffset);

                    coffHeader = br.ReadRecord<CoffHeader>();
                    peHeader = PEHeader.Parse(br);

                    sections = new List<PESection>();
                    for (int i = 0; i < coffHeader.NumberOfSections; i++)
                    {
                        sections.Add(br.ReadRecord<PESection>());
                    }
                }
            }
        }
Beispiel #2
0
        public PortableExecutableInfo(string path)
        {
            this.imagePath = path;

            using (Stream stream = OpenImage())
            {
                using (BinaryParser br = new BinaryParser(stream))
                {
                    dosHeader = DosHeader.Parse(br);

                    br.SkipTo(dosHeader.CoffHeaderOffset);

                    coffHeader = br.ReadRecord <CoffHeader>();
                    peHeader   = PEHeader.Parse(br);

                    sections = new List <PESection>();
                    for (int i = 0; i < coffHeader.NumberOfSections; i++)
                    {
                        sections.Add(br.ReadRecord <PESection>());
                    }
                }
            }
        }