def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("ImageLoaded", default="").endswith("\\libwazuhshared.dll"),
                    event.deep_get("ImageLoaded", default="").endswith("\\libwinpthread-1.dll"),
                ]
            ),
            not any(
                [
                    event.deep_get("ImageLoaded", default="").startswith("C:\\Program Files\\"),
                    event.deep_get("ImageLoaded", default="").startswith(
                        "C:\\Program Files (x86)\\"
                    ),
                ]
            ),
            not all(
                [
                    any(
                        [
                            "\\AppData\\Local\\" in event.deep_get("ImageLoaded", default=""),
                            "\\ProgramData\\" in event.deep_get("ImageLoaded", default=""),
                        ]
                    ),
                    event.deep_get("ImageLoaded", default="").endswith(
                        "\\mingw64\\bin\\libwinpthread-1.dll"
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
