如何防止嵌入式清单被使用? [英] How to prevent embedded manifest from being used?

查看:134
本文介绍了如何防止嵌入式清单被使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理许多使用RegFree COM激活的应用程序,一切正常,除了其中一个应用程序是使用较旧的技术(使用JIT类型的编译器)运行的.

I am working on many apps that uses RegFree COM Activation, everything works well except that one of the application is ran using an older technology that uses a JIT-type compiler.

要使RegFree COM正常工作,我必须为启动的可执行文件提供清单(如果我错了,请纠正我),并列出我的依赖项.我所有其他应用程序都是内部构建的,我可以完全控制清单(创作以及如果我将其嵌入,如果我将其并排放置,等等).但是,这个JIT编译器(ala Java JRE)不是我的,它已经包含(嵌入)清单.

To get RegFree COM working, i have to provide a manifest to the launching executable (correct me if i'm wrong) with my dependencies listed. All my other applications are built in-house and i have full control over my manifest (authoring and if i embed it, if i leave it Side-By-Side, etc). But this JIT-compiler (ala Java JRE) isn't mine and it already contains (embedded) a manifest.

我已经提取了清单(将MT与-inputresource和-outfile一起使用),对其进行了修改并重新嵌入.它像预期的那样工作.但是,由于没有对该可执行文件的所有权,我担心这种操作的合法性(修改第三方的可执行文件并重新分发!),并希望避免这样做. 另外,我担心该可执行文件有时可能会被第三方签名,因此修改嵌入式清单会破坏签名.

I've extracted the manifest (using MT with -inputresource and -outfile), modified it and re-embedded it. It works like expected. However, having no ownership over this executable, i am worried about the legality of such a manipulation (modifying a third party's executable and redistributing it!) and would like to avoid having to do such a thing. Also, i am worried that at some point this executable may be signed by the third-party and thus modifying the embedded manifest is going to break the signature.

有没有办法让sxs-loader首先寻找另一个清单?看来,如果找到一个嵌入式文件,则默认情况下采用它(在大多数情况下可以). 我是否可以提供配置文件或任何可跳过嵌入式清单并随我并行提供的配置文件(myExe.exe.manifest,而不是myExe.exe内的RT_MANIFEST资源)的文件?

Is there a way to have the sxs-loader look for another manifest first? It seems that if it finds one embedded, it takes it by default (which under most cases is fine). Can i provide a configuration file or anything that would skip the embedded manifest and go for my side-by-side provided one (myExe.exe.manifest, instead of RT_MANIFEST resource inside myExe.exe) ?

推荐答案

据我所知,您只能在整个系统范围内进行操作.将其添加到注册表中:

You can only do that system wide as far as I know. Add that to the registry:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide]
"PreferExternalManifest"=dword:00000001

确保

Make sure to trip activation context cache by updating last modified date on your executable, otherwise your manifest changes won't be picked up (renaming and renaming it back seems to work).

在Win XP上,外部清单优于内部清单,但自Windows Server 2003 Service Pack 1起,他们将其改为相反.

On Win XP external manifest is preferred over internal, but since Windows server 2003 Service Pack 1 they changed it to opposite.

这篇关于如何防止嵌入式清单被使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