VB 写了一个解码程序 需要重新写成java或者c
今天遇到一个密码解析程序是用vb写的!但是我对vb不了解尤其是对其中的函数变量定义什么的,我希望好心人能帮我把下面的vb程序装换为java或者c的方法,程序如下:原为地址是
http://www.eve-software.com/security/ueditpw.html
' Masterkey. Taken from the UltraEdt.exe
Private Const Masterkey = "sdfkh we;34u[ jwef "
'Decode a single character
Public Function UEDecode(i_Asc, ByVal i_Pos As Integer)
i_Pos = i_Pos Mod 19
If i_Pos = 0 Then i_Pos = 19
UEDecode = ((Not i_Asc) And Asc(Mid(Masterkey, i_Pos, 1))) + (i_Asc And ((Not Asc(Mid(Masterkey, i_Pos, 1))) And 127))
End Function
'Decode password
Public Function UEDecodeString(str_password As String)
Dim i As Integer
UEDecodeString = ""
For i = 1 To (Len(str_password) / 2)
UEDecodeString = UEDecodeString + Chr$(UEDecode(Val("&H" + Mid(str_password, (2 * (i - 1)) + 1, 2)), i))
Next i
End Function
如果哪位好心人能帮我转换为java/c,我实在感激不尽,由于这个段代码如果能够解码UltraEdt存UltraEdt.ini中的ftp密码,因为我们这个东西对我来说确实蛮重要的!期待朋友们的帮助!
谢谢!