def METHOD_NAME(
    cls,
    context: interfaces.context.ContextInterface,
    layer_name: str,
    elf_table_name: str,
    vma: interfaces.objects.ObjectInterface,
    task: interfaces.objects.ObjectInterface,
    open_method: Type[interfaces.plugins.FileHandlerInterface],
) -> Optional[interfaces.plugins.FileHandlerInterface]:
    """Extracts an ELF as a FileHandlerInterface
    Args:
        context: the context to operate upon
        layer_name: The name of the layer on which to operate
        elf_table_name: the name for the symbol table containing the symbols for ELF-files
        vma: virtual memory allocation of ELF
        task: the task object whose memory should be output
        open_method: class to provide context manager for opening the file
    Returns:
        An open FileHandlerInterface object containing the complete data for the task or None in the case of failure
    """
    proc_layer = context.layers[layer_name]
    file_handle = None
    elf_object = context.object(
        elf_table_name + constants.BANG + "Elf",
        offset=vma.vm_start,
        layer_name=layer_name,
    )
    if not elf_object.is_valid():
        return None
    sections = {}
    # TODO: Apply more effort to reconstruct ELF, e.g.: https://github.com/enbarberis/core2ELF64 ?
    for phdr in elf_object.get_program_headers():
        if phdr.p_type != 1:  # PT_LOAD = 1
            continue
        start = phdr.p_vaddr
        size = phdr.p_memsz
        end = start + size
        # Use complete memory pages for dumping
        # If start isn't a multiple of 4096, stick to the highest multiple < start
        # If end isn't a multiple of 4096, stick to the lowest multiple > end
        if start % 4096:
            start = start & ~0xFFF
        if end % 4096:
            end = (end & ~0xFFF) + 4096
        real_size = end - start
        # Check if ELF has a legitimate size
        if real_size < 0 or real_size > constants.linux.ELF_MAX_EXTRACTION_SIZE:
            raise ValueError(f"The claimed size of the ELF is invalid: {real_size}")
        sections[start] = real_size
    elf_data = b""
    for section_start in sorted(sections.keys()):
        read_size = sections[section_start]
        buf = proc_layer.read(vma.vm_start + section_start, read_size, pad=True)
        elf_data = elf_data + buf
    file_handle = open_method(
        f"pid.{task.pid}.{utility.array_to_string(task.comm)}.{vma.vm_start:#x}.dmp"
    )
    file_handle.write(elf_data)
    return file_handle