From 4e042166b9bb88eff175aacd3bdd3a146a35ebcd Mon Sep 17 00:00:00 2001 From: de4dot Date: Sat, 24 Mar 2012 19:13:58 +0100 Subject: [PATCH] Fix getSectionHeader() --- de4dot.code/PE/PeImage.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/de4dot.code/PE/PeImage.cs b/de4dot.code/PE/PeImage.cs index b9a880af..eb9a639a 100644 --- a/de4dot.code/PE/PeImage.cs +++ b/de4dot.code/PE/PeImage.cs @@ -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;