public DataDirectoryEntry(PEHeaders headers, string name, DirectoryEntry entry) : this(name, entry.RelativeVirtualAddress, entry.Size, (headers.GetContainingSectionIndex(entry.RelativeVirtualAddress) >= 0) ? headers.SectionHeaders[headers.GetContainingSectionIndex(entry.RelativeVirtualAddress)].Name : "") { }
private protected int RvaToOffset(int rva) { var sectionHeader = _headers.SectionHeaders[_headers.GetContainingSectionIndex(rva)]; return(rva - sectionHeader.VirtualAddress + sectionHeader.PointerToRawData); }