Exemplo n.º 1
0
        internal ResourceDataEntry(DataDirectory dataDirectory, Location dataLocation, ResourceDirectoryEntry directoryEntry)
            : base(dataDirectory,dataLocation)
        {
            Stream stream = directoryEntry.Directory.DataDirectory.Directories.Image.GetStream();

            stream.Seek(dataLocation.FileOffset.ToInt64(),SeekOrigin.Begin);

            directory_entry = directoryEntry;
            entry = Utils.Read<IMAGE_RESOURCE_DATA_ENTRY>(stream);
            data = GetData();
        }
Exemplo n.º 2
0
        internal ResourceDataEntry(PortableExecutableImage image, DataDirectory dataDirectory, Location location, ResourceDirectoryEntry directoryEntry) : base(image, dataDirectory, location)
        {
            _data = null;

            DirectoryEntry = directoryEntry;
        }
Exemplo n.º 3
0
        public ResourceData GetData()
        {
            if (data == null)
            {
                LocationCalculator calc = DataDirectory.Directories.Image.GetCalculator();
                uint rva = entry.OffsetToData;
                ulong va = DataDirectory.Directories.Image.NTHeaders.OptionalHeader.ImageBase + rva;
                ulong file_offset = calc.VAToOffset(va);
                ulong size = entry.Size;
                Section section = calc.RVAToSection(rva);
                Location location = new Location(file_offset, rva, va, size, size, section);

                data = new ResourceData(DataDirectory, location, this);
            }

            return data;
        }