Trinity Obfuscator
  • Welcome to Trinity Info Desk
  • FAQ
    • File won't work after obfuscation
    • File detected as virus
    • My personal data
    • My file didn't come through
  • Protections
    • Code Protection
      • Control Flow
        • Dynamic Control Flow
        • Duplicate Control Flow
      • Constants
        • Mutate Constants
        • Constants Melt
        • Expression Constants
        • Math Protection
      • Junk Dump
      • Invalid Metadata
      • Module Flood
    • Name Protections
      • Name Protection
      • Reference Proxy
      • Locals to Fields
      • Decompiler Crash
      • Type Scrambler
    • Code Convertion
      • Virtualization
      • Call to Calli Conversion
    • Anti Protections
      • Force Elevation
      • Anti VM
      • Anti DnSpy
      • Anti Debug
      • Anti Dump
      • Anti Tamper
      • Anti De4dot
      • Process Monitor
      • Integrity Check
    • Free Protections
      • Executable Packer
      • String Encryptor
Powered by GitBook
On this page

Was this helpful?

  1. Protections
  2. Code Protection

Control Flow

This protections "spagettifys" your code using switch statements to spread out functions which makes it harder for a reverse engineer to pin point certain methods. Control Flow also adds new numbers to help it flow but this won't affect your code's functionality. Trinity also contains additions to control flow that are explained after this.

Before Obfuscation
protected override void Dispose(bool disposing)
		{
			bool flag = disposing && this.components != null;
			if (flag)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
After Obfuscation
protected override void Dispose(bool disposing)
		{
			if (disposing)
			{
				goto IL_07;
			}
			bool flag = false;
			goto IL_95;
			int num2;
			bool flag2;
			for (;;)
			{
				IL_0C:
				uint num;
				switch ((num = (uint)<Module>.CreateActContextParametersSourceDefinitionAppid(num2)) % 8u)
				{
				case 1u:
					num2 = (int)(num * 1172348133u ^ 2329584086u);
					continue;
				case 2u:
					this.components.Dispose();
					num2 = (int)(num * 1657951307u ^ 224683761u);
					continue;
				case 3u:
					num2 = (int)(num * 1561706709u ^ 650587977u);
					continue;
				case 4u:
					num2 = (int)((flag2 ? 1870903912u : 3139233619u) ^ num * 42851580u);
					continue;
				case 5u:
					base.Dispose(disposing);
					num2 = 1106284825;
					continue;
				case 6u:
					goto IL_89;
				case 7u:
					goto IL_07;
				}
				break;
			}
			return;
			IL_89:
			flag = (this.components != null);
			goto IL_95;
			IL_07:
			num2 = -2043015332;
			goto IL_0C;
			IL_95:
			flag2 = flag;
			num2 = 1131372250;
			goto IL_0C;
		}
PreviousCode ProtectionNextDynamic Control Flow

Last updated 6 years ago

Was this helpful?