def rule(event):
    if all(
        [
            event.deep_get("Image", default="").endswith("\\cmstp.exe"),
            any(
                [
                    "\\PerfLogs\\" in event.deep_get("ImageLoaded", default=""),
                    "\\ProgramData\\" in event.deep_get("ImageLoaded", default=""),
                    "\\Users\\" in event.deep_get("ImageLoaded", default=""),
                    "\\Windows\\Temp\\" in event.deep_get("ImageLoaded", default=""),
                    "C:\\Temp\\" in event.deep_get("ImageLoaded", default=""),
                ]
            ),
            any(
                [
                    event.deep_get("ImageLoaded", default="").endswith(".dll"),
                    event.deep_get("ImageLoaded", default="").endswith(".ocx"),
                ]
            ),
        ]
    ):
        return True
    return False
