隐藏c# windows应用程序源代码
我使用 C# .Net 2.0 编写了一个 Windows 应用程序,我想做一些隐藏源代码的事情,这样当任何人使用重构工具时都看不到源代码。 我使用了 dotfuscator,但它只是更改了函数名称,但没有更改所有源代码。
更新: 我想隐藏源代码,不是因为隐藏密钥,而是隐藏代码的工作原理。
谢谢,
I wrote a windows application using C# .Net 2.0 and i want to do something which hide the source code, so when any one use refactor tool can't see the source code.
I used dotfuscator but it just changed the function names but not all the source code.
UPDATE:
I want to hide the source code, not because of hiding the key, but to hide how the code is working.
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
根据定义,IL 在体内残留物方面非常具有表现力; 你只需要:
IL is by definition very expressive in terms of what remains in the body; you'll just have to either:
好吧,源代码是您的,除非您明确提供它,否则您可能只会提供编译后的二进制文件。
现在,这些编译后的二进制文件就是 IL 代码。 为了防止有人“反编译”并将您的 IL 代码逆向工程回源代码,您需要对 IL 代码进行混淆。 这是通过代码混淆器完成的。 市场上有很多。
您已经使用 dotfuscator 完成了此操作,但是,您说它只更改了函数名称,而不是所有源代码。 听起来您正在使用 Visual Studio 附带的 dotfuscator 版本。 这实际上是“社区版”,仅包含“专业版”功能的子集。 请参阅此链接了解以下比较矩阵社区版和专业版的特点。
如果您希望对代码进行更多混淆(特别是防止人们使用 Reflector 等工具),您将需要 Dotfuscator 的专业版,或其他包含类似功能的代码混淆器产品。
Well, the source code is yours and unless you explicitly provide it, youll perobably only be providing compiled binaries.
Now, these compiled binaries are IL code. To prevent someone "decompiling" and reverse engineering your IL code back to source code, you'll need to obfuscate the IL code. This is done with a code obfuscator. There are many in the marketplace.
You've already done this with dotfuscator, however, you say that it only changed the function names, not all the source code. It sounds like you're using the dotfuscator edition that comes with Visual Studio. This is effectively the "community edition" and only contains a subset of the functionality of the "professional edition". Please see this link for a comparison matrix of the features of the community edition and the professional edition.
If you want more obfuscation of your code (specifically to protect against people using tools such as Reflector), you'll need the professional edition of Dotfuscator, or another code obfuscator product that contains similar functionality.
一旦人们掌握了您的二进制文件,他们就可以对其进行逆向工程。 对于编译为字节码(C# 和 Java)的语言来说更容易,而对于编译为特定于 CPU 的二进制文件的语言则更困难,但这总是可能的。 面对它。
As soon as people get a hand on your binaries they can reverse-engineer it. It’s easier with languages that are compiled to bytecode (C# and Java) and it’s harder with languages that are compiled to CPU-specific binaries but it’s always possible. Face it.
尝试智能组装
http://www.smart assembly.com/index.aspx
Try SmartAssembly
http://www.smartassembly.com/index.aspx
混淆软件隐藏方法内容的长度是有限的,从根本上改变内部结构而不影响正确性(当然还有性能)是极其困难的。
值得注意的是,具有许多小方法的代码一旦被混淆,往往会变得更加难以理解,特别是当采用在方法之间共享名称的技术时,这些技术看起来会发生冲突,但对于运行时却不会发生冲突。
一些混淆器允许生成无法用任何目标语言表示的构造,例如,CIL 中允许的所有操作集远多于通过 C# 甚至 C++/CLI 表达的操作集。 然而,这通常需要显式设置才能启用(因为它可能会导致问题)。 这可能会导致反编译器失败,但有些会尽最大努力并解决它(可能会内联它无法处理的 il)。
如果您将 pdb 与应用程序一起分发,则由于附加符号,可以推断出更多信息。
There are limits to the lengths obfuscation software can go to to hide the contents of methods, fundamentally changing the internals without affecting the correctness (and certainly performance) is extremely hard.
It is notable that code with many small methods tends to become far harder to understand once obfuscated, especially when techniques for sharing names between methods that would appear to collide to the eye but not to the runtime are employed.
Some obfuscators allow the generation of constructs which are not representable in any of the target languages, the set of all operations allowable in CIL for example is way more than that expressible through c# or even C++/CLI. However this often requires an explicit setting to enable (since it can cause problems). This can cause decompilers to fail, but some will just do their best and work around it (perhaps inlining the il it cannot handle).
If you distribute the pdb's with the app then even more can inferred due to the additional symbols.
仅符号重命名不足以阻碍对应用程序进行逆向工程。 您还需要控制流混淆、字符串加密、资源保护、元数据缩减、抗反射防御等。尝试 加密混淆器支持所有这些以及更多。
Just symbol renaming is not enough of a hindrance to reverse-engineering your app. You also need control flow obfuscation, string encryption, resource protection, meta data reduction, anti-reflector defenses, etc, etc. Try Crypto Obfuscator which supports all this and more.
为您的应用程序创建一个安装项目,并将安装程序像软件一样安装在您朋友的计算机上。 使用 microsoft Visual Studio 创建安装项目有 5 个步骤。
步骤 1:创建示例 .Net 项目。 在以发布模式构建您的项目之后,我将此项目命名为“TestProject”。
步骤 2:右键单击您的解决方案并选择安装项目来添加新项目,并将其命名为“TestSetup”。
步骤 3:右键单击安装项目并添加主要输出,然后选择显示的项目。
第四步:右键单击安装项目,选择查看->查看 文件系统-> 应用程序文件夹。 现在将您想要的内容复制到安装文件夹中。
第5步:现在转到我们的项目文件夹并打开release文件夹,您可以在此处获取setup.exe文件。 双击“TestSetup”文件并将项目安装到您和其他计算机上。
Create a setup project for your application and install the setup on your friends computer like a software. There are 5 steps to creating the setup project using microsoft visual studio.
Step 1: Create a Sample .Net Project. I have named this project as "TestProject" after that build your project in release mode.
Step 2: Add New Project using right click on your solution and select setup project and give the name this as "TestSetup".
Step 3: Right click on setup project and Add primary Output and select your project displayed.
Step 4: Right Click the setup project and select View-> File System -> Application Folder. Now copy what you want to be in installation folder.
Step 5: Now go to our project folder and open the release folder you can get the setup.exe file here. Double click on the "TestSetup" file and install your project to your and other computer.