From c5fde9c7998cc65dc09cab13911881052c3b3984 Mon Sep 17 00:00:00 2001 From: Lloyd Kinsella Date: Mon, 13 Jun 2016 22:08:26 +0100 Subject: [PATCH] Return blank section name for Certificate Table, it doesn't fall within a section. --- Src/Workshell.PE/DataDirectory.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/Workshell.PE/DataDirectory.cs b/Src/Workshell.PE/DataDirectory.cs index c69ab83..5017355 100644 --- a/Src/Workshell.PE/DataDirectory.cs +++ b/Src/Workshell.PE/DataDirectory.cs @@ -129,12 +129,12 @@ public DataDirectoryContent GetContent() private string GetSectionName() { - if (data_dir.VirtualAddress == 0) + if (data_dir.VirtualAddress == 0 || dir_type == DataDirectoryType.CertificateTable) return String.Empty; foreach(SectionTableEntry entry in dirs.Reader.SectionTable) { - if (data_dir.VirtualAddress >= entry.VirtualAddress && data_dir.VirtualAddress <= (entry.VirtualAddress + entry.SizeOfRawData)) + if (data_dir.VirtualAddress >= entry.VirtualAddress && data_dir.VirtualAddress < (entry.VirtualAddress + entry.SizeOfRawData)) return entry.Name; }