def _parseDataDirectoryExport(self, data, dataDirectoryEntry, exportSection):
        """Parses the EmportDataDirectory and returns an instance of ExportDirectoryData"""
        if not exportSection:
            return
        functions = []
        export_directory = IMAGE_EXPORT_DIRECTORY.from_buffer(exportSection.raw, to_offset(dataDirectoryEntry.VirtualAddress, exportSection))
        offset = to_offset(export_directory.Name, exportSection)

        checkOffset(offset, exportSection)
        name = get_str(exportSection.raw, offset)

        offsetOfNames = to_offset(export_directory.AddressOfNames, exportSection)
        offsetOfAddress = to_offset(export_directory.AddressOfFunctions, exportSection)
        offsetOfNameOrdinals = to_offset(export_directory.AddressOfNameOrdinals, exportSection)
        for i in range(export_directory.NumberOfNames):
            name_address = c_uint.from_buffer(exportSection.raw, offsetOfNames).value
            name_offset = to_offset(name_address, exportSection)

            checkOffset(name_offset, exportSection)
            func_name = get_str(exportSection.raw, name_offset)
            ordinal = c_ushort.from_buffer(exportSection.raw, offsetOfNameOrdinals).value
            func_addr = c_uint.from_buffer(exportSection.raw, offsetOfAddress).value

            offsetOfNames += 4
            offsetOfAddress += 4
            offsetOfNameOrdinals += 2
            functions.append(FunctionData(name=func_name, rva=func_addr, ordinal=ordinal))

        return ExportDirectoryData(header=export_directory, name=name, functions=functions)
def _parseDataDirectoryExport ( self , data , dataDirectoryEntry , exportSection ) : if not exportSection : return functions = [ ] export_directory = IMAGE_EXPORT_DIRECTORY . from_buffer ( exportSection . raw , to_offset ( dataDirectoryEntry . VirtualAddress , exportSection ) ) offset = to_offset ( export_directory . Name , exportSection ) checkOffset ( offset , exportSection ) name = get_str ( exportSection . raw , offset ) offsetOfNames = to_offset ( export_directory . AddressOfNames , exportSection ) offsetOfAddress = to_offset ( export_directory . AddressOfFunctions , exportSection ) offsetOfNameOrdinals = to_offset ( export_directory . AddressOfNameOrdinals , exportSection ) for i in range ( export_directory . NumberOfNames ) : name_address = c_uint . from_buffer ( exportSection . raw , offsetOfNames ) . value name_offset = to_offset ( name_address , exportSection ) checkOffset ( name_offset , exportSection ) func_name = get_str ( exportSection . raw , name_offset ) ordinal = c_ushort . from_buffer ( exportSection . raw , offsetOfNameOrdinals ) . value func_addr = c_uint . from_buffer ( exportSection . raw , offsetOfAddress ) . value offsetOfNames += 4 offsetOfAddress += 4 offsetOfNameOrdinals += 2 functions . append ( FunctionData ( name = func_name , rva = func_addr , ordinal = ordinal ) ) return ExportDirectoryData ( header = export_directory , name = name , functions = functions )
Parses the EmportDataDirectory and returns an instance of ExportDirectoryData