docs: def parse_import_directory(self, rva, size):
          """Walk and parse the import directory."""
          
          import_descs =  []
          while True:
              try:
                  # If the RVA is invalid all would blow up. Some EXEs seem to be
                  # specially nasty and have an invalid RVA.
                  data = self.get_data(rva, Structure(self.__IMAGE_IMPORT_DESCRIPTOR_format__).sizeof() )
              except PEFormatError, e:
                  self.__warnings.append(
                      'Error parsing the import directory at RVA: 0x%x' % ( rva ) )
                  break
              
              import_desc =  self.__unpack_data__(
                  self.__IMAGE_IMPORT_DESCRIPTOR_format__,
                  data, file_offset = self.get_offset_from_rva(rva) )
              
              # If the structure is all zeroes, we reached the end of the list
              if not import_desc or import_desc.all_zeroes():
                  break
              
              rva += import_desc.sizeof()
              
              try:
                  import_data =  self.parse_imports(
                      import_desc.OriginalFirstThunk,
                      import_desc.FirstThunk,
                      import_desc.ForwarderChain)
              except PEFormatError, excp:
                  self.__warnings.append(
                      'Error parsing the import directory. ' +
                      'Invalid Import data at RVA: 0x%x (%s)' % ( rva, str(excp) ) )
                  break
                  #raise excp
              
              if not import_data:
                  continue
              
              dll = self.get_string_at_rva(import_desc.Name)
              if not is_valid_dos_filename(dll):
                  dll = '*invalid*'
                  
              if dll:
                  import_descs.append(
                      ImportDescData(
                          struct = import_desc,
                          imports = import_data,
                          dll = dll))
          
          suspicious_imports = set([ 'LoadLibrary', 'GetProcAddress' ])
          suspicious_imports_count = 0
          total_symbols = 0
          for imp_dll in import_descs:
              for symbol in imp_dll.imports:
                  for suspicious_symbol in suspicious_imports:
                      if symbol and symbol.name and symbol.name.startswith( suspicious_symbol ):
                          suspicious_imports_count += 1
                          break
                  total_symbols += 1
          if suspicious_imports_count == len(suspicious_imports) and total_symbols < 20:
              self.__warnings.append(
                  'Imported symbols contain entries typical of packed executables.' )
              
              
          
          return import_descs