Jump to content
Tuts 4 You

4 Different KeyGenMe's


cawk

Recommended Posts

Platform: windows
Language : .NET
Difficulty : ranges
Protection : theres files with agile,ilprotector,eazfuscator and appfuscator

Description : 
thought it was time for something to be posted on this forum

so here is the same keygenme(some values changed per file) that are protected by obfuscators above

READ INFO.TXT 

for some further information

Goals :

Gold : unpack them 

Silver : keygen

Bronze : valid key for your username


Rules : 
no patching or brute forcing 

https://gyazo.com/230bc896a03685c9b9365de5bee5e195

 

Results 
divide - Gold for appfuscator

Michidu - Gold for ilprotector


Download: 
attached

KeyGens.rar

Edited by cawk (see edit history)
Link to post

Appfuscator Solution
 

Spoiler

 

AAAA}AA}AA

Divide}A}AAAA}AA}A

 

 Appfuscator Keygen Code

Spoiler

        private static void Main(string[] args)
        {
            for (int i = 0; i < 10; i++)
            {
                string txt2 = RandomString(8) + "}A}AAAA}AA}A"; ;
                char[] txt1Chars = { 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A' };

                txt1Chars[1] = txt2[txt2.Length - 1];
                txt1Chars[7] = txt2[txt2.Length - 2];
                txt1Chars[2] = txt2[txt2.Length - 3];
                txt1Chars[3] = txt2[txt2.Length - 4];
                txt1Chars[4] = txt2[txt2.Length - 5];
                txt1Chars[3] = txt2[txt2.Length - 7];

                string txt1 = new string(txt1Chars);

                Console.WriteLine(Check(txt1, txt2) ? "PASSED" : "FAILED");
                Console.WriteLine($"1: {txt1}");
                Console.WriteLine($"2: {txt2}");
                Console.WriteLine();
            }

            Console.ReadKey();
        }

        private static readonly Random r = new Random();

        private static string RandomString(int length)
        {
            const string chars = "ABCDEFGHJKLMNPQRSTUVWXYZ0123456789";
            return new string(Enumerable.Repeat(chars, length)
              .Select(s => s[r.Next(s.Length)]).ToArray());
        }

 

Thanks for the challenge! I'll try the other ones.

Appfuscator KeyGenMe (Unpacked).zip

Edited by Divide (see edit history)
  • Like 2
Link to post
2 hours ago, Divide said:

Appfuscator Solution
 

  Hide contents

 

AAAA}AA}AA

