def METHOD_NAME(seven_zip_path, archive_path, extract_path, password="infected"):
    """Extracts a nested archive file.
    @param seven_zip_path: path to 7z binary
    @param archive_path: archive path
    @param extract_path: where to extract
    @param password: archive password
    """
    log.debug([seven_zip_path, "x", "-p", "-y", f"-o{extract_path}", archive_path])
    p = subprocess.run(
        [seven_zip_path, "x", "-p", "-y", f"-o{extract_path}", archive_path],
        stdin=subprocess.DEVNULL,
        stderr=subprocess.PIPE,
        stdout=subprocess.PIPE,
    )
    stdoutput, stderr = p.stdout, p.stderr
    log.debug(f"{p.stdout} {p.stderr}")
    if b"Wrong password" in stderr:
        if not Path(extract_path).match("local\\temp"):
            shutil.rmtree(extract_path, ignore_errors=True)
        log.debug([seven_zip_path, "x", f"-p{password}", "-y", f"-o{extract_path}", archive_path])
        p = subprocess.run(
            [seven_zip_path, "x", f"-p{password}", "-y", f"-o{extract_path}", archive_path],
            stdin=subprocess.DEVNULL,
            stderr=subprocess.PIPE,
            stdout=subprocess.PIPE,
        )
        stdoutput, stderr = p.stdout, p.stderr
        log.debug(f"{p.stdout} {p.stderr}")
        if b"Wrong password" in stderr:
            raise Exception("Wrong password provided")
    elif b"Can not open the file as archive" in stdoutput:
        raise TypeError("Unable to open the file as archive")