import re


def rule(event):
    if all(
        [
            event.deep_get("ImageLoaded", default="").endswith("\\ksproxy.ax"),
            not any(
                [
                    event.deep_get("Image", default="").startswith("C:\\Program Files\\"),
                    event.deep_get("Image", default="").startswith("C:\\Program Files (x86)\\"),
                    event.deep_get("Image", default="").startswith("C:\\Windows\\System32\\"),
                    event.deep_get("Image", default="").startswith("C:\\Windows\\SysWOW64\\"),
                ]
            ),
            not any(
                [
                    event.deep_get("Image", default="").endswith(
                        "\\AppData\\Local\\Microsoft\\Teams\\current\\Teams.exe"
                    ),
                    event.deep_get("Image", default="").endswith(
                        "\\AppData\\Roaming\\Zoom\\bin\\Zoom.exe"
                    ),
                    event.deep_get("Image", default="").endswith(
                        "\\AppData\\Local\\Mozilla Firefox\\firefox.exe"
                    ),
                    event.deep_get("Image", default="").endswith(
                        "\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe"
                    ),
                    event.deep_get("Image", default="").endswith(
                        "\\AppData\\Local\\Programs\\Opera\\opera.exe"
                    ),
                    re.match(
                        r"^.*\\AppData\\Local\\Discord\\app-.*\\Discord.exe$",
                        event.deep_get("Image", default=""),
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
