From cb87404c775c69e9d2e92fdf27641db9a5eaa1b1 Mon Sep 17 00:00:00 2001 From: prettyroseslover Date: Thu, 28 Nov 2024 21:33:53 +0300 Subject: [PATCH] change section table real name handling --- src/pe/section_table.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pe/section_table.rs b/src/pe/section_table.rs index f49c2b689..7e177e770 100644 --- a/src/pe/section_table.rs +++ b/src/pe/section_table.rs @@ -76,7 +76,9 @@ impl SectionTable { table.characteristics = bytes.gread_with(offset, scroll::LE)?; if let Some(idx) = table.name_offset()? { - table.real_name = Some(bytes.pread::<&str>(string_table_offset + idx)?.to_string()); + if let Ok(real_name) = bytes.pread::<&str>(string_table_offset + idx) { + table.real_name = Some(real_name.to_string()); + } } Ok(table) }