不间断的Windows进程

发布于 2024-08-25 02:19:51 字数 385 浏览 5 评论 0原文

我们现在正在从客户那里启动一个新的自定义项目,其中一个要求是除非系统关闭、重新启动或注销,否则该过程无法终止。

该应用程序监视 USB 接口。我们将使用 WMI 定期查询设备。

客户希望在 Windows XP 操作系统上运行该应用程序,但不喜欢安装 .NET。因此我们将 Visual Basic 6 作为我们的语言。

我主要担心的是这个应用程序无法终止。我们的项目顾问谈论防病毒,是的,某些防病毒无法终止。我在想如何在 Visual Basic 6 中做同样的事情。我知道该项目会涉及 API,但我应该去哪里?所以API对我来说没问题。

我看到一些文章将 EXE 转换为服务、在 V​​isual Basic 6 中创建 Windows 服务等。

所以请..分享您的想法。

We're starting a new custom project right now from a client and one of the requirements is the process cannot be terminated unless the system is shutting down, restarting, or logging-off.

This application monitors the USB interface. We will be using WMI to query the device periodically.

The client want's to run the application on Windows XP Operating System and doesn't like installing .NET. So we targeted Visual Basic 6 as our language.

My main concern is this application cannot be terminated. Our Project Adviser talks about Anti-virus and yes, some of the anti virus cannot be terminated. I was thinking how to do the same in Visual Basic 6. I know there will be API involved on the project but where should I go? so API is ok with me.

I saw some articles that converts the EXE to a SERVICE, create Windows Service in Visual Basic 6, etc.

So please .. share your thoughts.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

治碍 2024-09-01 02:19:51

如果你想作恶,你可以调用(官方)未记录的 RtlSetProcessIsCritical NTDLL 函数。如果您的进程终止,这将立即使计算机出现 BSOD。

If you want to be evil, you can call the (officially) undocumented RtlSetProcessIsCritical NTDLL function. This will immediately BSOD the machine if your process is terminated.

不及他 2024-09-01 02:19:51

如果没有某种内核模式挂钩(涉及编写驱动程序),您就无法创建无法终止的进程。如果您对此感兴趣,您可能想研究一下Rootkit:颠覆 Windows 内核。然而,即使使用内核模式挂钩,仍然有许多方法可以终止进程。另一种方法是使用用户模式挂钩,很容易绕过,但对于非常简单的项目来说已经足够了。

您要使用的解决方案取决于您希望终止保护的程度。即使您确实成功阻止了进程终止,也可能有一些方法会阻止您的应用程序正常工作 - 例如终止 WMI 服务。

You cannot create a process that cannot be terminated without some sort of kernel-mode hooking, which involves writing a driver. You might want to look into Rootkits: subverting the Windows kernel if you're interested in that. However, even with kernel-mode hooking there are still numerous ways to terminate processes. The alternative is to use user-mode hooking, easily bypassed but enough for very simple projects.

The solution you want to use will depend on how far you want to go with the termination protection. And even if you do succeed in preventing process termination, there may be ways of preventing your application from working properly - e.g. killing the WMI service.

现在用 VB6 编码真的很令人沮丧,特别是我在 C# 中投入了 2 年,尽管我用 VB6 编码了 5 年。

向后移动是一种痛苦,就好像我正在开始一种新的编程语言一样。

It's really frustrating coding in VB6 right now specially I dumped my head in C# for 2 years though I coded in VB6 for 5 years..

Moving back is a pain as if I am starting a new programming language.

瀞厅☆埖开 2024-09-01 02:19:51

老实说,您正在尝试用 VB6 做一些 VB6 确实不太擅长的事情。
当您说“无法终止”时,您的意思是什么?那里有几个层次:
a) 应用程序显示一个窗口,但用户无法使用 X 按钮关闭它,或者它不显示窗口
b) 应用程序不显示窗口或可能位于任务托盘中
c) 应用程序不显示窗口,并且无法从任务管理器的“应用程序”选项卡关闭
d) 无法从任务管理器的进程列表中关闭应用程序

(a) 和 (b) 可能最容易在直接 VB 中完成。 (c)仍然是可能的,但变得更难看。 (d) 让你进入黑客领域,如果你真的成功了,几乎肯定会被人反对。

如果您确实需要阻止用户关闭,那么您可能可以或多或少地对其进行破解,但真正的答案是正如其他人所说的那样 - 系统服务(这正是他们的目的)。然而,这是 VB6 不擅长的一件事,因此解决您的问题的最佳解决方案是 c#。

To be honest, you are trying to do something in VB6 that it really isn't that great at.
When you say 'cannot be terminated' - what do you mean by that? There are several levels there:
a) App shows a window but the user cannot close it with the X button, or it does not show one
b) App shows no windows or maybe sits in task tray
c) App shows no windows and cannot be shut down from the Applications tab of task manager
d) App cannot be shut down from the process list of task manager

(a) and (b) are probably easiest to do in straight VB. (c) is still possible, but getting uglier. (d) gets you into hack territory and would almost certainly be frownd upon if you did manage it.

If you really need to stop users closing then you can probably hack it to a greater or lesser degree, but the real answer is as the others have said - a system service (this is exactly the srt of thing they were intended for). However that is one thing that VB6 isn't good at so the best solution to your problem is c#.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文