Esempio n. 1
0
        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);
        }
Esempio n. 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
                );
        }
Esempio n. 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);
        }