def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("Image", default="").endswith("\\reg.exe"),
                    event.deep_get("OriginalFileName", default="") == "reg.exe",
                ]
            ),
            "add" in event.deep_get("CommandLine", default=""),
            any(
                [
                    "\\software\\Microsoft\\Windows\\CurrentVersion\\Run"
                    in event.deep_get("CommandLine", default=""),
                    "\\software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Run"
                    in event.deep_get("CommandLine", default=""),
                    "\\software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run"
                    in event.deep_get("CommandLine", default=""),
                    "\\software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Userinit"
                    in event.deep_get("CommandLine", default=""),
                    "\\software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Shell"
                    in event.deep_get("CommandLine", default=""),
                    "\\software\\Microsoft\\Windows NT\\CurrentVersion\\Windows"
                    in event.deep_get("CommandLine", default=""),
                    "\\system\\CurrentControlSet\\Control\\SafeBoot\\AlternateShell"
                    in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
