我用pbkiller反编译了一个pb程序,找到了它的注册码计算部分,但看不懂它的算法,哪位高手帮忙总结出算法或者用vb描述一下,我只略懂vb,不胜感激!
我的机器码:62615256
下面的代码供参考
(1)
string ls_disk_serialno
gf_center_window(this)
istr_parm = message.powerobjectparm
istr_parm.b_data[1] = false
ls_disk_serialno = trim(getdiskser())
is_serialno = mid(gf_encrypt_numb8("SRE" + ls_disk_serialno),1,8)
em_serialno.text = is_serialno
is_regist_code = mid(gf_encrypt_numb8(is_serialno),1,8)
postevent("ue_regist_check")
return
(2)检查注册码
string ls_disk_serialno
string ls_sys_serialno
string ls_sys_registno
string ls_reg_registno
string ls_reg_serialno
integer li_ret
ls_disk_serialno = trim(getdiskser())
ls_sys_serialno = mid(gf_encrypt_numb8("SRE" + ls_disk_serialno),1,8)
ls_sys_registno = mid(gf_encrypt_numb8(ls_sys_serialno),1,8)
li_ret = registryget("HKEY_CURRENT_USER\Software\Microsoft\UserSetup\Settings\Sunreg\TJ2005","SerailNo",regstring!,ls_reg_serialno)
li_ret = registryget("HKEY_CURRENT_USER\Software\Microsoft\UserSetup\Settings\Sunreg\TJ2005","RegistKey",regstring!,ls_reg_registno)
if isnull(ls_reg_serialno) then
ls_reg_serialno = ""
end if
if isnull(ls_reg_registno) then
ls_reg_registno = ""
end if
if ls_sys_serialno <> ls_reg_serialno then
else
if ls_sys_registno <> ls_reg_registno then
else
em_serialno.text = ls_reg_serialno
em_serialno.displayonly = true
em_register_code.text = ls_reg_registno
em_register_code.displayonly = true
cb_regist.enabled = false
messagebox("提示","软件已注册,无需再进行注册!")
end if
end if
return
(3)gf_encrypt_numb8函数部分
string ls_return
string ls_str = ""
string ls_char_head
string ls_char_bottom
string ls_char
string ls_old_char
string ls_temp
integer i
integer j
integer li_count
integer li_asc
integer li_old_asc
long ll_tmp
integer li_encrypt_table[]
string ls_zimu[]={"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"}
integer li_numb[]={9,0,1,5,8,7,2,6,0,3,3,4,1,9,0,8,6,5,2,4,3,1,7,5,9,2}
li_encrypt_table[] = {16,14,15,13,3,1,5,2,4,7,12,9}
if len(ar_data) < 39 then
ar_data = space(39 - len(ar_data)) + ar_data
end if
ar_data = mid(ar_data,1,39)
li_count = len(ar_data)
for i = 1 to integer(li_count / 2)
ls_char_head = mid(ar_data,i,1)
ls_char_bottom = mid(ar_data,li_count - i + 1)
ll_tmp = ll_tmp + pi(1) + asc(ls_char_head) * pi(3) + sin(asc(ls_char_head)) * 987 + asc(ls_char_bottom) * pi(7)
next
for i = 1 to li_count
ls_char = mid(ar_data,i,1)
li_asc = mod(ll_tmp / (asc(ls_char) + 1) + asc(mid(ar_data,li_count - i + 1)) * asc(mid(ar_data,li_count - i + 1)),256)
choose case li_asc
case 0 to 64
if mod(li_asc,2) = 0 then
li_asc = mod(li_asc,19) + 65
else
li_asc = mod(li_asc,26) + 65
end if
case 91 to 96
if mod(li_asc,2) = 0 then
li_asc = mod(li_asc,17) + 65
else
li_asc = mod(li_asc,26) + 65
end if
case IS > 122
if mod(li_asc,2) = 1 then
li_asc = mod(li_asc,23) + 65
else
li_asc = mod(li_asc,26) + 65
end if
end choose
ls_char = upper(char(li_asc))
if ls_char = ls_old_char then
ls_char = upper(char(65 + mod(asc(mid(ar_data,li_count - i + 1)),26)))
end if
if upper(ls_char) = "Z" then
ls_char = "D"
end if
if ls_char = ls_old_char then
ls_char = char(asc(ls_char) + 1)
end if
ls_str = ls_str + ls_char
ls_old_char = ls_char
next
for i = 1 to upperbound(li_encrypt_table)
ls_return = ls_return + mid(ls_str,li_encrypt_table[i],1)
next
ls_temp = ls_return
ls_return = ""
for i = 1 to len(ls_temp)
ls_char = mid(ls_temp,i,1)
for j = 1 to 26
if ls_zimu[j] = ls_char then
exit
end if
next
if string(li_numb[j]) = right(ls_return,1) then
ls_return = ls_return + string(i)
else
ls_return = ls_return + string(li_numb[j])
end if
next
return ls_return
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!