简体   繁体   English

检查可移植可执行(PE)文件以获取COM签名

[英]Check Portable Executable (PE) file for COM signature

I need to programatically check arbitrary Dlls to see whether they are inproc COM servers. 我需要以编程方式检查任意Dll,以查看它们是否为Inproc COM服务器。 In other words, can they be registered on the current system using regsvr32 / DllRegisterServer. 换句话说,是否可以使用regsvr32 / DllRegisterServer在当前系统上注册它们。

Short of Andy's suggestions on this question, is there a way to figure out the needed without having to: 缺少Andy关于这个问题的建议 ,有没有一种方法可以找出需要的东西而不必:

  • Load the library and check for DllRegisterServer/DllUnregisterServer exports. 加载库并检查DllRegisterServer / DllUnregisterServer导出。
  • Attempt registration with regsvr32 while catching exceptions? 在捕获异常的同时尝试使用regsvr32注册?

There must be something in the PE format that indicates the needed. PE格式中必须有表明需要的内容。 My assumption is that 'regsvr32' already does this internally. 我的假设是'regsvr32'已经在内部执行此操作。 Would appreciate any input. 将不胜感激任何输入。

No. The only thing that makes a DLL a COM object is that it exports DllGetClassObject . 否。使DLL成为COM对象的唯一方法是它导出DllGetClassObject The only thing that makes it registerable is that it exports DllRegisterServer . 使其可注册的唯一原因是它导出了DllRegisterServer

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM