SkillAgentSearch skills...

JIEJIE.NET

An open source tool to obfuscation .NET assembly file, help you protect your copyright. small,fast and powerfu.

Install / Use

/learn @dcsoft-yyf/JIEJIE.NET
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Publish new project MWGA(Make WinForms Great Again) at https://github.com/dcsoft-yyf/MWGA

JIEJIE.NET | 结界.NET

An open source tool to obfuscation .NET assembly file, help people protect theirs copyright. <br /> Jie(2)Jie(4) in chinese is a kind of transparet magic protect shield. <br />Author : yongfu-yuan(袁永福) from CHINA . Email:28348092@qq.com

update log

<br />2026-1-1 :Fix bug for encryption resource. <br />2024-10-19: Add StringsSelector command argument.[Bless my babies SAM and LISA 4th birthday.] <br />2024-2-1 : Fix bug for LoadResourceSet. <br/> 2024-1-12 : Fix bug for SMF_GetContent. <br/> 2023-12-2 : Fix bug for parse string value. <br/> 2023-11-7 : Support Blazor Web assembly.clean custom attributes,remove dead code. <br/> 2023-2-15 : Support .NET6.0. <br/> 2022-11-11: Fix bug for SMF_CreateEmptyTable and marshal in field. <br/> 2022-11-7 : Fix bug for modopt,modreq and marshal instruction.Fix bug for COM.Interop . <br/> 2022-8-31 : Fix bug for await call. <br/> 2022-7-19 : Fix bug for SMF_GetManifestResourceNames(). <br/> 2022-4-13 : Fix bug while working with VS.NET. <br/> 2022-3-7 : Support filter{}. <br/> 2022-2-17 : Add Windows GUI. <br/> 2022-2-9 : More powerfull obfuscate control flow. <br/> 2022-1-31 : Happy CHINESE NEW YEAR!!!!!!!!! <br/> 2022-1-6 : Encrypt embedded resources. <br/> 2021-12-30: More powerfull stack trace translate for new year. <br/> 2021-12-14: Let software run faster and less memory used.support crossgen.exe for .net core. <br/> 2021-12-06: Support ldtoken method. <br/> 2021-11-19: Encrypt enum value when calling method. <br/> 2021-11-16: Encrypt typeof() instruction. <br/> 2021-11-11: Encrypt byte array and integer values.fix for COM interop. <br/> 2021-11-1 : Remove property/event which renamed. <br/> 2021-10-25: Hidden array define. <br/> 2021-10-23: Merge multi assembly files to a single assembly file.change target platform. <br/> 2021-9-21 : Clean document comment xml element which renamed. <br/> 2021-9-9 : package small properties and change call/callvirt instructions. <br/> 2021-8-23 : Add feature: Support .NET core,fix some bugs. <br/> 2021-7-20 : Add feature: type or member rename. <br/> 2021-4-2 : Add feature: Obfuscate control flow. <br/> 2021-3-22 : First publish.

Background

Many .net developers are worry about their software has been cracked,copyright under infringed, so they use some tools to obfuscate IL code.such as PreEmptive dotfuscator.But some times ,it is not enought. <br/>So I write JieJie.NET can encrypt .NET assembly deeply,help people protect their copyright.and this tool is open source. It is a .NET application, the GUI is : <br/> <img src="https://raw.githubusercontent.com/dcsoft-yyf/DCNETProtector/main/source/snapshort/jiejie.gui.png"/> <br/> The console UI is : <br/> <img src="https://raw.githubusercontent.com/dcsoft-yyf/DCNETProtector/main/source/snapshort/snapshort.png"/>

Features

It has following features.

1 , Rename type and member.

JieJie can change type and member's name.This can make more difficute to understand the meaning of API.And effect by [System.Reflection.ObfuscationAttribute]. <br />For example, the old code is :

public abstract class XTextDocumentContentElement : XTextContentElement
{
    public override void AfterLoad(ElementLoadEventArgs args);
    public override void Clear();
    [Obfuscation(Exclude = true, ApplyToMembers = true)]
    public override XTextElement Clone(bool Deeply);
    [Obfuscation(Exclude = true, ApplyToMembers = true)]
    public override XTextDocument CreateContentDocument(bool includeThis);
    public XTextSelection CreateSelection(int startIndex, int length);
    public override void Dispose();
    public override void DrawContent(InnerDocumentPaintEventArgs args);
    [Obfuscation(Exclude = true, ApplyToMembers = true)]
    public override void EditorRefreshViewExt(bool fastMode);
    public float FixPageLinePosition(int pos);
    public override void Focus();
    [Obfuscation(Exclude = true, ApplyToMembers = true)]
    public XTextLineList GetAllLines();
    [Obfuscation(Exclude = true, ApplyToMembers = true)]
    public virtual XTextRange GetRange(int StartIndex, int EndIndex);
    public void InnerGetSelectionBorderElement(ref XTextElement startElement, ref XTextElement endElement);
    public void InvalidateSpecifyLayoutElements();
    [Obfuscation(Exclude = true, ApplyToMembers = true)]
    public virtual bool IsSelected(XTextElement element);
    public void RefreshParagraphListState(bool checkFlag, bool updateListIndex);
    public XTextParagraphFlagElement RootParagraphFlag();
    [Obfuscation(Exclude = true, ApplyToMembers = true)]
    public bool SetSelection(int startIndex, int length);
    [Obfuscation(Exclude = true, ApplyToMembers = true)]
    public bool SetSelectionRange(int firstIndex, int lastIndex);
}

