DeviceProcessEvents | where (FolderPath endswith "\\reg.exe" or ProcessVersionInfoOriginalFileName =~ "reg.exe") and ProcessCommandLine contains "\\SYSTEM\\CurrentControlSet\\Control\\SafeBoot" and (ProcessCommandLine contains " copy " or ProcessCommandLine contains " add ")