mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-05-19 18:58:03 +02:00
add history parse
This commit is contained in:
+33
-7
@@ -5,6 +5,7 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -12,28 +13,53 @@ const (
|
||||
History = "History"
|
||||
Cookies = "Cookies"
|
||||
WebData = "Web Data"
|
||||
Bookmarks = "Bookmarks"
|
||||
)
|
||||
|
||||
func CopyDB(source, dest string) error {
|
||||
// remove current path db file first
|
||||
func CopyDB(src, dst string) error {
|
||||
locals, _ := filepath.Glob("*")
|
||||
for _, v := range locals {
|
||||
if v == dest {
|
||||
err := os.Remove(dest)
|
||||
if v == dst {
|
||||
err := os.Remove(dst)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
sourceFile, err := ioutil.ReadFile(source)
|
||||
sourceFile, err := ioutil.ReadFile(src)
|
||||
if err != nil {
|
||||
log.Println(err.Error())
|
||||
}
|
||||
|
||||
err = ioutil.WriteFile(dest, sourceFile, 644)
|
||||
err = ioutil.WriteFile(dst, sourceFile, 0777)
|
||||
if err != nil {
|
||||
log.Println(err.Error())
|
||||
}
|
||||
err = os.Chmod(dest, 0777)
|
||||
return err
|
||||
}
|
||||
|
||||
func ParseBookMarks() {
|
||||
|
||||
}
|
||||
|
||||
func RemoveFile() {
|
||||
|
||||
}
|
||||
|
||||
func TimeEpochFormat(epoch int64) time.Time {
|
||||
t := time.Date(1601, 1, 1, 0, 0, 0, 0, time.UTC)
|
||||
d := time.Duration(epoch)
|
||||
for i := 0; i < 1000; i++ {
|
||||
t = t.Add(d)
|
||||
}
|
||||
return t
|
||||
}
|
||||
|
||||
func ReadFile(filename string) (string, error) {
|
||||
s, err := ioutil.ReadFile(filename)
|
||||
return string(s), err
|
||||
}
|
||||
|
||||
//func MakeDir(dirName string) error {
|
||||
//
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user