为什么探查器需要管理权限(在 Windows 上)
我一直在评估 Windows 上本机 C++ 程序的探查器和内存检查工具,并且所有这些工具都希望以管理员权限安装和运行。 我很少以管理员身份登录我的机器。 如果我需要安装某些东西或执行需要管理权限的操作,我会使用 runas,它效果很好。
探查器需要管理员权限是否合法,或者探查器开发人员只是懒惰? 我以此为基础拒绝所有这些工具是否不合理?
我正在 XP Pro 机器上使用 VS 2005 进行开发。
I've been evaluating profilers and memory checking tools for native C++ programs on Windows and all of them want to be installed and run with administrator privileges. I rarely log in as admin on my machine. If I need to install something or do something that requires administrative privileges, I use runas and it works pretty well.
Is it legitimate for a profiler to require admin privileges, or are the profiler developers just being lazy? Am I being unreasonable by rejecting all of these tools on this basis?
I'm developing with VS 2005 on an XP Pro machine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
因为他们必须查看其他进程的内存,这通常是禁忌。
Because they have to look at other process' memory, which is normally taboo.
一些 cpu 分析器实际上使用操作系统中断进行统计平均...显然,如果没有特权,他们就无法做到这一点:)
some cpu profilers actually do a statistic averaging using OS interrupts... obviously they cannot do this without privileges for that :)
我一直在阅读这篇文章,我慢慢得出结论,类似分析器的工具一般不需要管理访问权限,但声明您需要它是工具制造商避免与不足相关的所有问题的简单方法特权。
所以,我猜他们很懒但也有点务实。
如果我错了,请纠正我(我不是 Windows 安全模型方面的专家),但我相信处理这种情况的一种方法是仅在安装时需要管理员权限。 然后创建一个 ProfilerUsers 用户组并向该组授予任何必要的权限,然后询问应将哪些计算机用户添加到该组。
我发现的最令人震惊的事情是许多开发人员一直以管理权限运行。
I've been reading about this and I'm slowly coming to the conclusion that profiler-like tools in general do not require administrative access, but stating that you require it is an easy way for the tool makers to avoid all problems related to insufficient privileges.
So, I guess they are being lazy but also somewhat pragmatic.
Correct me if I'm wrong (I'm no expert on the Windows security model), but I believe one way to handle this situation would be to require admin privileges only at install time. Then create a ProfilerUsers user group and grant any necessary privileges to that group, then ask which computer users should be added to that group.
The most shocking thing I've discovered is that a lot of developers run all the time with administrative privileges.
听起来像是开发人员的设计选择。 他们可能认为在探测内存或动态更改内存中的代码之前请求管理员权限是个好主意,因为某些类型的恶意软件会出现这种行为。
Sounds like a design choice by the developers. They may have thought it was a good idea to request admin rights before probing around in memory or dynamically altering code in memory since this behaviour is to be expected from some types of malware.
最可能的解释是它们是作为专用调试器实现的,使用 Win32 调试 API,例如 DebugActiveProcess()。 这些函数需要 PROCESS_ALL_ACCESS (如文档中详述),我希望您需要管理员权限。
IIRC 除非您在系统上拥有本地管理员权限(至少对于 C++ 而言),否则 Visual Studio 调试器也无法(正常)工作。
The most likely explanation is that they are implemented as specialised debuggers, using the Win32 debugging APIs like DebugActiveProcess(). These functions need PROCESS_ALL_ACCESS (as detailed in the documentation) and I would expect that you will need admin rights for that.
IIRC the Visual Studio debugger won't work (properly) either unless you have local admin rights on your system, at least for C++.