ORM 和 .NET 代码保护器

发布于 2024-08-05 15:10:27 字数 243 浏览 6 评论 0原文

我们即将使用代码保护器(混淆和本机编译),我认为 ORM 将稍微依赖于反射,我担心混淆和本机编译保护技术会产生任何问题吗?

有人尝试过成功的 ORM 和代码保护来实现任何优秀的桌面应用程序吗?我们有 WPF 桌面应用程序。

我们的主要开发语言是 C#,我们正在使用自定义 ORM,但我也想评估任何商业 ORM 或 ADO.NET EF 等。

问题不是关于什么是代码保护以及我应该使用哪一种,我试图询问保护对 ORM 的影响。

We are about to use Code Protectors (Obsfucation as well as Native Compilation), I assume ORMs will be dependent little bit on Reflection and I am worried will Obsfucation and Native Compilation protection techniques create any problems?

Has anyone tried successful ORM and Code Protection for any good desktop application? We are having WPF Desktop Application.

Our primary language for development is C# and we are using our custom ORM but I want to evaluate any commercial ORM or ADO.NET EF etc as well.

Question is not about what is Code Protection and which one I should use, I am trying to ask about the effect of protection on ORM.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

烟沫凡尘 2024-08-12 15:10:27

如果您的代码使用反射,则混淆后的程序集很可能无法工作。您需要从混淆中排除那些通过其原始名称引用的实体。看一下Crypto Obfuscator,它将在混淆过程中分析您的代码并显示所有内容调用可能破坏方法(例如 Reflection )的方法和行号。这是一个巨大的计时器保护程序,因为它可以精确定位确切位置并帮助确定您需要从重命名中排除的属性/类。

If your code is using Reflection, most probably the obfuscated assembly will not work. You will need to exclude from obfuscation those entities referenced by their original name. Take a look at Crypto Obfuscator which will analyze your code during obfuscation and show all methods and line numbers where potentially breaking methods (such as Reflection ) are called. This is a huge timer-saver since it pinpoints the exact location and helps determine the properties/classes you need to exclude from renaming.

美胚控场 2024-08-12 15:10:27

尝试.Net Reactor。可以在 http://www.eziriz.com/ 购买,

它比周围的其他一些便宜很多,它还能做更多事情。您还可以禁用某些选项(例如混淆,以保留反射的使用),并且仅启用某些选项,例如 ILDASM 抑制,这仍然可以保护代码。

干杯

Try .Net Reactor. Available at http://www.eziriz.com/

Its a LOT cheaper than some of the others around, and it can do a lot more. You can also disable certain options (like obfuscation, to preserve the use of reflection) and only have certain options enabled like ILDASM Suppression, which will still protect the code.

Cheers

没企图 2024-08-12 15:10:27

不久前,Redgate 收购了 Smart Assembly,如果我需要的话,我会考虑一下做这个。

不久前,我尝试使用 CodeViel 来查看混淆/加密代码,并取得了一定程度的成功。我认为,如果您认真执行此操作,那么这并不像将一个程序集扔到一端然后弹出一个受保护的程序集那么简单。您必须考虑仅在内部使用的代码部分(即命名空间、类、方法、字段、属性、结构、事件和资源)以及需要公开给其他资源和库的代码部分。在我正在研究的情况下,我能够加密(或使用本机编译)来隐藏一些方法实现,但保留类定义(名称、方法、属性不变)。在某些情况下,我保持整个命名空间不变,因为它们只包含其他库所需的简单 POCO 对象。

对于您在哪里使用什么策略,这似乎确实是一个仔细的案例基础,您可以混淆一些内部结构以使反编译/逆向工程变得困难,这就足够了。在其他情况下,您可以使用加密/本机编译来简单地隐藏方法实现。您还会遇到这样的情况:您根本不让装配体的某些部分被触摸。大多数这些程序都会为您提供一些推荐的默认值和选项,您可以从这些默认值和选项开始,但您需要调整和更改这些,直到您可以产生保护您的核心 IP 但不限制您的最终用户的结果。

Redgate acquired Smart Assembly not too long ago, which is what I'd look at if I had a need to do this.

A while ago I trialed CodeViel to look at obfuscating/encrypting code with some degree of success. I think if you’re serious about doing this it’s not as simple as dropping an assembly in one end and it popping out a protected assembly. You will have to consider portions of your code (ie Namespaces, Classes, Methods, Fields, Properties, Structures, Events, and Resources) which are only to be used internally, and those that need to be exposed to other resources and libraries. In the case I was looking at I was able to encrypt (or use native compilation) to hide some method implementations, but left the class definition (name, methods, properties untouched). In some cases I left whole namespaces untouched as they contained only simple POCO objects required by other libraries.

It really seems to be a careful case by case basis as to what strategy you use where, some internals you could obfuscate to make decompilation/reverse engineering hard and that would be enough. Other cases you could use the encryption/native compilation to simply hide a method implementation. And you will also get cases where you are excluding portions of an assembly from being touched at all. Most of these programs will give you some recommended defaults and options that you can start from, but you will need to tweak and change these until you can produce results that protect your core IP but don't restrict your end users.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文