One-time u3d DLL encryption record (i)

Source: Internet
Author: User

This article focuses on the encryption process for U3D games under windows

Main steps:

①: Compile and replace encrypted libmono.so

②: Export Android Project

③: Encrypt and replace Assembly-csharp.dll

④: Export apk with tools such as Eclipse

first of all, please refer to my " compilation libmono.so record "

Then the project is exported Cheer Zhuo Project, found under the Xxx/assets/bin/data/managed Assembly-csharp.dll, and then write a file read-write program to destroy the C # assembly structure, so as to achieve the purpose of the Assembly is not open

The sample program code is as follows:

1#include <stdio.h>2   3 #defineMaxLen 10244 5 voidMain ()6 {7 8FILE * outfile, *infile;9 Teninfile = fopen ("Assembly-csharp.dll","RB"); One      Aoutfile = fopen ("Assembly-csharp-tmp.dll","WB" ); -  -UnsignedCharBuf[maxlen]; the  -     if(outfile = = NULL | | infile = =NULL) -     { -         return; +     }    -  +     intRC; A     int_index =0; at      while(rc = Fread (BUF,sizeof(unsignedChar), maxlen,infile)! =0 ) -     { -         if(_index = =0) -buf[0] +=1; -Fwrite (BUF,sizeof(unsignedChar), RC, outfile); -_index++; in     } -  to fclose (infile); +  - fclose (outfile); the  *     return; $}

By running the encryption program, you will get an output file Assembly-csharp-tmp.dll, this is the encrypted file, is no longer a C # assembly. Replace the original Assembly-csharp.dll, you can achieve the effect of encryption, with the decryption of the libmono.so packaged apk will be able to achieve the general Code encryption effect.

But we may also think of, so cumbersome replacement process, can be replaced with a key function, the answer is yes, Linux and Mac have the SH automatic packaging tutorial, then refer to my next article

One-time u3d DLL encryption record (II)

, you can get the next key package in Windows.

One-time u3d DLL encryption record (i)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.