0
mirror of https://github.com/sampletext32/ParkanPlayground.git synced 2025-06-20 00:18:02 +03:00

Move section code checking logic from SectionHeaderParser to SectionHeader class

This commit is contained in:
bird_egop
2025-04-12 17:20:51 +03:00
parent f1a2fca4f3
commit e4adb45ed2
3 changed files with 45 additions and 16 deletions

View File

@ -34,19 +34,5 @@ namespace X86Disassembler.PE.Parsers
return header;
}
/// <summary>
/// Checks if a section contains code
/// </summary>
/// <param name="section">The section to check</param>
/// <returns>True if the section contains code, false otherwise</returns>
public bool IsSectionContainsCode(SectionHeader section)
{
const uint IMAGE_SCN_CNT_CODE = 0x00000020; // Section contains code
const uint IMAGE_SCN_MEM_EXECUTE = 0x20000000; // Section is executable
return (section.Characteristics & IMAGE_SCN_CNT_CODE) != 0 ||
(section.Characteristics & IMAGE_SCN_MEM_EXECUTE) != 0;
}
}
}