Public Sub Proc_1_0_405730
'Data Table: 402C8C
Dim var_D0 As Integer
Dim var_E4 As Variant
Dim var_88 As TextBox
loc_4051E4: Set var_88 = MemVar_406008.Text4
loc_40520C: Me(68) = Replace(frmMain.Text4.Text, "-", vbNullString, 1, -1, 0)
loc_40521C: Me(76) = CStr(0)
loc_405230: For var_90 = 1 To CInt(Len(Me(68))): Me(96) = var_90 'Integer
loc_405257: Me(72) = CStr(Mid$(Me(68), CLng(Me(96)), 1))
loc_405279: Me(76) = CStr((CDbl(Asc(Me(72))) + CDbl(Me(76))))
loc_405284: Next var_90 'Integer
loc_40528D: Me(80) = CStr(0)
loc_4052A6: Set var_88 = MemVar_406008.Text1
loc_4052BC: For var_D4 = 1 To CInt(Len(frmMain.Text1.Text)): Me(98) = var_D4 'Integer
loc_4052CE: Set var_88 = MemVar_406008.Text1
loc_4052F6: Me(84) = CStr(Mid$(CVar(frmMain.Text1.Text), CLng(Me(98)), 1))
loc_40531D: Me(80) = CStr((CDbl(Asc(Me(84))) + CDbl(Me(80))))
loc_405328: Next var_D4 'Integer
loc_405331: Me(88) = CStr(0)
loc_40534A: Set var_88 = MemVar_406008.Text2
loc_405360: For var_E8 = 1 To CInt(Len(frmMain.Text2.Text)): Me(100) = var_E8 'Integer
loc_405372: Set var_88 = MemVar_406008.Text2
loc_40539A: Me(92) = CStr(Mid$(CVar(frmMain.Text2.Text), CLng(Me(100)), 1))
loc_4053C1: Me(88) = CStr((CDbl(Asc(Me(92))) + CDbl(Me(88))))
loc_4053CC: Next var_E8 'Integer
loc_4053DD: Set var_88 = MemVar_406008.Text1
loc_405424: Me(104) = CStr(Mid$(CVar(Replace(frmMain.Text1.Text, " ", vbNullString, 1, -1, 0)), 4, 2))
loc_405449: Set var_88 = MemVar_406008.Text2
loc_405490: Me(108) = CStr(Mid$(CVar(Replace(frmMain.Text2.Text, " ", vbNullString, 1, -1, 0)), 5, 3))
loc_4054B5: Set var_88 = MemVar_406008.Text4
loc_4054FC: Me(112) = CStr(Mid$(CVar(Replace(frmMain.Text4.Text, " ", vbNullString, 1, -1, 0)), 5, 3))
loc_405521: Set var_88 = MemVar_406008.Text3
loc_40552F: var_E4 = CVar(frmMain.Text3.Text) 'String
loc_40558C: var_D0 = Ucase(CVar("34" & Me(112) & "-" & Me(76) & StrReverse(Me(80)) & "-" & Me(108) & Me(88) & "-" & Me(104)))
loc_4055B7: If CBool(var_E4 <> var_D0) Then
loc_4055D3: MsgBox "Incorrect Serial Number!", 0, var_D0, var_E4, var_11C
loc_4055EF: Set var_88 = MemVar_406008.Text1
loc_4055F5: frmMain.Text1.Text = vbNullString
loc_405609: Set var_88 = MemVar_406008.Text2
loc_40560F: frmMain.Text2.Text = vbNullString
loc_405623: Set var_88 = MemVar_406008.Text3
loc_405629: frmMain.Text3.Text = vbNullString
loc_405631: Exit Sub
loc_405635: Else
loc_405646: (0).Visible = %x1b
loc_405659: Set var_88 = MemVar_406008.Text2
loc_40565F: frmMain.Text2.Visible = False
loc_405672: Set var_88 = MemVar_406008.Text3
loc_405678: frmMain.Text3.Visible = False
loc_40568B: Set var_88 = MemVar_406008.Text4
loc_405691: frmMain.Text4.Visible = False
loc_4056A4: Set var_88 = MemVar_406008.Label1
loc_4056AA: frmMain.Label1.Visible = False
loc_4056BD: Set var_88 = MemVar_406008.Label2
loc_4056C3: frmMain.Label2.Visible = False
loc_4056D6: Set var_88 = MemVar_406008.Label3
loc_4056DC: frmMain.Label3.Visible = False
loc_4056EF: Set var_88 = MemVar_406008.Label4
loc_4056F5: frmMain.Label4.Visible = False
loc_405708: Set var_88 = MemVar_406008.cmdCheck
loc_40570E: frmMain.cmdCheck.Visible = False
loc_405721: Set var_88 = MemVar_406008.Label5
loc_405727: frmMain.Label5.Visible = True
loc_40572F: End If
loc_40572F: Exit Sub
End Sub
跟据以上反编译代码,实现序列号的计算过程如下:
[Visual Basic] 纯文本查看复制代码
Public Function getSerial(unique As String, name As String, company As String) As String
Dim i As Long, j As Long, k As Long
Dim s1 As String, s2 As String, s3 As String, s4 As String
Dim s5 As String, s6 As String, s7 As String, s8 As String
Dim ss1 As Long, ss2 As Long, ss3 As Long
s1 = Replace(unique, "-", vbNullString, 1, -1, vbBinaryCompare)
ss1 = 0
For i = 1 To Len(s1)
ss1 = ss1 + Asc(Mid(s1, i, 1))
Next i
ss2 = 0
For i = 1 To Len(name)
ss2 = ss2 + Asc(Mid(name, i, 1))
Next i
ss3 = 0
For i = 1 To Len(company)
ss3 = ss3 + Asc(Mid(company, i, 1))
Next i
s3 = Replace(name, " ", vbNullString, 1, -1, vbBinaryCompare)
s4 = Mid(s3, 4, 2)
s5 = Replace(company, " ", vbNullString, 1, -1, vbBinaryCompare)
s6 = Mid(s5, 5, 3)
s7 = Replace(unique, " ", vbNullString, 1, -1, vbBinaryCompare)
s8 = Mid(s7, 5, 3)
getSerial = UCase("34" & s8 & "-" & CStr(ss1) & StrReverse(ss2) & "-" & s6 & ss3 & "-" & s4)
' clipboard
VB.Clipboard.Clear
VB.Clipboard.SetText getSerial, vbCFText
End Function
Sub button1_Click()
Dim i As Long, n As Long
Dim name As String, name1 As String, base As String, sn As String
name = Sheet1.Cells(4, 4)
If name = "" Then
MsgBox "Please inter a name!", vbOKOnly, "ERROR"
Exit Sub
End If
While Len(name) < 6
name = name & name
Wend
sn = ""
'base = "234567"
For i = 1 To 6 Step 1
'sn = sn & (Val(Mid(base, i, 1)) + Asc(Mid(name, i, 1)))
sn = sn & ((i + 1) + Asc(Mid(name, i, 1)))
Next i
n = Len(sn)
If n < 12 Then
sn = String(12 - n, "0") & sn
End If
If n > 12 Then
sn = Left(sn, 12)
End If
Sheet1.Cells(5, 4) = sn
Range("D5").Select
Selection.Copy '可能有回车符的问题,复制出去的字符串后面带有隐藏的 vbCrLf,需要手动删除这2个不可见字符。
End Sub
并在 Excel 中做一个界面,如下图所示:
计算序列号并输入 CrackMe,如下:
点 "register",得到:
另外,如果用 OD 进行动态跟踪,核对算法的话,CrackMe 中有一个定时器事件,其代码会引发浮点精度的异常,当OD会断下来时,用 Shift+F9 忽略就可以了,就不会再对调试过程产生干扰了。
完毕!!!