示例#1
0
文件: PeFile.cs 项目: IllidanS4/PeNet
        public PeFile(IRawFile peFile)
        {
            RawFile = peFile;

            _nativeStructureParsers = new NativeStructureParsers(RawFile);

            if (ImageNtHeaders?.OptionalHeader?.DataDirectory != null)
            {
                if (ImageSectionHeaders != null)
                {
                    _dataDirectoryParsers = new DataDirectoryParsers(
                        RawFile,
                        ImageNtHeaders.OptionalHeader.DataDirectory,
                        ImageSectionHeaders,
                        Is32Bit
                        );
                }
            }

            _dotNetStructureParsers = new DotNetStructureParsers(
                RawFile,
                ImageComDescriptor,
                ImageSectionHeaders
                );

            _authenticodeParser = new AuthenticodeParser(this);
        }
示例#2
0
        /// <summary>
        ///     Create a new PeFile object.
        /// </summary>
        /// <param name="buff">A PE file a byte array.</param>
        public PeFile(byte[] buff)
        {
            Buff = buff;
            _nativeStructureParsers = new NativeStructureParsers(Buff);

            _dataDirectoryParsers = new DataDirectoryParsers(
                Buff,
                ImageNtHeaders?.OptionalHeader?.DataDirectory,
                ImageSectionHeaders,
                Is32Bit
                );

            _dotNetStructureParsers = new DotNetStructureParsers(
                Buff,
                ImageComDescriptor,
                ImageSectionHeaders
                );
        }
示例#3
0
        /// <summary>
        ///     Create a new PeFile object.
        /// </summary>
        /// <param name="buff">A PE file a byte array.</param>
        public PeFile(byte[] buff) : base(buff, 0)
        {
            _nativeStructureParsers = new NativeStructureParsers(Buff);

            _dataDirectoryParsers = new DataDirectoryParsers(
                Buff,
                ImageNtHeaders?.OptionalHeader?.DataDirectory,
                ImageSectionHeaders,
                Is32Bit
                );

            _dotNetStructureParsers = new DotNetStructureParsers(
                Buff,
                ImageComDescriptor,
                ImageSectionHeaders
                );

            _authenticodeParser = new AuthenticodeParser(this);
        }