diff --git a/pefile.py b/pefile.py index c03c356..36d352d 100644 --- a/pefile.py +++ b/pefile.py @@ -3120,7 +3120,7 @@ def __parse__(self, fname, data, fast_load): if not self.FILE_HEADER: raise PEFormatError("File Header missing") - # Set the image's flags according the the Characteristics member + # Set the image's flags according to the Characteristics member set_flags(self.FILE_HEADER, self.FILE_HEADER.Characteristics, image_flags) optional_header_offset = nt_headers_offset + 4 + self.FILE_HEADER.sizeof() @@ -3232,7 +3232,7 @@ def __parse__(self, fname, data, fast_load): DLL_CHARACTERISTICS, "IMAGE_DLLCHARACTERISTICS_" ) - # Set the Dll Characteristics flags according the the DllCharacteristics member + # Set the Dll Characteristics flags according to the DllCharacteristics member set_flags( self.OPTIONAL_HEADER, self.OPTIONAL_HEADER.DllCharacteristics, @@ -3640,7 +3640,7 @@ def parse_sections(self, offset): section_flags = retrieve_flags(SECTION_CHARACTERISTICS, "IMAGE_SCN_") - # Set the section's flags according the the Characteristics member + # Set the section's flags according to the Characteristics member set_flags(section, section.Characteristics, section_flags) if section.__dict__.get( @@ -5458,7 +5458,7 @@ def length_until_eof(rva): # If the function's RVA points within the export directory # it will point to a string with the forwarded symbol's string - # instead of pointing the the function start address. + # instead of pointing to the function start address. if symbol_address >= rva and symbol_address < rva + size: forwarder_str = self.get_string_at_rva(symbol_address) try: @@ -6304,7 +6304,7 @@ def get_memory_mapped_image(self, max_virtual_address=0x10000000, ImageBase=None return mapped_data def get_resources_strings(self): - """Returns a list of all the strings found withing the resources (if any). + """Returns a list of all the strings found within the resources (if any). This method will scan all entries in the resources directory of the PE, if there is one, and will return a [] with the strings. diff --git a/peutils.py b/peutils.py index 3bf2169..08e9a5b 100644 --- a/peutils.py +++ b/peutils.py @@ -17,7 +17,7 @@ __contact__ = "ero.carrera@gmail.com" -class SignatureDatabase(object): +class SignatureDatabase: """This class loads and keeps a parsed PEiD signature database. Usage: @@ -397,7 +397,7 @@ def __load(self, filename=None, data=None): sig_f = urllib.request.urlopen(filename) sig_data = sig_f.read() sig_f.close() - except IOError: + except OSError: # Let this be raised back to the user... raise else: @@ -407,7 +407,7 @@ def __load(self, filename=None, data=None): sig_f = open(filename, "rt") sig_data = sig_f.read() sig_f.close() - except IOError: + except OSError: # Let this be raised back to the user... raise else: