SAP Solution key


'''''''''''''''''''''''''''''''''''''' 
'   Solution Manager Key Generator   ' 
'Save to SolManKeyGen.vbs and execute' 
'                                    ' 
'''''''''''''''''''''''''''''''''''''' 
'------------------------------------------------------- 
Dim SIDs, SNs, SERVs, msg, ENDs, KEYs 
msg="System ID (3 chr.)" 
SIDs=InputBox(msg,"Solution Manager Key Generator") 
msg="System Number (2 dig.)" 
SNs=InputBox(msg,"Solution Manager Key Generator") 
msg="Server Name (max. 15 chr.)" 
SERVs=InputBox(msg,"Solution Manager Key Generator") 
KEYs=SolManKeyGen(SIDs, SNs, SERVs) 
msg="Solution Manager Key" 
ENDs=InputBox(msg,"Solution Manager Key Generator",KEYs) 
'------------------------------------------------------- 
Function SolManKeyGen(SIDst, SNst, SERVst) 
 Dim SIDSNhex(5) 
 Dim SERVhex(15) 
 Dim reshex(5) 
 SIDSNstr = UCase(SIDst) + UCase(SNst) 
 SERVstr  = UCase(SERVst) 
 For arrcnt = 1 To 5 
  SIDSNhex(arrcnt) = Asc(Mid(SIDSNstr, arrcnt, 1)) 
 Next 
 For arrcnt = 1 To Len(SERVstr) 
  SERVhex(arrcnt) = Asc(Mid(SERVstr, arrcnt, 1)) 
 Next 
 For arrcnt = Len(SERVstr) + 1 To 15 
  SERVhex(arrcnt) = 0 
 Next 
 If (Len(SERVstr) > 0) Then 
  If (Len(SERVstr) < 5) Then 
   For arrcnt = Len(SERVstr) + 1 To 5 
    SERVhex(arrcnt) = Asc(" ") 
   Next 
  End If 
 End If 
 If (Len(SERVstr) > 5) Then 
  If (Len(SERVstr) < 10) Then 
   For arrcnt = Len(SERVstr) + 1 To 10 
    SERVhex(arrcnt) = Asc(" ") 
   Next 
  End If 
 End If 
 If (Len(SERVstr) > 10) Then 
  If (Len(SERVstr) < 15) Then 
   For arrcnt = Len(SERVstr) + 1 To 15 
    SERVhex(arrcnt) = Asc(" ") 
   Next 
  End If 
 End If 
 For arrcnt = 1 To 5 
  reshex(arrcnt) = ((((0 Xor SIDSNhex(arrcnt)) Xor SERVhex(arrcnt)) Xor SERVhex(arrcnt + 5)) Xor SERVhex(arrcnt + 10)) 
 Next 
 reshex(1) = reshex(1) Xor 84  Xor 0 
 reshex(2) = reshex(2) Xor 131 Xor 11 
 reshex(3) = reshex(3) Xor 194 Xor 46 
 reshex(4) = reshex(4) Xor 52  Xor 105 
 reshex(5) = reshex(5) Xor 119 Xor 188 
 hexstr = "0123456789ABCDEF" 
 resstr = "" 
 For arrcnt = 1 To 5 
  hihex = reshex(arrcnt) \ 16 
  lohex = reshex(arrcnt) Mod 16 
  resstr = resstr + Mid(hexstr, hihex + 1, 1) + Mid(hexstr, lohex + 1, 1) 
 Next 
 SolManKeyGen = resstr 
End Function 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值