Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/312.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将C#代码与Confuser混淆不适用于语言资源文件(DLL)_C#_Winforms_Localization_Obfuscation - Fatal编程技术网

将C#代码与Confuser混淆不适用于语言资源文件(DLL)

将C#代码与Confuser混淆不适用于语言资源文件(DLL),c#,winforms,localization,obfuscation,C#,Winforms,Localization,Obfuscation,我在Visual Studio 2012中有一个C#项目(WinForms),运行64位Windows 7 Professional 我的WinForms应用程序有两种语言-英语和德语。 因此,在我的Visual Studio项目中,我有两个资源文件(.resx)lang.resx(包含我的默认语言德语)和lang.en-GB.resx(包含我的可选语言英语) 当我编译.NET 3.5的项目时,VS在我的应用程序项目文件夹中创建了两个文件夹,“de_de”和“en_GB”,并将包含语言内容的DL

我在Visual Studio 2012中有一个C#项目(WinForms),运行64位Windows 7 Professional

我的WinForms应用程序有两种语言-英语和德语。 因此,在我的Visual Studio项目中,我有两个资源文件(.resx)lang.resx(包含我的默认语言德语)和lang.en-GB.resx(包含我的可选语言英语)

当我编译.NET 3.5的项目时,VS在我的应用程序项目文件夹中创建了两个文件夹,“de_de”“en_GB”,并将包含语言内容的DLL文件复制到这两个文件夹中(两个文件都命名为“app.resources.DLL”)

到目前为止,一切顺利。我的应用程序在没有“混乱”的情况下运行良好。在英文版Windows上运行时,它显示英文文本;在德语或任何其他语言版Windows上运行时,它显示德语文本。。。正如所料

现在,我正在使用Confusor版本1.9(最新的、预编译的、可下载的.exe版本),将我的代码与Confuser(可在CodePlex:上找到)混淆

当我将我的“app.exe”和“de de\app.resources.dll”以及“en GB\app.resources.dll”添加到confuser时,confuser将只生成1个混淆的app.resources.dll,而不是2个(每种语言/资源dll一个)

这意味着,我不能在语言之间切换,因为confuser似乎只考虑一个app.resources.dll(而不是两个)

我想我的项目设置并没有什么特别或突出之处(使用多种语言的普通老式WinForm应用程序)

我的问题是:

如何配置confuser,使其正确混淆我的app.exe和两个app.resources.dll文件


非常感谢您的任何帮助(甚至提示)

您不能只重命名DLL吗

  • de-de\app.resources.dll=>de-de\u app.resources.dll
  • en-GB\app.resources.dll=>en-GB\u app.resources.dll

在confuser补丁列表中,它解决了您的确切问题:)

补丁ID 14664与您的问题有关,看起来您需要在项目文件中设置条目(摘自他们自己的站点):

语言文件示例,显示输出内容:
可执行文件\Common.resources.dll->targetfolder\Common.resources.dll
可执行文件\de\Common.resources.dll->targetfolder\de\Common.resources.dll
可执行文件\fi\Common.resources.dll->targetfolder\fi\Common.resources.dll
等
修补后,现在可以使用以下类型的项目文件实现这一点:
...

它是开源的,所以请查看代码。我知道,它是开源的-但我们德国人目前在摆弄开源软件方面有不良记录;-)所以我不想自己弄乱Confuser的源代码…dll是从我的lang.resx和lang.en-GB.resx文件生成的,并自动命名为“app.resources.dll”-我在Visual Studio中查看过这一点,但找不到任何设置来控制嵌入资源的dll名称。只是在explorer中重命名它们,这就是你的意思吗?我想那是行不通的,因为我的.exe文件引用了它们。
An example with language files, showing what the output should be:

Executables\Common.resources.dll -> targetfolder\common.resources.dll
Executables\de\Common.resources.dll -> targetfolder\de\common.resources.dll
Executables\fi\Common.resources.dll -> targetfolder\fi\common.resources.dll

etc.

After patching this can now be achieved with the following kind of project file:

...
<assembly path="..\Executables\Common.resources.dll" />
<assembly path="..\Executables\de\Common.resources.dll" toSubFolder="de" />
<assembly path="..\Executables\fi\Common.resources.dll" toSubFolder="fi" />