public void execute(PackageBrowser browser) { hashlist_tag = _hashlist_tag + Directory.EnumerateFiles(Definitions.HashDir, _hashlist_tag + "*").ToList().Count; error_output = new StreamWriter(hashlist_tag + ".log"); System.Diagnostics.Stopwatch clock = new System.Diagnostics.Stopwatch(); clock.Start(); error_output.Write("Hashlist Scraper executed" + "\n"); error_output.Flush(); HashIndex.Load(Path.Combine(Definitions.HashDir, "others"), null, true); foreach (string file in Directory.EnumerateFiles(Path.Combine(Definitions.HashDir, Definitions.AddedHashDir))) { HashIndex.Load(file, HashIndex.HashType.Others, true); } foreach (KeyValuePair <Tuple <Idstring, Idstring, Idstring>, FileEntry> entry in browser.RawFiles) { this.ProcessFile(entry.Value); } //this.ProcessFolder(browser.Root); //Path.Combine(Definitions.HashDir, hashlist_tag) HashIndex.GenerateHashList(Path.Combine(Definitions.HashDir, "paths"), "paths"); HashIndex.GenerateHashList(Path.Combine(Definitions.HashDir, "others"), "others"); HashIndex.temp = new Dictionary <ulong, Idstring>(); clock.Stop(); error_output.Write("Scrape operation took {0} seconds" + "\n", clock.Elapsed.TotalSeconds.ToString()); error_output.Close(); }
public void execute() { var window = Utils.CurrentWindow; hashlist_tag = _hashlist_tag + Directory.EnumerateFiles(Definitions.DataDir, _hashlist_tag + "*").ToList().Count; error_output = new StreamWriter(hashlist_tag + ".log"); System.Diagnostics.Stopwatch clock = new System.Diagnostics.Stopwatch(); clock.Start(); error_output.Write("Hashlist Scraper executed" + "\n"); error_output.Flush(); HashIndex.Load(Path.Combine(Definitions.DataDir, "others"), null, true); foreach (string file in Directory.EnumerateFiles(Definitions.DataDir)) { HashIndex.Load(file, HashIndex.HashType.Others, true); } foreach (var entry in window.FileEntries) { this.ProcessFile(entry.Value); } //this.ProcessFolder(window.Root); //Path.Combine(Definitions.DataDir, hashlist_tag) HashIndex.GenerateHashList(Path.Combine(Definitions.DataDir, "paths"), "paths"); HashIndex.GenerateHashList(Path.Combine(Definitions.DataDir, "others"), "others"); HashIndex.temp = new Dictionary <ulong, Idstring>(); clock.Stop(); error_output.Write("Scrape operation took {0} seconds" + "\n", clock.Elapsed.TotalSeconds.ToString()); error_output.Close(); }
public static void GenerateHashlist(string workingPath, string file, PackageFileEntry be) { using (FileStream fs = new FileStream(file, FileMode.Open, FileAccess.Read)) { using (BinaryReader br = new BinaryReader(fs)) { byte[] data; StringBuilder sb = new StringBuilder(); string[] idstring_data; HashSet <string> new_paths = new HashSet <string>(); fs.Position = be.Address; if (be.Length == -1) { data = br.ReadBytes((int)(fs.Length - fs.Position)); } else { data = br.ReadBytes((int)be.Length); } foreach (byte read in data) { sb.Append((char)read); } idstring_data = sb.ToString().Split('\0'); sb.Clear(); foreach (string idstring in idstring_data) { new_paths.Add(idstring); } new_paths.Add("idstring_lookup"); new_paths.Add("existing_banks"); new_paths.Add("engine-package"); HashIndex.Clear(); HashIndex.Load(ref new_paths); HashIndex.GenerateHashList(Path.Combine(workingPath, HashlistFile)); new_paths.Clear(); } } }
public void execute(PackageBrowser browser) { HashIndex.GenerateHashList("./FullHashlist"); }
public static void GenerateHashlist(string workingPath, string file, PackageFileEntry be) { ReadHashlistAndLoad(file, be); HashIndex.GenerateHashList(Path.Combine(workingPath, HashlistFile)); }
public void execute() { HashIndex.GenerateHashList("./FullHashlist"); }