Reverse Engineering RET Homepage RET Members Reverse Engineering Projects Reverse Engineering Papers Reversing Challenges Reverser Tools RET Re-Search Engine Reverse Engineering Forum Reverse Engineering Links

Go Back   Reverse Engineering Team Board > Reverse Engineering Board > .NET Reverse Engineering
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 09-06-2008, 03:15 AM
Nixkap Nixkap is offline
Junior Member
 
Join Date: Sep 2008
Posts: 1
Lightbulb Understand the "Generate License Code" Mechanism

Hi Guys,

Here is the deal:

We are talking about a soft called NetWrix Inactive Users Tracker

I've been able to crack the commercial version but I'd like to know how to generate the S/N for it as I we can see the Generate License Code Mechanism in .Net Reflector. ( Here is a screenshot of the registration box )



In C# :

public string GenerateLicenseCode(string name, string count, string product, string time)
{
string str = (name + count + product).GetHashCode().ToString();
str = time + str;
byte[] inArray = new byte[str.Length];
long num = 0L;
foreach (char ch in str)
{
byte num2 = 0x23;
inArray[(int) ((IntPtr) num)] = (byte) (ch ^ num2);
num += 1L;
}
return Convert.ToBase64String(inArray).Substring(0, 20);
}



In VB :

Public Function GenerateLicenseCode(ByVal name As String, ByVal count As String, ByVal product As String, ByVal time As String) As String
Dim str As String = (name & count & product).GetHashCode.ToString
str = (time & str)
Dim inArray As Byte() = New Byte(str.Length - 1) {}
Dim num As Long = 0
Dim ch As Char
For Each ch In str
Dim num2 As Byte = &H23
inArray(CInt(DirectCast(num, IntPtr))) = CByte((ch Xor num2))
num = (num + 1)
Next
Return Convert.ToBase64String(inArray).Substring(0, 20)
End Function

If someone could help me or at least give me some more info, that would be great.

Cheers guys and keep up the good work
Reply With Quote
  #2  
Old 09-08-2008, 05:27 AM
sirp sirp is offline
Senior Member
 
Join Date: Apr 2008
Posts: 76
Default

easy stuff....

string str = (name + count + product).GetHashCode().ToString();

---gets a hashcode as a string from name+count+product

str = time + str;

---adds the string str to the string time

byte[] inArray = new byte[str.Length];

---a byte Array for the string

long num = 0L;


foreach (char ch in str)
{
byte num2 = 0x23;
inArray[(int) ((IntPtr) num)] = (byte) (ch ^ num2);

---byte array gets filled with Character ch xor num2

num += 1L;

---num = num +1L

}

---and now we encode that string with base64 and get the first
---20 chars as an substring
return Convert.ToBase64String(inArray).Substring(0, 20);
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump





Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.