IL2Cpp简易加密方法

Mono作为backend的时代,破解总的来说还是容易的:

  1. 修改libmono.so :从内存动态搜素dll特征值动态dump
  2. 混淆Dll:dnspy作者的de4net可以反混淆大部分混淆器
  3. 修改Dll的PE结构(腾讯MTP):可以用XPose抓取Dll主体配合一些工具修复PE头
  4. 动态解密Dll Method(网易易盾):这一招最狠,每次只能Dump一部分Method实现,除非分析解密的so,暴力遍历所有函数回写

IL2Cpp似乎为我们解决了以上问题,但是IL2Cpp Dumper的出现,使得小白也能轻松拿到所有的Assembly、class、成员组成。如果不对IL2Cpp进行加密,利用上述Dump信息配合IDA,依然可以使得关键函数被定位修改,例如源源不断的崩坏3修改版。

IL2Cpp加密有两种思路:

  1. 对libil2cpp加壳
  2. 对global-metadata.dat进行加密

考虑到libil2cpp.so是在Unity启动流程中被加载的,加壳的话需要hook或者修改Unity源码。因此加密global-metadata.dat性价比是最高的。

打开Unity安装目录Editor\Data\il2cpp\libil2cpp\vm,找到MetadataCache.cpp和MetadataLoader.cpp,MetadataCache::Initialize中通过MetadataLoader::LoadMetadataFile加载了global-metadata.dat,据此即可对dat进行加密,无论是加入加密算法还是修改路径都是可以的。

对于自动化流程,安卓可以在出包以后,zip解压apk进行处理;iOS则在打包为XCode工程时进行处理,ipa一旦生成,就不好进行修改了。这些可以做成Editor脚本或者Jenkins脚本。

麻烦的一点是需要修改Unity安装目录的代码,因此需要注意出包使用同一台机器,同时对开发人员平时自行打包做一些兼容处理,例如加载加密失败则Fallback到正常的读取流程中。

淘宝花钱买的最新版!需要的拿去! This asset obfuscates your code to make it harder for bad guys to reverse engineer your projects. Specifically designed for Unity, it seamlessly links in with its build process. The top priority of this package is to work straight out of the box with no extra steps required. While other obfuscators can stop a game from working, Beebyte's obfuscator looks for specific Unity related code that must be protected. The contents of your source files are unchanged, the obfuscation targets the compiled assembly. Features: - Supports IL2CPP - Supports Assembly Definition Files (Unity 2017.3+) - Removes Namespaces without any conflicts - Recognises Unity related code that must not be changed - Renames Classes (including MonoBehaviours) - Renames Methods - Renames Parameters - Renames Fields - Renames Properties - Renames Events - String literal obfuscation - Adds fake methods - Easy and extensive customisation using the Unity inspector window - Consistent name translations are possible across multiple builds and developers - Semantically secure cryptographic naming convention for renamed members The asset works for both Unity Free and Unity Pro version 4.2.0 onwards (including Unity 5 & 2017 & 2018). Build targets include Standalone, Android, iOS, WebGL, UWP. Other platforms are not guaranteed or supported but may become supported at a future date. IL2CPP builds are much harder to reverse engineer but strings and member information (class, method names etc) are visible in the global-metadata.dat file. Obfuscation will apply to this file adding further security. Why not complement your security with the Anti-Cheat Toolkit - a great third party asset. For more information about the Obfuscator, please see the FAQ
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值