docs: def parse_imports(self, original_first_thunk, first_thunk, forwarder_chain):
          """Parse the imported symbols.
          
          It will fill a list, which will be available as the dictionary
          attribute "imports". Its keys will be the DLL names and the values
          all the symbols imported from that object.
          """
          
          imported_symbols = []
          
          # The following has been commented as a PE does not
          # need to have the import data necessarily witin
          # a section, it can keep it in gaps between sections
          # or overlapping other data.
          #
          #imports_section = self.get_section_by_rva(first_thunk)
          #if not imports_section:
          #    raise PEFormatError, 'Invalid/corrupt imports.'
          
          # Import Lookup Table. Contains ordinals or pointers to strings.
          ilt = self.get_import_table(original_first_thunk)
          # Import Address Table. May have identical content to ILT if
          # PE file is not bounded, Will contain the address of the
          # imported symbols once the binary is loaded or if it is already
          # bound.
          iat = self.get_import_table(first_thunk)
  
          # OC Patch:
          # Would crash if IAT or ILT had None type
          if (not iat or len(iat)==0) and (not ilt or len(ilt)==0):
              raise PEFormatError(
                  'Invalid Import Table information. ' +
                  'Both ILT and IAT appear to be broken.')
          
          table = None
          if ilt:
              table = ilt
          elif iat:
              table = iat
          else:
              return None
          
          if self.PE_TYPE == OPTIONAL_HEADER_MAGIC_PE:
              ordinal_flag = IMAGE_ORDINAL_FLAG
          elif self.PE_TYPE == OPTIONAL_HEADER_MAGIC_PE_PLUS:
              ordinal_flag = IMAGE_ORDINAL_FLAG64
          
          for idx in xrange(len(table)):
              
              imp_ord = None
              imp_hint = None
              imp_name = None
              name_offset = None
              hint_name_table_rva = None
              
              if table[idx].AddressOfData:
                  
                  # If imported by ordinal, we will append the ordinal number
                  #
                  if table[idx].AddressOfData & ordinal_flag:
                      import_by_ordinal = True
                      imp_ord = table[idx].AddressOfData & 0xffff
                      imp_name = None
                      name_offset = None
                  else:
                      import_by_ordinal = False
                      try:
                          hint_name_table_rva = table[idx].AddressOfData & 0x7fffffff
                          data = self.get_data(hint_name_table_rva, 2)
                          # Get the Hint
                          imp_hint = self.get_word_from_data(data, 0)
                          imp_name = self.get_string_at_rva(table[idx].AddressOfData+2)
                          if not is_valid_function_name(imp_name):
                              imp_name = '*invalid*'
                          
                          name_offset = self.get_offset_from_rva(table[idx].AddressOfData+2)
                      except PEFormatError, e:
                          pass
  
                  # by nriva: we want the ThunkRVA and ThunkOffset
                  thunk_offset = table[idx].get_file_offset()
                  thunk_rva = self.get_rva_from_offset(thunk_offset)
                  
              imp_address = first_thunk + self.OPTIONAL_HEADER.ImageBase + idx * 4
              
              struct_iat = None
              try:
                  
                  if iat and ilt and ilt[idx].AddressOfData != iat[idx].AddressOfData:
                      imp_bound = iat[idx].AddressOfData
                      struct_iat = iat[idx]
                  else:
                      imp_bound = None
              except IndexError:
                  imp_bound = None
              
              # The file with hashes:
              #
              # MD5: bfe97192e8107d52dd7b4010d12b2924
              # SHA256: 3d22f8b001423cb460811ab4f4789f277b35838d45c62ec0454c877e7c82c7f5
              #
              # has an invalid table built in a way that it's parseable but contains invalid
              # entries that lead pefile to take extremely long amounts of time to
              # parse. It also leads to extreme memory consumption.
              # To prevent similar cases, if invalid entries are found in the middle of a
              # table the parsing will be aborted
              #
              if imp_ord == None and imp_name == None:
                  raise PEFormatError( 'Invalid entries in the Import Table. Aborting parsing.' )
              
              if imp_name != '' and (imp_ord or imp_name):
                  imported_symbols.append(
                      ImportData(
                      pe = self,
                          struct_table = table[idx],
                          struct_iat = struct_iat, # for bound imports if any
                          import_by_ordinal = import_by_ordinal,
                          ordinal = imp_ord,
                          ordinal_offset = table[idx].get_file_offset(),
                          hint = imp_hint,
                          name = imp_name,
                          name_offset = name_offset,
                          bound = imp_bound,
                          address = imp_address,
                          hint_name_table_rva = hint_name_table_rva,
                          thunk_offset = thunk_offset,
                          thunk_rva = thunk_rva ))
          
          return imported_symbols