Jump to content

Recommended Posts

Posted (edited)

hey guys. I think my problem is why my SQL statement, which means im screwed because i suck with SQL. I keep getting errors that are different depending if i change the SQL statement.

#include <SQLite.au3>
#include <SQLite.dll.au3>
#include <array.au3>

Local $aResult, $iRows, $iColumns, $iRval

_SQLite_Startup()

_SQLite_Open("C:UsersUSERNAMEAppDataRoamingMozillaFirefoxProfilesMUMBOJUMBO.defaultcookies.sqlite")

$iRval = _SQLite_GetTable2d(-1, "SELECT * FROM *;", $aResult, $iRows, $iColumns)
If $iRval = $SQLITE_OK Then
   _SQLite_Display2DResult($aResult)

Else
   MsgBox(16, "SQLite Error: " & $iRval, _SQLite_ErrMsg())
EndIf

_SQLite_Close()
_SQLite_Shutdown()

trying to pull cookie data from firefox's cookie.sqlite and having no luck at all

Edited by RedneckTech
Posted

No, your query is good. Not efficient but it's good.

For one, you're not using the handle from _SQLite_Open. UDFs do not behave the same as built-in functions in that respect. So:

Local $hDB = _SQLite_Open("C:UsersUSERNAMEAppDataRoamingMozillaFirefoxProfilesMUMBOJUMBO.defaultcookies.sqlite")
$iRval = _SQLite_GetTable2d($hDB, "SELECT * FROM *;", $aResult, $iRows, $iColumns)

Try that.

And maybe this Python script could be helpful as well for your query extract cookies.sqlite.

[center]Spiderskank Spiderskank[/center]GetOpt Parse command line options UDF | AU3Text Program internationalization UDF | Identicon visual hash UDF

Posted

No, your query is good. Not efficient but it's good.

any way i can make this less "Not efficient"? that you know of? my knowledge of SQL is making a backup that just grows till its 150GB and has to be deleted and another run manually lol

Posted

Mmh, maybe I was a bit hasty, been a while since I dabbled in SQL... I believe there are no wildcards allowed in the FROM clause. Change that to moz_cookies and try again.

"SELECT * FROM moz_cookies;"

Well using wildcard * in your query means get everything, in this case the entire table. If that's what you want then ok. But usually you only want a few columns from a single row to work with.

"SELECT host, path, isSecure, expiry, name, value FROM moz_cookies" ; will return all specified columns from all rows.
"SELECT isSecure FROM moz_cookies" ; will only return the isSecure column from all rows.
"SELECT name, value FROM moz_cookies WHERE name = 'dany' LIMIT 1" ; Get the value for where name is dany and return only one row.

[center]Spiderskank Spiderskank[/center]GetOpt Parse command line options UDF | AU3Text Program internationalization UDF | Identicon visual hash UDF

Posted

well now the script looks like this.

#include <SQLite.au3>
#include <SQLite.dll.au3>
#include <array.au3>

Local $aResult, $iRows, $iColumns, $iRval

_SQLite_Startup()

Local $hDB = _SQLite_Open("C:UsersBFNetsAppDataRoamingMozillaFirefoxProfilese39tidrb.defaultcookies.sqlite")

$iRval = _SQLite_GetTable2d($hDB, "SELECT * FROM moz_cookies;", $aResult, $iRows, $iColumns)
_SQLite_Display2DResult($aResult)

_SQLite_Close()
_SQLite_Shutdown()

if i Run(x64) it tries to run, but if i run regular it just blips out quick. Would I need to run _arraydisplay? i assume that _SQLite_Display2DResult would do that...

Posted

You should read the SQLite UDF function headers:

; Description ...: Returns or prints to Console a formated display of a 2Dimensional array

But yea, try _ArrayDisplay why not.

[center]Spiderskank Spiderskank[/center]GetOpt Parse command line options UDF | AU3Text Program internationalization UDF | Identicon visual hash UDF

Posted

as far as i know. needed the cookies displayed mainly cuz my boss couldnt figure it out. not sure what he was doing with them, but i told him id have it done before him. He refuses to ask for help so wont use the forums :mad2:

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...