def rule(event):
    if all(
        [
            event.deep_get("TargetFilename", default="").endswith(".dll"),
            not any(
                [
                    event.deep_get("SourceFilename", default="").endswith(".dll"),
                    event.deep_get("SourceFilename", default="").endswith(".tmp"),
                    event.deep_get("SourceFilename", default="") == "",
                    event.deep_get("SourceFilename", default="") == "",
                    all(
                        [
                            ":\\Windows\\WinSxS\\" in event.deep_get("Image", default=""),
                            event.deep_get("Image", default="").endswith("\\TiWorker.exe"),
                        ]
                    ),
                    any(
                        [
                            event.deep_get("Image", default="").endswith(
                                ":\\Windows\\System32\\wuauclt.exe"
                            ),
                            ":\\$WINDOWS.~BT\\Sources\\"
                            in event.deep_get("TargetFilename", default=""),
                        ]
                    ),
                    any(
                        [
                            ":\\Program Files (x86)\\" in event.deep_get("Image", default=""),
                            ":\\Program Files\\" in event.deep_get("Image", default=""),
                        ]
                    ),
                ]
            ),
            not "\\SquirrelTemp\\temp" in event.deep_get("SourceFilename", default=""),
        ]
    ):
        return True
    return False
