def rule(event):
    if all(
        [
            "\\Policies\\{31B2F340-016D-11D2-945F-00C04FB984F9}\\"
            in event.deep_get("TargetFilename", default=""),
            any(
                [
                    event.deep_get("TargetFilename", default="").endswith(".dll"),
                    event.deep_get("TargetFilename", default="").endswith(".exe"),
                ]
            ),
        ]
    ):
        return True
    return False
