![]() |
![]() |
![]() |
![]() |
![]() |
||||||||||
|
||||||||||||||
![]() |
#1
|
|||
|
|||
![]() 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 ![]() |
#2
|
|||
|
|||
![]() 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); |