Exemple #1
0
		private void SetStreamToStartOfResourceSection(ImageSectionHeader resourceHeader)
		{
			_fileStream.Seek((int)resourceHeader.PointerToRawData, SeekOrigin.Begin);
		}
Exemple #2
0
		private bool TryGetSectionHeaderFromDirectoryEntry(DataDirectoryEntry entry, out ImageSectionHeader retSectionHeader)
		{
			var directoryEntry = OptionalHeader.DataDirectory[(int) entry];

			foreach (var sectionHeader in _sectionHeaders)
			{
				if (sectionHeader.VirtualAddress <= directoryEntry.VirtualAddress &&
					sectionHeader.VirtualAddress + sectionHeader.SizeOfRawData > directoryEntry.VirtualAddress)
				{
					retSectionHeader = sectionHeader;
					return true;
				}
			}

			retSectionHeader = new ImageSectionHeader();
			return false;
		}