当前位置:网站首页>[Unity3D] Beginner Encryption Skills (Anti-Cracking)
[Unity3D] Beginner Encryption Skills (Anti-Cracking)
2022-08-02 08:03:00 【Two waters first wood show】
参考文章:
Unity3D研究院之Android加密DLL与破解DLL .SO(八十一) | 雨松MOMO程序研究院
Unity3D研究院之Android二次加密.so二次加密DLL(八十二) | 雨松MOMO程序研究院
Unity 2019.4.0 Mono 编译以及加密 windows版_雾凇|Songs的博客-CSDN博客
Windows 下使用 mingw+msys 交叉编译 Android Unity Mono_weixin_30449453的博客-CSDN博客 Unity3DAndroid export package encryption learning--加密libmono.so_GrimRaider的博客-CSDN博客
官方文章:
Compiling Mono on Windows | Mono
目录
GitHub - Unity-Technologies/mono: Mono open source ECMA CLI, C# and .NET mplementation.
③ 使用Visual Studio 2019打开mono目录下的\msvc\mono.sln生成解密文件
一、C#代码加密解密
1.1 Window工程
Window工程:打出exeAfter the package, the following screenshot structure file is obtained
前提概要:
需要加密的文件:
xxx_Data\Managed\Assembly-CSharp.dll(核心dll)
Where there is encryption, there is decryption,The decryption process is put into read parsingdll时,文件: MonoBleedingEdge\EmbedRuntime\mono-2.0-bdwgc.dll
开始进入windowEncrypted production process:主要参考Unity 2019.4.0 Mono 编译以及加密 windows版_雾凇|Songs的博客-CSDN博客
① Cygwin 安装Cygwin
下载setup-x86_64.exe安装软件,打开cmd,先cd到setup-x86_64.exe所在目录执行.
setup-x86_64.exe -P autoconf,automake,bison,gcc-core,gcc-g++,mingw64-i686-runtime,mingw64-i686-binutils,mingw64-i686-gcc-core,mingw64-i686-gcc-g++,mingw64-i686-pthreads,mingw64-i686-w32api,mingw64-x86_64-runtime,mingw64-x86_64-binutils,mingw64-x86_64-gcc-core,mingw64-x86_64-gcc-g++,mingw64-x86_64-pthreads,mingw64-x86_64-w32api,libtool,make,python,gettext-devel,gettext,intltool,libiconv,pkg-config,git,curl,wget,libxslt,bc,patch,cmake,perl,yasm,unzip
The process probably is10分钟左右,Because it downloads a bunch of required files,耐心等待.It will give you choices along the way2export directory,默认C盘,Other drive letters are optional,安装完毕后,It will be there in the first export directory of your choiceCygwin.bat(also appears on the desktopCygwin64 Terminal应用图标)Executing it will open a command line window,Represents normal completion.
2022年8月1日更新:安装Mono环境
https://www.mono-project.com/docs/getting-started/install/windows/
安装完毕后按wins键(左下角开始)输入mono搜出
输入mono --version执行成功,注意这个C:\Program Files\Mono并不是一个文件,而是MonoEnvironment command line form.
② git clone unity-mono源码工程(It is said on the Internet that it is necessary to choose the correspondingUnity版本,未测试)
GitHub - Unity-Technologies/mono: Mono open source ECMA CLI, C# and .NET mplementation.
如果你是2019.4+的版本,Then choose the above2019.4-branch-updates分支克隆,git命令如下:
git clone --recursive -b 2019.4-branch-updates https://github.com/Unity-Technologies/mono.git
Mirroring is needed in the countryclone才会比较快,So mirroring uses related articles:
git clone 换源 / GitHub 国内镜像_A blog that adds more soup to noodles-CSDN博客_github国内镜像源
本人使用https://gitclone.com git命令更改为:
git clone --recursive -b 2019.4-branch-updates https://gitclone.com/Unity-Technologies/mono.git
克隆完成后,打开①安装的CygwinCommand Form program,cd到②克隆到本地的mono工程目录下,执行
cd d:/xxx/mono/
区分64和32位window系统执行命令:
64位
./autogen.sh --prefix=$PREFIX --host=x86_64-w64-mingw32 --enable-msvc --disable-boehm
32位
./autogen.sh --prefix=$PREFIX --host=i686-w64-mingw32 --enable-msvc --disable-boehm
等待编译完成,它会将monoThe project is compiled and output to Cygwin.bat文件所在目录下的\home\计算机名\mono文件夹下【Cygwin.bat是CygwinThe command form program executesbat文件】
Cygwin目录:Cygwin.bat所在目录
mono目录:Cygwin目录\home\计算机名\mono\
③ 使用Visual Studio 2019打开mono目录下的\msvc\mono.sln生成解密文件
If you can't find it, just search for the filemono.sln
There may be some red flags in the generation process,But it doesn't seem to affect the completion of the process to get the documents we need:
If it fails, you will not see the file below,只有mono-2.0-dac-bdwgc.dll,We want to bemono-2.0-bdwgc.dll
mono目录下\msvc\build\bdwgc\x64\bin\Release\mono-2.0-bdwgc.dll
将它替换掉MonoBleedingEdge\EmbedRuntime\mono-2.0-bdwgc.dll
加密dll代码:
string path = @"E:\xxx_Data\Managed\Assembly-CSharp.dll";
byte[] bytes = File.ReadAllBytes(path);
bytes[0] += 1;
//If you want to verify whether the encryption was successful,可使用dnSpy神器
//string outPath = @"E:\xxx_Data\Managed\Assembly-CSharp_dec.dll";
string outPath = path;
File.WriteAllBytes(outPath, bytes);
加密后的dllIt just can't be cracked temporarily,Because the decryption method is theremono-2.0-bdwgc.dll,Someone else just cracks thisdllknow the decryption method,Then decrypt what you have encrypteddll.
Unity3D研究院之Android二次加密.so二次加密DLL(八十二) | 雨松MOMO程序研究院
Yusong articles are all Androiddll加密和解密,Android decryption file islibmono.so,iOSNot yet contacted.
2. Android工程
① 、② 与Window工程相同
③ 使用CygwinThe command form program executes
cd d:/xxx/mono/
./external/buildscripts/build_runtime_android.sh
Find it when donelibmono.so,将它放入.apk文件里的\lib\armeabi-v7a\下(如果lib还有其他的armxxxThe directory should also be placed accordinglyarnxxx\libmono.so文件,libmono.soThere will also be correspondencelib一样的armxxx目录的,Do not select the wrong file to put in.
I have tested the current Android project and haven't tried to compile it yet,windowWorks using the provided below articlemonoEngineering testing is possible,But the android test goes to compilebuild_runtime_android.sh失败Unity 代码加密 Mono Compile and encrypt windows版_雾凇|Songs的博客-CSDN博客_unity代码加密
失败记录:
最关键的一点是git clone下的monoThe project must be complete,不要去zip下载git工程,I just suspectgit cloneCommand line downloads are too slow,Download directly over the wallzip,As a result, after a long time, there are still various errors and missing files,Check and find that you can download directlyzip,The files are missing a lot,比如:mono-unity-2021.2-mbe-pre-upgrade\external\bdwgc文件夹是空的!Subsequent updates can compile normally.
编译Unity使用的libmono.so - K1_大大 - 博客园
The biggest problem is that all articles are not introduced2017之后的libmono.so的制作,基本上都有build_runtime_android.sh和 build_runtime_android_x86.sh And there's a lot of content in it,There are many things changed,反正这x86.sh 只在2017seen in previous versions,And the content is relatively consistent,由于githubCloning consistently has network issues,And did not find the relevant library to provide,Temporarily give up,Basically see the aboveK1_Great article to achieve compilationlibmono.so解密文件.哎,githubThe link reference library is really drunk,And the domestic wall,Unstable image,This all stops me from going on,但不用担心,Unity自从出了IL2CPP,C#Layer encryption should be sound.
二、热更代码&资源加密
没啥好说的,It's simple binary file encryption,基本上都是assetbundleEncrypt the package,After encryption, decryption loads normallyab包即可,哎,Anyway, just do it,After all, decryption is on the client side.
三、混淆代码
暂未研究
边栏推荐
- Agile, DevOps and Embedded Systems Testing
- 责任链模式(Chain Of Responsibility)
- 主流定时任务解决方案全横评
- OC-NSDictionary
- How to export multiple query results at once in SQL server 2014?
- About the SQL concat () function problem, how to splice
- Inverter Phase Locking Principle and DSP Implementation
- MySQL - Detailed Explanation of Database Transactions
- 21 days learning challenge 】 【 sequential search
- MySQL batch update
猜你喜欢
The best interests of buying and selling stocks with handling fees [What is missing in the definition of DP status?]
OC-error prompt
MySQL-Execution Process + Cache + Storage Engine
Install Metasploitable2 on VMware
PanGu-Coder:函数级的代码生成模型
图腾柱和推挽电路介绍
MySQL-索引详解
LeetCode 2312. Sell Wood Blocks
正则表达式
MySQL-底层设置
随机推荐
Appium 滑动问题
MySQL - index explanation
【CV】OpenVINO安装教程
Link with Game Glitch
Splunk Filed extraction 字段截取
Thesis understanding: "Cross-Scale Residual Network: A GeneralFramework for Image Super-Resolution, Denoising, and "
通过建立新的SaaS业务来推动增长的六种方法
OC - NSSet (set)
Inverter Phase Locking Principle and DSP Implementation
埋点开发流程
MySQL error 1055 solution: [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains
MySQL-多版本并发控制
Splunk Filed Alias field name
查找最大的n个文件
数据中台:始于阿里,兴于DaaS
Mysql error 2003 solution Can 't connect to Mysql server on' localhost '(10061).
LeetCode 2312. Sell Wood Blocks
MySQL database design specification
Data reveal that the average cost is as high as $4.35 million in 2022, a record!
Mysql报错2003 解决办法 Can‘t connect to MySQL server on ‘localhost‘ (10061)