一个VB.NET写的ERP小软件,已付费买了正版,但每次电脑换硬件都要提交机器码重新申请一个注册码,走程序麻烦不说,主要是时间经常上被拖,严重影响生产。于是每次都用OD在内存中直接找出注册码,最近兴起逆向找出原码,想写个注册机一劳永逸,可惜本人小白,看不懂了。只知道 productName 是四位固定纯字母, hardwareID是8位纯数字机器码,
generateKey验证所产生的注册码,由数字和大写字母组成,格式为AA11-BB22-AAA1-BBB2的16位四组码,请高手帮忙具体解释一下这个算法,以帮助我写出注册机,谢谢
Private Function computeMD5Hash(ByVal sData As String, ByVal sChars As String, ByVal iLength As Integer) As String
Dim bytes As Byte()
Dim buffer2 As Byte()
Dim provider As New MD5CryptoServiceProvider
Dim str2 As String = String.Empty
Try
bytes = Encoding.ASCII.GetBytes(sData)
buffer2 = provider.ComputeHash(bytes)
Dim num3 As Integer = (iLength - 1)
Dim i As Integer = 0
Do While (i <= num3)
Dim num As Integer = (buffer2(i) Mod sChars.Length)
str2 = (str2 & Strings.Mid(sChars, (num + 1), 1))
i += 1
Loop
Catch exception1 As Exception
ProjectData.SetProjectError(exception1)
Dim exception As Exception = exception1
Dim str As String = String.Empty
ProjectData.ClearProjectError
Return str
Finally
bytes = Nothing
buffer2 = Nothing
provider = Nothing
End Try
Return str2
End Function
Private Function generateKey(ByVal productName As String, ByVal hardwareID As String) As String
Dim str3 As String
Dim str2 As String = Me.computeMD5Hash((productName & hardwareID), "0123456789ABCDEFGHJKLMNPQRTUVWXY", &H10)
Dim num As Integer = 1
Do
str3 = (str3 & Strings.Mid(str2, num, 4) & "-")
num = (num + 4)
Loop While (num <= &H10)
Return str3.Substring(0, (str3.Length - 1))
End Function
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课