After rename, these code change to:

public abstract class XTextDocumentContentElement : XTextContentElement
{
    public override void Clear();
    public override XTextElement Clone(bool Deeply);
    public override XTextDocument CreateContentDocument(bool includeThis);
    public override void Dispose();
    public override void EditorRefreshViewExt(bool fastMode);
    public override void Focus();
    public XTextLineList GetAllLines();
    public virtual XTextRange GetRange(int StartIndex, int EndIndex);
    public virtual bool IsSelected(XTextElement element);
    public bool SetSelection(int startIndex, int length);
    public bool SetSelectionRange(int firstIndex, int lastIndex);
    public XTextParagraphFlagElement z0ZzZzbmm1mO001();
    public XTextSelection z0ZzZzbmm1mO011(int startIndex, int length);
    public void z0ZzZzbmm1mO01O();
    public float z0ZzZzbmm1mOOm1(int pos);
    public void z0ZzZzbmm1mOOmn(ref XTextElement startElement, ref XTextElement endElement);
    public void z0ZzZzbmm1mOOmO(bool checkFlag, bool updateListIndex);
    public override void z0ZzZzbmmOO11nn(z0ZzZzbm0mmlm1O args);
    public override void z0ZzZzbmmOOl0nO(ElementLoadEventArgs args);
}

You can see , some API's name obfuscated.

2 , Obfuscate control-flow.

JieJie can anlyse IL Code, and obfuscate control-flow randomly without lost any features, It can break syntactic structure for foreach/lock/using. hiden the operation of euqals and concat tow string values. It let codes are very hard to read, some times it will cause crack tool error. <br />For example , the old code is :

public int RemoveByControl(object control)
{
    if (control == null)
    {
        throw new ArgumentNullException("control");
    }
    if (CheckOwner() == false)
    {
        return -1;
    }
    int result = 0;
    lock (this)
    {
        for (int iCount = _Tasks.Count - 1; iCount >= 0; iCount--)
        {
            if (_Tasks[iCount].Control == control)
            {
                _Tasks.RemoveAt(iCount);
                result++;
            }
        }
        if (_CurrentTask != null && _CurrentTask.Control == control)
        {
            _CurrentTask = null;
        }
    }
    return result;
}

After use JieJie.NET, these code display in ILSpy is:

public int RemoveByControl(object control)
{
	//Discarded unreachable code: IL_000b, IL_0073
	//IL_000b: Incompatible stack heights: 1 vs 0
	//IL_0073: Incompatible stack heights: 1 vs 0
	int num = z0ZzZzgw.z0kh;
	bool flag = default(bool);
	int num4 = default(int);
	int result = default(int);
	while (true)
	{
		switch (num)
		{
		default:
		{
			if (control == null)
			{
				throw new ArgumentNullException(z0ZzZzow.z0rj);
			}
			if (!z0rk())
			{
				goto IL_0049;
			}
			int num2 = 0;
			z0ZzZzjw.z0uk(this);
			try
			{
				int num3 = z0ZzZzgw.z0ah;
				while (true)
				{
					switch (num3)
					{
					default:
						num2++;
						goto IL_0097;
					case 3:
						if (flag)
						{
							z0ik = null;
						}
						break;
					case 4:
					case 5:
						{
							num4 = z0bk.Count - 1;
							goto IL_009e;
						}
						IL_009e:
						if (num4 < 0)
						{
							flag = z0ik != null && z0ik.Control == control;
							num3 = z0ZzZzgw.z0wj;
							continue;
						}
						if (z0bk[num4].Control == control)
						{
							z0bk.RemoveAt(num4);
							num3 = z0ZzZzgw.z0sh;
							continue;
						}
						goto IL_0097;
						IL_0097:
						num4--;
						goto IL_009e;
					}
					break;
				}
			}
			finally
			{
				Monitor.Exit(this);
			}
			result = num2;
			break;
		}
		case 0:
		case 1:
		case 3:
			break;
		}
		break;
		IL_0049:
		result = -1;
		num = z0ZzZzgw.z0wj;
	}
	return result;
}

Look, the control flow is very hard to understand , and ILSpy has error IL_000b: Incompatible stack heights: 1 vs 0. And use .NET Reflector 10.3,It stop work direct.

3 , Encrypt all string values define in assembly.

JieJie.NET can collect all string values define in assembly,convert they to static readonly fields in a new class,and encrypt theirs value.Make hakers can no search string value direct, crack is more difficulty. <br/>For example , the old code is :

private string GetLicenseMessage()
{

    return "This software license to :" + Environment.UserName;
}

After use JieJie.NET , the new code is :

private string GetLicenseMessage()
{
    string text = _0._6 + Environment.UserName;
    return text;
}
//  also create a new class, contains all string value in assembly in random order.
internal static class _0
{
    public static readonly string _0;
    public static readonly string _1;
    public static readonly string _2;
    public static readonly string _3;
    public static readonly string _4;
    public static readonly string _5;
    public static readonly string _6;
    public static readonly string _7;
    public static readonly string _8;
    public static readonly string _9;
    public static readonly string _10;
    public static readonly string _11;
    public static readonly string _12;
    publi
View on GitHub
GitHub Stars879
CategoryDevelopment
Updated7d ago
Forks172

Languages

C#

Security Score

95/100

Audited on Mar 20, 2026

No findings