如何使用正则表达式或 LinqToText 解析 DumpBin.exe 输出文件
我正在围绕 dumpbin.exe 编写一个实用程序包装器,并输出 exe 文件、ocx 文件和 dll 文件的导出和依赖项。除了依赖性信息之外,我还需要捕获导出信息,例如文件是否是自注册的。有人知道做这样的事情吗?
这是一个示例输出文件: 注意:下面的 Deserialize、DoServiceCall 和 Serialize 行显示为换行。 粗体区域是我需要捕获的部分。
我还注意到在一些报告中依赖项部分可以出现在导出的上方或下方。
文件 Secadmin.dll 的转储
文件类型:DLL
图像具有以下依赖项: A1Mgr.dll KERNEL32.dll USER32.dll ADVAPI32.dll ole32.dll OLEAUT32.dll
的以下导出
00000000 characteristics
3C4DD9F4 time date stamp Tue Jan 22 16:30:28 2002
0.00 version
1 ordinal base
7 number of functions
7 number of names
ordinal hint RVA name
5 0 000153E0 ?Deserialize@CSecTuxClient@@AAEPATas_SecurityFunctions@@PAUtagSAFEARRAY@@PA_N@Z
6 1 00015843 ?DoServiceCall@CSecTuxClient@@IAEPATas_SecurityFunctions@@PAT2@PAH@Z
7 2 00014805 ?Serialize@CSecTuxClient@@AAEPAUtagSAFEARRAY@@PATas_SecurityFunctions@@H@Z
1 3 0000CDA3 DllCanUnloadNow
2 4 0000CDB8 DllGetClassObject
3 5 0000CDD5 **DllRegisterServer**
4 6 0000CE58 DllUnregisterServer
部分包含SecAdmin.dll
29000 .data
6000 .rdata
4000 .reloc
8000 .rsrc
3B000 .text
I'm writing a utility wrapper around dumpbin.exe and outputting exports and dependencies for exe files, ocx files and dllfiles. Besides dependency information, I also need to capture Export information such as if the file is self-registering. Would anyone have knowledge on doing something like this?
Here is a sample output file:
Note: The Deserialize, DoServiceCall and Serialize lines below appear to he wrapping.
Bolded areas are the parts I need to capture.
Also I've noticed in some reports the dependencies section can appear either above or below the exports.
Dump of file Secadmin.dll
File Type: DLL
Image has the following dependencies:
A1Mgr.dll
KERNEL32.dll
USER32.dll
ADVAPI32.dll
ole32.dll
OLEAUT32.dll
Section contains the following exports for SecAdmin.dll
00000000 characteristics
3C4DD9F4 time date stamp Tue Jan 22 16:30:28 2002
0.00 version
1 ordinal base
7 number of functions
7 number of names
ordinal hint RVA name
5 0 000153E0 ?Deserialize@CSecTuxClient@@AAEPATas_SecurityFunctions@@PAUtagSAFEARRAY@@PA_N@Z
6 1 00015843 ?DoServiceCall@CSecTuxClient@@IAEPATas_SecurityFunctions@@PAT2@PAH@Z
7 2 00014805 ?Serialize@CSecTuxClient@@AAEPAUtagSAFEARRAY@@PATas_SecurityFunctions@@H@Z
1 3 0000CDA3 DllCanUnloadNow
2 4 0000CDB8 DllGetClassObject
3 5 0000CDD5 **DllRegisterServer**
4 6 0000CE58 DllUnregisterServer
Summary
29000 .data
6000 .rdata
4000 .reloc
8000 .rsrc
3B000 .text
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论