November 2019
Intermediate to advanced
346 pages
9h 36m
English
In the following steps, we will collect notable portions of the PE header:
import pefilefrom os import listdirfrom os.path import isfile, joindirectories = ["Benign PE Samples", "Malicious PE Samples"]
def get_section_names(pe): """Gets a list of section names from a PE file.""" list_of_section_names = [] for sec in pe.sections: normalized_name = sec.Name.decode().replace("\x00", "").lower() list_of_section_names.append(normalized_name) return list_of_section_names