def _parseDirectories(self, dataDirectoryInstance, magic = consts.PE32):
        """
        Parses all the directories in the L{PE} instance.
        
        @type dataDirectoryInstance: L{DataDirectory}
        @param dataDirectoryInstance: A L{DataDirectory} object with the directories data.
        
        @type magic: int
        @param magic: (Optional) The type of PE. This value could be L{consts.PE32} or L{consts.PE64}.
        """
        directories = [(consts.EXPORT_DIRECTORY, self._parseExportDirectory),\
                         (consts.IMPORT_DIRECTORY, self._parseImportDirectory),\
                         (consts.RESOURCE_DIRECTORY, self._parseResourceDirectory),\
                         (consts.EXCEPTION_DIRECTORY, self._parseExceptionDirectory),\
                         (consts.RELOCATION_DIRECTORY, self._parseRelocsDirectory),\
                         (consts.TLS_DIRECTORY, self._parseTlsDirectory),\
                         (consts.DEBUG_DIRECTORY, self._parseDebugDirectory),\
                         (consts.BOUND_IMPORT_DIRECTORY, self._parseBoundImportDirectory),\
                         (consts.DELAY_IMPORT_DIRECTORY, self._parseDelayImportDirectory),\
                         (consts.CONFIGURATION_DIRECTORY, self._parseLoadConfigDirectory),\
                         (consts.NET_METADATA_DIRECTORY, self._parseNetDirectory)]
        
        for directory in directories:
            dir = dataDirectoryInstance[directory[0]]
            if dir.rva.value and dir.size.value:
                try:
                    dataDirectoryInstance[directory[0]].info = directory[1](dir.rva.value, dir.size.value, magic)
                except Exception as e:
                    print excep.PEWarning("Error parsing PE directory: %s." % directory[1].__name__.replace("_parse", ""))
Parses all the directories in the L{PE} instance.
        
        @type dataDirectoryInstance: L{DataDirectory}
        @param dataDirectoryInstance: A L{DataDirectory} object with the directories data.
        
        @type magic: int
        @param magic: (Optional) The type of PE. This value could be L{consts.PE32} or L{consts.PE64}.