/// <summary>
        /// Initializes a new PEInfo using the given data
        /// </summary>
        /// <param name="data">Byte-array containing the content of the module to parse</param>
        public PEInfo(byte[] data)
        {
            MemUtils memUtils = new ExternalUtilsCSharp.MemUtils();
            DOSHeader = memUtils.BytesToT<DOSHeader>(data);

            COFFHeaderAddress = DOSHeader.e_lfanew + 4;
            COFFHeader = memUtils.BytesToT<COFFHeader>(data, COFFHeaderAddress);

            PEOptHeaderAddress = COFFHeaderAddress + Marshal.SizeOf(typeof(COFFHeader));
            PEOptHeader = memUtils.BytesToT<PEOptHeader>(data, PEOptHeaderAddress);
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new PEInfo using the given data
        /// </summary>
        /// <param name="data">Byte-array containing the content of the module to parse</param>
        public PEInfo(byte[] data)
        {
            MemUtils memUtils = new ExternalUtilsCSharp.MemUtils();

            DOSHeader = memUtils.BytesToT <DOSHeader>(data);

            COFFHeaderAddress = DOSHeader.e_lfanew + 4;
            COFFHeader        = memUtils.BytesToT <COFFHeader>(data, COFFHeaderAddress);

            PEOptHeaderAddress = COFFHeaderAddress + Marshal.SizeOf(typeof(COFFHeader));
            PEOptHeader        = memUtils.BytesToT <PEOptHeader>(data, PEOptHeaderAddress);
        }