public bool IsMalware(byte[] payload, string contentName) { var returnValue = Amsi.AmsiScanBuffer(_handle, payload, (uint)payload.Length, contentName, s_defaultSession, out var result); if (returnValue != 0) { throw new Win32Exception(returnValue); } return(Amsi.AmsiResultIsMalware(result)); }
public bool IsMalware(string payload, string contentName) { var returnValue = Amsi.AmsiScanString(_handle, payload, contentName, s_defaultSession, out var result); if (returnValue != 0) { throw new Win32Exception(returnValue); } return(Amsi.AmsiResultIsMalware(result)); }