M
manmit.walia
Hello All,
I have tried multiple online tools to convert an VB6 (bas) file to
VB.NET file and no luck. I was hoping that someone could help me covert
this. I am new to the .NET world and still learning all help would be
greatly apperciated.
Attribute VB_Name = "Module1"
Option Explicit
Dim pass$
Dim Strg$
Function decrypt(ByVal H$) As String
Dim i As Integer, J$
pass$ = "THEFELDGROUP"
'H$ = the buffered encrypted data
H$ = Mid$(H$, 3, Val(Left$(H$, 2)))
' debuffer it
Strg$ = ""
For i = 1 To Len(H$) Step 2
J$ = Mid$(H$, i, 2)
Strg$ = Strg$ + Chr$(Val("&H" + J$))
Next
'Strg$ now contains the encrypted string, which you can now
'decrypt.
Call Crypt(pass$, Strg$)
'strg$ now is decrypted
decrypt = Strg$
End Function
Function Crypt(pass$, Strg$)
Dim a, b
Dim i As Integer
a = 1
For i = 1 To Len(Strg$)
b = Asc(Mid$(pass$, a, 1)): a = a + 1: If a > Len(pass$) Then a =
1
Mid$(Strg$, i, 1) = Chr$(Asc(Mid$(Strg$, i, 1)) Xor b)
Next
End Function
I have tried multiple online tools to convert an VB6 (bas) file to
VB.NET file and no luck. I was hoping that someone could help me covert
this. I am new to the .NET world and still learning all help would be
greatly apperciated.
Attribute VB_Name = "Module1"
Option Explicit
Dim pass$
Dim Strg$
Function decrypt(ByVal H$) As String
Dim i As Integer, J$
pass$ = "THEFELDGROUP"
'H$ = the buffered encrypted data
H$ = Mid$(H$, 3, Val(Left$(H$, 2)))
' debuffer it
Strg$ = ""
For i = 1 To Len(H$) Step 2
J$ = Mid$(H$, i, 2)
Strg$ = Strg$ + Chr$(Val("&H" + J$))
Next
'Strg$ now contains the encrypted string, which you can now
'decrypt.
Call Crypt(pass$, Strg$)
'strg$ now is decrypted
decrypt = Strg$
End Function
Function Crypt(pass$, Strg$)
Dim a, b
Dim i As Integer
a = 1
For i = 1 To Len(Strg$)
b = Asc(Mid$(pass$, a, 1)): a = a + 1: If a > Len(pass$) Then a =
1
Mid$(Strg$, i, 1) = Chr$(Asc(Mid$(Strg$, i, 1)) Xor b)
Next
End Function