c# - InstallShield 和 ConfuserEx

标签 c# .net obfuscation installshield

我想使用 ConfuserEx 混淆我的源代码,所以我创建了一个如下所示的 ConfuserEx 项目文件:

<project baseDir="." outputDir="." xmlns="http://confuser.codeplex.com">
    <rule pattern="true" inherit="false">
        <protection id="rename" />
        <protection id="ctrl flow" />
        <protection id="ref proxy" />
        <protection id="anti debug" />
        <protection id="anti dump" />
        <protection id="constants" />
        <protection id="resources" />
        <protection id="anti tamper" />
      </rule>
     <module path="MainApplication\bin\Release\MainApplication.exe" />
     <module path="MainApplication\bin\Release\Component.Hardware.dll" />
     <module path="MainApplication\bin\Release\Component.Log.dll" />
     <module path="MainApplication\bin\Release\Component.Service.dll" />
     <module path="MainApplication\bin\Release\Component.Software.dll" />
     <module path="MainApplication\bin\Release\AsynchronousSocket.dll" />
     <module path="MainApplication\bin\Release\Instrumentation.dll" />  
</project>

因为我想通过设置部署我的应用程序,所以我为我的 MainApplication-Project 创建了一个 InstallShield 安装程序。我选择初级输出。

在 Visual Studio 的 Postbuild-Event 中,我使用 crproj 文件作为参数调用 Confuser.CLI.exe。然而,只有 MainApplication.exeAsynchronousSocket.dll + Instrumentation.dll 被修改为 ConfuserEx。 4 个 Component.*.dll 文件不是。 我不得不说所有的程序集都是不同的项目。所以我的项目解决方案结构如下所示:

MyProject
    MyProject.MainApplication
    MyProject.Component.Hardware
    MyProject.Component.Software
    MyProject.Component.Log
    MyProject.Component.Service
    MyProject.AsynchronousSocket
    MyProject.Instrumentation
    MyProject.Setup
    MyProject.sln
    MyProject.crpoj

我的猜测是我使用了 InstallShield 使用的错误程序集。我还尝试使用 MyProject.Component.Service\bin\ReleaseMyProject.Component.Service\obj\Release 中的程序集,但这些选项均无效。 我不认为使用 MainApplication\obj\Release 有效,因为只有 MainApplication.exe 位于。

谁能告诉我 InstallShield 从哪里获取主要输出,或者我是否遗漏了其他内容?

最佳答案

一种可能的解决方案是多个 crproj 文件,每个二进制文件一个,并在每个项目的后期构建步骤中指定项目特定的 crproj 文件。 主应用程序.crproj

<project baseDir="." outputDir="." xmlns="http://confuser.codeplex.com">
    <rule pattern="true" inherit="false">
        <protection id="rename" />
        <protection id="ctrl flow" />
        <protection id="ref proxy" />
        <protection id="anti debug" />
        <protection id="anti dump" />
        <protection id="constants" />
        <protection id="resources" />
        <protection id="anti tamper" />
      </rule>
     <module path="MainApplication\bin\Release\MainApplication.exe" />
</project>

Component.Hardware.dll.crproj

<project baseDir="." outputDir="." xmlns="http://confuser.codeplex.com">
    <rule pattern="true" inherit="false">
        <protection id="rename" />
        <protection id="ctrl flow" />
        <protection id="ref proxy" />
        <protection id="anti debug" />
        <protection id="anti dump" />
        <protection id="constants" />
        <protection id="resources" />
        <protection id="anti tamper" />
      </rule>
     <module path="MainApplication\bin\Release\Component.Hardware.dll" />
</project>

关于c# - InstallShield 和 ConfuserEx,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30094596/

相关文章:

lua - 如何去混淆 Lua 脚本?

c# - 在 C# 中处理竞争条件

c# - 带有子查询的表达式树

c# - C#If…Else比较字符串值与类型

c# - 取消时延续链中的哪个任务正在运行?

java - 在带有 Protocol Buffers 的项目中使用 Proguard 有哪些特点?

javascript - 使用具有高级优化功能的 Closure 编译器时如何在 javascript 中保留全局变量?

c# - 在 64 位 Windows 7 上的 .net 桌面应用程序中使用 vb6 dll

c# - 如何计算标准差[数组]

.net - 组装问题/难题中的只读与属性