Fix getSectionHeader()

This commit is contained in:
de4dot 2012-03-24 19:13:58 +01:00
parent b323612508
commit 4e042166b9

View File

@ -114,7 +114,7 @@ namespace de4dot.code.PE {
SectionHeader getSectionHeader(uint rva) {
for (int i = 0; i < sectionHeaders.Length; i++) {
var section = sectionHeaders[i];
if (section.virtualAddress <= rva && rva < section.virtualAddress + section.virtualSize)
if (section.virtualAddress <= rva && rva < section.virtualAddress + Math.Max(section.virtualSize, section.sizeOfRawData))
return section;
}
return null;