AspNet Zero Core

Source: Internet
Author: User

Recently in the study of the ASPNET Zero Core 5.0.1 found that the VS click Debug automatically exited, from the ABP QQ Group learned that the author joined the Licensecode check. After a week or so intermittent toss, sort of cracked it. Originally wanted to completely decompile the encryption class, and later found that some methods are not compiled, so some methods are directly commented out implementation (the key method failed to decompile, more regrettable).

Disclaimer: This article is for study use only, if the project use please purchase genuine license

I. Description

Second, the Operation effect

Third, tool software

Iv. Anti-compilation process

      • Find Them.
      • Decompile and export a project using Dotpeek
      • Anti-compilation Abp.AspNetZeroCore.Web.dll
      • Anti-compilation Abp.AspNetZeroCore.dll

Five, source GitHub address

I. Description

If you are not interested in anti-compilation, you can download the source code directly from GitHub, the Abp file under the two projects Abp.aspnetzerocore, Abp.AspNetZeroCore.Web compiled to get the DLL directly to the ASPNET Zero The corresponding references in the Core 5.0.1 project will be replaced.

When you get the ASPNET Zero Core 5.0.1 Source code, you will find that there are two application DLLs that are not source code on ABP GitHub. One is the Abp.aspnetzerocore referenced in the engineering MyCompanyName.AbpZeroTemplate.Core, the other is the Abp.aspne referenced in the project MyCompanyName.AbpZeroTemplate.Web.Core Tzerocore.web. After parsing the code to do the verification in Abp.aspnetzerocore this DLL, the specific method for the Abpaspnetzerocoremodule class Postinitialize method calls another class Aspnetzerolicensechecker check party method, break the words directly postinitialize or remove the code in the check method can be implemented. Such as:

Second, the operation effect

After the cracked software runs,

Service side:

  

Front-End Interface:

  

Third, tool software

During the anti-compilation process, I used two of the software:

One of the 1.Resharper kits, JetBrains DotPeek 2017.3.2.

2.ILSpy version 3.0.1.3459.

Iv. Anti-compilation process

  4.1. Find Them

After obtaining the source with VS restore NuGet package, the two DLLs (Abp.AspNetZeroCore.dll, C:\Users\Administrator\.nuget\packages) are found in the system disk directory ( Abp.AspNetZeroCore.Web.dll).

  4.2 Decompile and export the project using Dotpeek

Use Dotpeek to decompile two DLLs, and then in Dotpeek's assembly to manage them, select project in the right-click menu to select Export to Project

  

After the completion of the anti-compilation is more embarrassing is the build project. NET Framework 2.0, we create a. NET Standard project ourselves and then copy the anti-compiled files into the created solution. Two DLLs are handled in a similar way.

After the completion of the project was introduced into the source code, after the introduction of my project directory structure as shown below, for debugging convenience I have replaced the ABP Class Library reference to the source code Engineering reference:

  

4.3 Anti-compilation Abp.AspNetZeroCore.Web.dll

This DLL is relatively simple, start with a simple, this DLL in the main anti-compilation of a class can be, such as

  

In this class 4, 52 did not see what use, directly deleted, 2, 32 is actually the corresponding class instance property, so Ctx.set_user (Authenticateresult.get_principal ()) changed directly to CTX. User=val. Principal,

authenticateresult.get_succeeded () && authenticateresult.get_principal () = NULL is changed directly to Val. Succeeded && Val. Principal! = null. Return statement Useextensions.use this piece of actual

is the extension method of the method parameter app. So the whole piece of code is sorted out as follows:

  

This DLL is basically anti-compilation of this class can be, other anti-compiled classes do not need to do extra processing.

4.4 Anti-compilation Abp.AspNetZeroCore.dll

This is more laborious, one is the code is large, the second is some code did not understand how to decompile, this DLL mainly decompile the following two classes

  

First look at the Aspnetzerobaselicensechecker class, this class is the base class of the Aspnetzerolicensechecker class, take the class of the constructor when the typical say some personal experience, the non-adjusted anti-compilation code is as follows:

Contrast markers:

1. This feature has not found any useful, directly removed;

2. This method has the corresponding code as follows:

   [MethodImpl (methodimploptions.noinlining)]    Internal static object Iz5hxhc38e0nlgy6ai ([in] object obj0)    {      Return (object) ((aspnetzeroconfiguration) obj0) . Licensecode;    }

is actually getting an attribute of the invocation parameter, so it can be modified directly to this. Licensecode = Configuration. Licensecode;

3. This cycle is a little more trouble, follow the steps of the implementation step by step of the line, the name of the method of confusion directly with the method to replace, the code is less good, not messy, some very long a little headache, this whole code to get out of the fact is two sentences, after the code is as follows:

        Protected Aspnetzerobaselicensechecker (aspnetzeroconfiguration configuration, Iabpzeroconfig Abpzeroconfig, string ConfigFilePath = "")        {this            . Licensecode = Configuration. Licensecode;            This._abpzeroconfig = Abpzeroconfig;        }

Other methods can be handled in a similar manner.

Aspnetzerolicensechecker This kind of anti-compilation method is similar, but the check method in this class is not possible, dotpeek the following code:

The circled part of the red box really doesn't understand what's going on here. If you have any ideas, you can provide them.

Five, source GitHub address

Anti-compiled code put on GitHub, interested friends can download down to study, have questions welcome message discussion .

Https://github.com/YSmileX/AspNetZeroCore

AspNet Zero Core

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.