【问题标题】:Why does Kaspersky anti-virus prevent my program from capturing the output of its child process?为什么卡巴斯基反病毒软件会阻止我的程序捕获其子进程的输出?
【发布时间】:2018-10-23 15:53:18
【问题描述】:

我有一个 C# 程序,它启动一个子进程并将其输出捕获到一个字符串中。这适用于大多数 Windows 机器(Windows 7 和更新版本),但当存在卡巴斯基反病毒软件时,Process.StandardOutput.ReadToEnd() 返回null。没有错误代码或异常。子进程是受信任的控制台应用程序。该过程需要 5 或 6 秒才能运行。

启动子进程的代码如下:

ProcessStartInfo psi = new ProcessStartInfo();
psi.UseShellExecute = false;
psi.CreateNoWindow = true;
psi.RedirectStandardOutput = true;
psi.RedirectStandardError = true;
psi.WindowStyle = ProcessWindowStyle.Hidden;
psi.FileName = "icao.exe";
psi.Arguments = im_path + "image.jpg";

Process p = new Process();
p.StartInfo = psi;

p.Start();

string output = p.StandardOutput.ReadToEnd();
string error = p.StandardError.ReadToEnd();

MessageBox.Show(error);

p.WaitForExit();
int exitCode = p.ExitCode; 

MessageBox.Show(exitCode+"");

当卡巴斯基在场时,为什么output 最终会变成null

【问题讨论】:

  • 你为什么把它标记为 C++?
  • 因为c#程序执行dlib c++例子
  • 您的问题有点难以理解。你是说当这个程序在安装了卡巴斯基的系统上运行时输出和/或错误为空?
  • 是的。我检查了这两个程序,没有病毒迹象。
  • 从 AV 中排除可执行文件,它可以工作吗?

标签: c# windows


【解决方案1】:

我的猜测是卡巴斯基的启发式方法是看到您的程序想要执行另一个 exe。因为没有任何东西告诉卡巴斯基这没问题,它会将您的程序标记为可能的恶意软件,因为它希望与其他公司开发的其他程序进行交互。如果可以的话,我会尝试使用卡巴斯基将您的程序列入白名单,看看是否能解决您的问题。

【讨论】:

  • 外部 exe 代码 - dlib.net/face_landmark_detection_ex.cpp.html
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-05-01
  • 1970-01-01
  • 2021-05-24
相关资源
最近更新 更多