Which Macros should I use? Themida的SDK中应该怎么使用各种宏?

原文:

It is normal that a programmer feel lost when deciding which macros he/she should use. Here we try to clarify that decision for you.

· VM macros and CodeReplace macros are the strongest ones in security

· Encode macros are not so strong but they have good performance when you have a loop with many iterations inside a macro

· VM macros and CodeReplace can be used with no problems in DLLs, instead Encode and Clear macros might crash on DLLs (due to relocations)

· VM Macros and CodeReplace macros are converted into internal virtual code, increasing a bit the size of each macro. If you use about 100 VM macros, the size of your application could be increased a few dozens of Kilobytes

· VM macros and CodeReplace can support declaration of variables inside macro and "return" (C/C++) / "Exit" (Delphi) statements inside the macro. This is not valid for Encode macros

· VM macros and CodeReplace macros cannot be used with exception handling. Encode / Clear macros should work fine with exception handling.

· VM and CodeReplace macros cannot have nested macros inside. Encode/Clear macros can have any nesting level inside them

 

Some numbers to help

We recommend you to put an equivalent number of macros according to the size of your unprotected application. About 10 macros / Megabyte should be a good protection for your application. So, if your application has 3 Mb size, you should put 30 macros on it.

About which macros you should insert, a possible estimation could be 70% of VM macros, 20% for CodeReplace macros and 10% for Encode macros.

 

翻译:

在决定使用哪个Macro时,程序员往往会感到很迷惑.没关系,这是正常现象.下面我们来试着解除你的迷惑.

1.WM macros和CodeReplace macros 是所有macro里安全度最强的两个

2.Encode macros虽然不如上面两个强度那么高,但是用在一段比较复杂和冗长的循环代码中,程序的性能要比上面两个好

3.在DLL里面使用VM macros和CodeReplace macros不会出现问题,但是使用Encode macros和Clear macros可能会出现因为重定位导致的崩溃

4.VM macros和CodeReplace macros会在程序内部转换为虚拟指令码,使程序体积有所增长.如果你使用了100个左右的VM macros,程序体积可能会增长几十Kb.

5.VM macros和CodeReplace macros中可以声明变量,可以使用返回语句(C++里为return),但是Encode macros中就不可以.

6.VM macros和CodeReplace macros不能和异常处理代码一起使用,相反Encode / Clear macros应该可以正常一起使用.

*语言不精,不知道此处表达的是macro中使用异常处理,还是异常处理中使用macro

7.VM macros和CodeReplace macros不能嵌套使用,Encode / Clear macros可以任意级别的嵌套使用.

 

我们建议你使用跟程序体积相符的macros数量,大约每M使用10个macros,这样的话如果你的程序有3M大小,应该使用30个左右.

最后,到底应该怎么结合使用这些macros呢,来自官方的评估给出了[70%的VM, 20%的CodeReplace和10%的Encode]这样一个比例,仅作参考.

 

备注:

macro(s) 指的ThemidaSdk里定义的宏,一般都是成对使用的

 1 VM_START
 2 ...
 3 VM_END 
 4 
 5 
 6 CODEREPLACE_START
 7 ...
 8 CODEREPLACE_END 
 9 
10 
11 ENCODE_START
12 ...
13 ENCODE_END

转载于:https://www.cnblogs.com/Athrob/archive/2012/08/10/2632066.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在国内软件行业环境混乱,基本上有点优秀的商业软件大部份都会被破解,有许多开发者为了保护自已的软件不被破解,使用很多复杂的加密算法,这样花费了很多精力。今天我为大家推荐一款软件Themida ,它是一个非常强大的软件加密保护系统,专门是为了那些想保护自己的软件不被先进的反向工程和黑客软件破解的开发者而设计的。开发者不需要更改任何的源代码就可以使用Themida轻松的将自已的软件进行加密,防止被黑客轻易破解。Themida使用SecureEngine的保护技术。它能够以最高的优先等级运行,这些保护技巧是从来都没在电脑防御技术领域出现过,Themida能在最大程度地保护你的软件产品。特别适合保护.net程序。 Themida的一些最重要的注册保护措施特点 1、可以创建用来延长试用版本的有效期的特别码。 2、一个用来储藏试用 状态的 强劲的引擎,以避免任何软件破解者尝试重置有效期。可以13、为个别开发者的需要创建不同的注册码。 4、针对特定国家的试用锁定和注册码。 5、机器锁定,使程式只运行在特定的电脑上。 6、自定的试用计算器来控制你试用版本的有效资源。 7、为试用版本和完全版本制定独立的密码。 8、可以使用外部 Themida DLL 来创建你自己的自动化系统。 9、超过 50 种不同函数的完整 SDK 。 10、为试用版和完全版提供 .NET SDK 支援。 11、使用数据库来安全地储存你所有的软件,客户和注册资料。 13、自定义所有的试用 / 注册讯息,也控制是否要展示特定的试用 / 注册讯息 重要提示(设置文方法): Advanced Options--->localization--->选择simple_chinese.lng
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值