Divide}A}AAAA}AA}A

 

 Appfuscator Keygen Code

  Hide contents


        private static void Main(string[] args)
        {
            for (int i = 0; i < 10; i++)
            {
                string txt2 = RandomString(8) + "}A}AAAA}AA}A"; ;
                char[] txt1Chars = { 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A' };

                txt1Chars[1] = txt2[txt2.Length - 1];
                txt1Chars[7] = txt2[txt2.Length - 2];
                txt1Chars[2] = txt2[txt2.Length - 3];
                txt1Chars[3] = txt2[txt2.Length - 4];
                txt1Chars[4] = txt2[txt2.Length - 5];
                txt1Chars[3] = txt2[txt2.Length - 7];

                string txt1 = new string(txt1Chars);

                Console.WriteLine(Check(txt1, txt2) ? "PASSED" : "FAILED");
                Console.WriteLine($"1: {txt1}");
                Console.WriteLine($"2: {txt2}");
                Console.WriteLine();
            }

            Console.ReadKey();
        }

        private static readonly Random r = new Random();

        private static string RandomString(int length)
        {
            const string chars = "ABCDEFGHJKLMNPQRSTUVWXYZ0123456789";
            return new string(Enumerable.Repeat(chars, length)
              .Select(s => s[r.Next(s.Length)]).ToArray());
        }

 

Thanks for the challenge! I'll try the other ones.

Appfuscator KeyGenMe (Unpacked).zip

Nice work 

Few methods still some encryption for the most part brilliant work

 

Gold

  • Like 1
Link to post

Yeah the unpack isn't great, but I stopped when it was done enough to keygen it. Only used CC's tools, haven't done anything myself yet.

It's nice to see some more .NET challenges here, thanks again for posting them.

  • Like 1
Link to post
30 minutes ago, Divide said:

Yeah the unpack isn't great, but I stopped when it was done enough to keygen it. Only used CC's tools, haven't done anything myself yet.

It's nice to see some more .NET challenges here, thanks again for posting them.

next one id advise to try is the agile.NET one

 

de4dot is very close to working on this file 

  • Like 1
Link to post

Unpacked ILProtector.

Keygen is almost same (i just changed a few things from previous solution).

Spoiler

public static void Main(string[] args)
        {
            for(int i = 0; i < 10; i++)
            {
                string key = RandomString(8) + "}A}A}A}A";
                char[] nameChars = { 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A' };

                nameChars[1] = key[key.Length - 1];
                nameChars[7] = key[key.Length - 2];
                nameChars[2] = key[key.Length - 3];
                nameChars[3] = key[key.Length - 4];
                nameChars[4] = key[key.Length - 5];
                nameChars[0] = key[key.Length - 6];

                string name = new string(nameChars);

                Console.WriteLine($"1: {name}");
                Console.WriteLine($"2: {key}");
                Console.WriteLine();
            }

            Console.ReadKey();
        }
        private static readonly Random r = new Random();

        private static string RandomString(int length)
        {
            const string chars = "ABCDEFGHJKLMNPQRSTUVWXYZ0123456789";
            return new string(Enumerable.Repeat(chars, length)
                .Select(s => s[r.Next(s.Length)]).ToArray());
        }

 

 

ILProtector_KeyGenMe_Unpacked.rar

  • Like 2
Link to post

Agile

Can't test this because the Agile trial has expired now, but this should work:

A}AAAAA}AA
2RFB0YS4}A}A}A}A

 

Spoiler



string key = RandomString(8) + "}A}A}A}A";
char[] nameChars = { 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A' };

nameChars[5] = key[key.Length - 1];
nameChars[7] = key[key.Length - 2];
nameChars[2] = key[key.Length - 3];
nameChars[1] = key[key.Length - 4];
nameChars[4] = key[key.Length - 5];
nameChars[2] = key[key.Length - 7];

string name = new string(nameChars);

Console.WriteLine($"1: {name}");
Console.WriteLine($"2: {key}");


 

I fixed de4dot to handle the new Agile, but need to add in stelem/ldelem support as any methods with these opcodes will fail to devirtualize.

  • Like 2
Link to post
On 10/26/2017 at 11:31 PM, Divide said:

Agile

Can't test this because the Agile trial has expired now, but this should work:

A}AAAAA}AA
2RFB0YS4}A}A}A}A

 

  Hide contents

 



string key = RandomString(8) + "}A}A}A}A";
char[] nameChars = { 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A' };

nameChars[5] = key[key.Length - 1];
nameChars[7] = key[key.Length - 2];
nameChars[2] = key[key.Length - 3];
nameChars[1] = key[key.Length - 4];
nameChars[4] = key[key.Length - 5];
nameChars[2] = key[key.Length - 7];

string name = new string(nameChars);

Console.WriteLine($"1: {name}");
Console.WriteLine($"2: {key}");

 

 

 

 

I fixed de4dot to handle the new Agile, but need to add in stelem/ldelem support as any methods with these opcodes will fail to devirtualize.

Excellent Work

Link to post

Deobfuscated Eazfuscator.

Spoiler

string key = RandomString(8) + "}A}A}A}A";
char[] nameChars = { 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A' };

nameChars[5] = key[key.Length - 1];
nameChars[7] = key[key.Length - 2];
nameChars[2] = key[key.Length - 3];
nameChars[1] = key[key.Length - 4];
nameChars[4] = key[key.Length - 5];
nameChars[2] = key[key.Length - 7];

string name = new string(nameChars);

Console.WriteLine($"1: {name}");
Console.WriteLine($"2: {key}");

 

 

KeyGenMe-devirtualized.exe

  • Like 2
Link to post

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...