Jump to content
Tuts 4 You

rdProtect.NET


Go to solution Solved by Michidu,

Recommended Posts

Posted

Difficulty: 2-3/10
Language: .NET
Platform: .NET 4.5.2
OS Version: All
Packer/Protector: rdProtect.NET (personal obfuscator)

Description:

rdProtect.NET is the name of an old obfuscator I made a few months back. I do not use it anymore, but you might wish to have a challenge by trying to unpack an application protected by it.

Your goal is to recover the number randomization algorithm inside of this application. You can try it out by entering a number into the box below and pressing 'Generate Number'. 

Screenshot:

image.png.52ab1aad0609c9ea4081469c19188c99.png
 

UnpackMeRD-packed.exe

  • Solution
Posted (edited)
Spoiler

public static uint method_0(uint uint_0)
{
	var v1 = uint_0; //631528238
	byte[] v2 = BitConverter.GetBytes(uint_0); //1888789761
	var v3 = 0; //438342363
	var v4 = 0; //19823191
	for (;;)
	{
		var v5 = v4 < (v2[2] ^ v2[0]) >> 3; //1612296379
		if (v5 == false)
		{
			break;
		}
		switch (v3)
		{
			case 0:
				v3 = 2;
				break;
			case 1:
				v3 = 3;
				break;
			case 2:
				v3 = 1;
				break;
			case 3:
				v3 = 0;
				break;
			default:
				v3 = 0;
				break;
		}
		v1 = (uint) (v1 ^ v2[v3] * 255);
		v2[v3] &= BitConverter.GetBytes(v1)[v3];
		v1 = (uint) (v1 ^ (v3 << 4) * 255);
		v4 = v4 + 1;
	}
	var v6 = 0; //1818841449
	for (;;)
	{
		var v7 = v6 < (v2[3] ^ v2[1]) >> 1; //44451622
		if (v7 == false)
		{
			break;
		}
		v1 = smethod_0(v1, v2[0]);
		v2[0] ^= BitConverter.GetBytes(v1)[3];
		v6++;
	}
	return v1;
}

public static uint smethod_0(uint uint_0, int int_1440)
{
	return uint_0 << int_1440 | uint_0 >> 32 - int_1440;
}

 

 

Edited by Michidu
  • Like 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...