Nov 23, 2014 06:43 PM
(This post was last modified: Nov 23, 2014 06:44 PM by nathan72389.)
so here is the scoop.
view FF history
view FF entered form data
my setup:
FF 33.1.1
Win 7 x86
![[Image: mrUWtaF.png]](https://i.imgur.com/mrUWtaF.png)
you first need this class, not mine, credits were left as is.
ok, add all that to your project then we will start with the form
kk, just add a listview, set it to: view mode = details
add 2 columns, "url" and "title". dock in parent container.
like such:
![[Image: AfpDyQa.png]](https://i.imgur.com/AfpDyQa.png)
k done. next code.
first we need to find FF's profile directory and locate the "places.sqlite" file.
so...
kk, check if the dir exists and move on k.
right, so now we loop through each directory in the profiles directory to find the file(places.sqlite) we want.
we have found the file that we need so now lets setup a new sqlite reader for it.
read the table moz_places because this contains all the info we need.
now irritate through the rows to get each individual entry.
i used a generic check here to see if it was a url because i was ending up with some other garbage mixed in there along with the data i needed.
right so, here we just make the listview item and insert it at index 0. i did this because the last history entry was at the bottom. its just my shitty way of reversing the list. (think newest first)
oh, and, getvalue(i #) where #1 is the url, and #2 is the page title. there are more numbers (up to 7 i think) like number of visits, last visit timestamp, other bs. that i dont care about.
now lets close up everything. i threw away all the errors because. fuck you that why.
kk, so now just debug your app and if everything is correct wait about 8 - 10 seconds and it should look like this:
![[Image: 8FS2hRS.png]](https://i.imgur.com/8FS2hRS.png)
if you run into an error on the first run about
just comment out this block in the sqlitehandler file
right on
I added another sub in there to handle visiting of the urls, its simply using the double click event of the listview. all i do here is check if there is something selected, if so, change the back color and start the url.
all that being said here is the full code:
kk.
now.
next up is the form data.
for those that dont understand what this is, i will give a quick explanation.
when you start typing in a box online and it gives you the opportunity to select something you have already entered, thats the form data.
so lets go get that.
keep all the same code, lets just change a few things.
the file we need is not places.sqlite.
no, we need formhistory.sqlite.
got it?
next we need a new table name
rather than moz_places.
we need moz_formhistory
easy easy
we can keep the getvalue(i #), #'s being 1 and 2
as with the history, there are other values that can be used here, but these are going to suit us for now.
also remove the IF block to check if its a url
you should get something like this:
![[Image: mAJSPCh.png]](https://i.imgur.com/mAJSPCh.png)
thats it.
there are more tables and values that you can search for and stuff. pwds are stored in logins.json but are encrypted so i didnt even bother adding anything about it.
enjoy.
if you have any problems, deal with it on your own.
**edited for minor tyops
view FF history
view FF entered form data
my setup:
FF 33.1.1
Win 7 x86
![[Image: mrUWtaF.png]](https://i.imgur.com/mrUWtaF.png)
you first need this class, not mine, credits were left as is.
Code
pastebin, due to message too long
http://pastebin.com/LiABqXH0ok, add all that to your project then we will start with the form
kk, just add a listview, set it to: view mode = details
add 2 columns, "url" and "title". dock in parent container.
like such:
![[Image: AfpDyQa.png]](https://i.imgur.com/AfpDyQa.png)
k done. next code.
first we need to find FF's profile directory and locate the "places.sqlite" file.
so...
Code
Dim FFpath As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\Mozilla\Firefox\Profiles\"
If IO.Directory.Exists(FFpath) ThenCode
For Each fldr As String In IO.Directory.GetDirectories(FFpath)
If IO.File.Exists(fldr & "\places.sqlite") Then
Dim historyFile As String = fldr & "\places.sqlite"right, so now we loop through each directory in the profiles directory to find the file(places.sqlite) we want.
Code
Dim sqlReader As New SQLiteHandler(historyFile)we have found the file that we need so now lets setup a new sqlite reader for it.
Code
If sqlReader.ReadTable("moz_places") Then
Try
For i As Integer = 0 To sqlReader.GetRowCount - 1
If sqlReader.GetValue(i, 1).ToLower.StartsWith("ht") Thenread the table moz_places because this contains all the info we need.
now irritate through the rows to get each individual entry.
i used a generic check here to see if it was a url because i was ending up with some other garbage mixed in there along with the data i needed.
Code
Dim v As New ListViewItem
With v
.Text = sqlReader.GetValue(i, 1)
.SubItems.Add(sqlReader.GetValue(i, 2))
ListView1.Items.Insert(0, v)
End Withright so, here we just make the listview item and insert it at index 0. i did this because the last history entry was at the bottom. its just my shitty way of reversing the list. (think newest first)
oh, and, getvalue(i #) where #1 is the url, and #2 is the page title. there are more numbers (up to 7 i think) like number of visits, last visit timestamp, other bs. that i dont care about.
Code
End If
Next
Catch ex As Exception
End Try
End If
End If
Next
End Ifnow lets close up everything. i threw away all the errors because. fuck you that why.
kk, so now just debug your app and if everything is correct wait about 8 - 10 seconds and it should look like this:
![[Image: 8FS2hRS.png]](https://i.imgur.com/8FS2hRS.png)
if you run into an error on the first run about
Quote:No supported Schema layer file-format
just comment out this block in the sqlitehandler file
Code
'If db_bytes(52) <> 0 Then
' Throw New Exception("Auto-vacuum capable database is not supported")
' End
'ElseIf ConvertToInteger(44, 4) >= 4 Then
' Throw New Exception("No supported Schema layer file-format")
' End
'End Ifright on
Code
Private Sub ListView1_DoubleClick(sender As Object, e As EventArgs) Handles ListView1.DoubleClick
If ListView1.SelectedItems.Count = 1 Then
ListView1.SelectedItems(0).BackColor = Color.LightBlue
Process.Start(ListView1.SelectedItems(0).Text)
End If
End SubI added another sub in there to handle visiting of the urls, its simply using the double click event of the listview. all i do here is check if there is something selected, if so, change the back color and start the url.
all that being said here is the full code:
Code
Public Class Form1
'moz_formhistory
'formhistory.sqlite
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim FFpath As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\Mozilla\Firefox\Profiles\"
If IO.Directory.Exists(FFpath) Then
For Each fldr As String In IO.Directory.GetDirectories(FFpath)
If IO.File.Exists(fldr & "\formhistory.sqlite") Then
Dim historyFile As String = fldr & "\formhistory.sqlite"
Dim sqlReader As New SQLiteHandler(historyFile)
If sqlReader.ReadTable("moz_formhistory") Then
Try
For i As Integer = 0 To sqlReader.GetRowCount - 1
If sqlReader.GetValue(i, 1).ToLower.StartsWith("ht") Then
Dim v As New ListViewItem
With v
.Text = sqlReader.GetValue(i, 1)
.SubItems.Add(sqlReader.GetValue(i, 2))
ListView1.Items.Insert(0, v)
End With
End If
Next
Catch ex As Exception
End Try
End If
End If
Next
End If
End Sub
Private Sub ListView1_DoubleClick(sender As Object, e As EventArgs) Handles ListView1.DoubleClick
If ListView1.SelectedItems.Count = 1 Then
ListView1.SelectedItems(0).BackColor = Color.LightBlue
Process.Start(ListView1.SelectedItems(0).Text)
End If
End Sub
End Classkk.
now.
next up is the form data.
for those that dont understand what this is, i will give a quick explanation.
when you start typing in a box online and it gives you the opportunity to select something you have already entered, thats the form data.
so lets go get that.
keep all the same code, lets just change a few things.
the file we need is not places.sqlite.
no, we need formhistory.sqlite.
got it?
next we need a new table name
rather than moz_places.
we need moz_formhistory
easy easy
we can keep the getvalue(i #), #'s being 1 and 2
as with the history, there are other values that can be used here, but these are going to suit us for now.
also remove the IF block to check if its a url
you should get something like this:
![[Image: mAJSPCh.png]](https://i.imgur.com/mAJSPCh.png)
thats it.
there are more tables and values that you can search for and stuff. pwds are stored in logins.json but are encrypted so i didnt even bother adding anything about it.
enjoy.
if you have any problems, deal with it on your own.
**edited for minor tyops



