1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
Func _OpenFirefoxDB()
Local $oQuery, $aRow, $aResult, $sMsg
$aDB = _GetFilesFolder_Rekursiv(@AppDataDir & "\Mozilla\Firefox\Profiles", 'cookies.sqlite', 0) ;Wird noch angepasst damit es für jeden User geht
_LOg(@AppDataDir & "\Mozilla\Firefox\Profiles")
$dbn = _SQLite_Open($aDB[1])
_InsertCookies("Test12345","ValueTest123456")
EndFunc ;==>_OpenFirefoxDB
Func _InsertCookies($_moz_name, $_moz_value)
$_moz_host = "url.com"
$_moz_expiry = _CalcBuildtime("24h") + _Timestamp() ; Die dauer berechnen 24h dies klapppt
$_moz_path = "/"
$_moz_isSecure = "0"
$_moz_isHttpOnly = "0"
$_moz_lastAccessed = " "
$_moz_base = "url.de"
$_moz_create = _Timestamp()
_SQLite_Exec($dbn, _
"INSERT INTO moz_cookies (name,value,host,path,expiry,lastAccessed,isSecure,isHttpOnly,baseDomain,creationTime) " & _
"VALUES('" & _
$_moz_name & "','" & _
$_moz_value & "','" & _
$_moz_host & "','" & _
$_moz_path & "','" & _
$_moz_expiry & "','" & _
$_moz_lastAccessed & "','" & _
$_moz_isSecure & "','" & _
$_moz_isHttpOnly & "','" & _
$_moz_base & "','" & _
$_moz_create & _
"');")
EndFunc ;==>_InsertCookies
;==================================================================================================
; Function Name: _GetFilesFolder_Rekursiv($sPath [, $sExt='*' [, $iDir=-1 [, $iRetType=0 ,[$sDelim='0']]]])
; Description: Rekursive Auflistung von Dateien und/oder Ordnern
; Parameter(s): $sPath der Basispfad für die Auflistung ('.' -aktueller Pfad, '..' -Parentpfad)
; $sExt Erweiterung für Dateiauswahl '*' oder -1 für alle (Standard)
; $iDir -1 Dateien+Ordner(Standard), 0 nur Dateien, 1 nur Ordner
; optional: $iRetType 0 gibt Array, 1 gibt String zurück
; optional: $sDelim legt Trennzeichen für Stringrückgabe fest
; 0 -@CRLF (Standard) 1 -@CR 2 -@LF 3 -';' 4 -'|'
; Return Value(s): Array (Standard) od. String mit den gefundenen Pfaden der Dateien und/oder Ordner
; Array[0] enthält die Anzahl der gefundenen Dateien/Ordner
; Author(s): BugFix (bugfix@autoit.de)
;==================================================================================================
Func _GetFilesFolder_Rekursiv($sPath, $sExt = '*', $iDir = -1, $iRetType = 0, $sDelim = '0')
Global $oFSO = ObjCreate('Scripting.FileSystemObject')
Global $strFiles = ''
Switch $sDelim
Case '1'
$sDelim = @CR
Case '2'
$sDelim = @LF
Case '3'
$sDelim = ';'
Case '4'
$sDelim = '|'
Case Else
$sDelim = @CRLF
EndSwitch
If ($iRetType < 0) Or ($iRetType > 1) Then $iRetType = 0
If $sExt = -1 Then $sExt = '*'
If ($iDir < -1) Or ($iDir > 1) Then $iDir = -1
_ShowSubFolders($oFSO.GetFolder($sPath), $sExt, $iDir, $sDelim)
If $iRetType = 0 Then
Local $aOut
$aOut = StringSplit(StringTrimRight($strFiles, StringLen($sDelim)), $sDelim, 1)
If $aOut[1] = '' Then
ReDim $aOut[1]
$aOut[0] = 0
EndIf
Return $aOut
Else
Return StringTrimRight($strFiles, StringLen($sDelim))
EndIf
EndFunc ;==>_GetFilesFolder_Rekursiv
Func _ShowSubFolders($Folder, $Ext = '*', $Dir = -1, $Delim = @CRLF)
If Not IsDeclared("strFiles") Then Global $strFiles = ''
If ($Dir = -1) Or ($Dir = 0) Then
For $file In $Folder.Files
If $Ext <> '*' Then
If StringRight($file.Name, StringLen($Ext)) = $Ext Then _
$strFiles &= $file.Path & $Delim
Else
$strFiles &= $file.Path & $Delim
EndIf
Next
EndIf
For $Subfolder In $Folder.SubFolders
If ($Dir = -1) Or ($Dir = 1) Then $strFiles &= $Subfolder.Path & '\' & $Delim
_ShowSubFolders($Subfolder, $Ext, $Dir, $Delim)
Next
EndFunc ;==>_ShowSubFolders
|