def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("Image", default="").endswith("\\KeyScrambler.exe"),
                    event.deep_get("Image", default="").endswith("\\KeyScramblerLogon.exe"),
                ]
            ),
            event.deep_get("ImageLoaded", default="").endswith("\\KeyScramblerIE.dll"),
            not any(
                [
                    all(
                        [
                            any(
                                [
                                    "C:\\Program Files (x86)\\KeyScrambler\\"
                                    in event.deep_get("Image", default=""),
                                    "C:\\Program Files\\KeyScrambler\\"
                                    in event.deep_get("Image", default=""),
                                ]
                            ),
                            any(
                                [
                                    "C:\\Program Files (x86)\\KeyScrambler\\"
                                    in event.deep_get("ImageLoaded", default=""),
                                    "C:\\Program Files\\KeyScrambler\\"
                                    in event.deep_get("ImageLoaded", default=""),
                                ]
                            ),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("Signature", default="") == "QFX Software Corporation",
                            event.deep_get("SignatureStatus", default="") == "Valid",
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
