How do I remove a manifest from a precompiled dll

大憨熊 提交于 2020-06-08 08:23:41

问题


I have a precompiled c++ dll that I need to remove or replace the embedded manifest from. Is there a way that I can do this from the command line? I know it is possible to open the dll in VS and simply delete the manifest, but I would like to automate this process if possible.


回答1:


Unfortunately, it seems the standard tool to deal with manifests mt.exe shipped with VS cannot delete them. But if you are familiar with c++ it's quite easy to write your own tool for this purpose.

You just need to call BeginUpdateResource with given dll name, then UpdateResource with lpData = NULL and cbData = 0 to delete given resource type (RT_MANIFEST) and EndUpdateResource to commit changes.



来源:https://stackoverflow.com/questions/26037848/how-do-i-remove-a-manifest-from-a-precompiled-dll

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!