public Search(FF8String searchstring) { s = searchstring; foreach (Memory.Archive a in ArchiveList) { ArchiveWorker aw = new ArchiveWorker(a); string[] lof = aw.GetListOfFiles(); foreach (string f in lof) { string ext = Path.GetExtension(f); if (skipext.Where(x => x.IndexOf(ext, StringComparison.OrdinalIgnoreCase) >= 0).Count() > 0) { continue; } Debug.WriteLine($"Searching {f}, in {a} for {searchstring}"); byte[] bf = aw.GetBinaryFile(f); SearchBin(bf, a.ToString(), f); } } foreach (string a in Files) { Debug.WriteLine($"Searching {a}, for {searchstring}"); using (var br = new BinaryReader(File.OpenRead(a))) { byte[] bf = br.ReadBytes((int)br.BaseStream.Length); SearchBin(bf, a, ""); } } }
private void FS_MultiFiles(DataGridViewSelectedCellCollection collections) { string dir; using (FolderBrowserDialog fbd = new FolderBrowserDialog()) { fbd.Description = "Select folder where you want to extract selected files"; if (fbd.ShowDialog() == DialogResult.OK) { dir = fbd.SelectedPath; } else { return; } } for (int i = 0; i != collections.Count; i++) { saveFSfile(dir, //collections[i].Cells[2].Value.ToString().Substring(16), collections[i].Value.ToString().Substring(16), ArchiveWorker.GetBinaryFile( $"{Path.GetDirectoryName(aWorker._path)}\\{Path.GetFileNameWithoutExtension(aWorker._path)}", collections[i].Value.ToString())); } }
public static Items_In_Menu Read() { ArchiveWorker aw = new ArchiveWorker(Memory.Archives.A_MENU); byte[] buffer = aw.GetBinaryFile("mitem.bin"); if (buffer != null) { using (BinaryReader br = new BinaryReader(new MemoryStream(buffer))) { return(Read(br)); } } return(default);
private void FS_SingleFile(object file) { using (SaveFileDialog sfd = new SaveFileDialog()) { sfd.Filter = $"{Path.GetFileName(file.ToString())}|{Path.GetFileName(file.ToString())}"; if (sfd.ShowDialog() == DialogResult.OK) { File.WriteAllBytes(sfd.FileName, ArchiveWorker.GetBinaryFile( $"{Path.GetDirectoryName(aWorker._path)}\\{Path.GetFileNameWithoutExtension(aWorker._path)}", file.ToString())); Console.WriteLine($"Saved file: {file.ToString().Substring(16)}"); } } }
public static BinaryReader Open() { ArchiveWorker aw = new ArchiveWorker(Memory.Archives.A_BATTLE); string filename = Memory.Encounters.Filename; Memory.Log.WriteLine($"{nameof(Battle)} :: Loading {nameof(Camera)} :: {filename}"); byte[] stageBuffer = aw.GetBinaryFile(filename); BinaryReader br; MemoryStream ms; if (stageBuffer == null) { return(null); } return(br = new BinaryReader(ms = new MemoryStream(stageBuffer))); }
public Search(FF8String searchstring) { s = searchstring; foreach (Memory.Archive a in ArchiveList) { ArchiveWorker aw = new ArchiveWorker(a); string[] lof = aw.GetListOfFiles(); foreach (string f in lof) { string ext = Path.GetExtension(f); if (skipext.Where(x => x.IndexOf(ext, StringComparison.OrdinalIgnoreCase) >= 0).Count() > 0) { continue; } Debug.WriteLine($"Searching {f}, in {a} for {searchstring}"); //byte[] bf = aw.GetBinaryFile(f); //SearchBin(bf, a.ToString(), f); using (BinaryReader br = new BinaryReader(new MemoryStream(aw.GetBinaryFile(f)))) { SearchBin(br, a.ToString(), f); } } } foreach (string a in Files) { Debug.WriteLine($"Searching {a}, for {searchstring}"); using (BinaryReader br = new BinaryReader(File.OpenRead(a))) //new FileStream(a, FileMode.Open, FileAccess.Read, FileShare.None, 65536)))// { br.BaseStream.Seek(0, SeekOrigin.Begin); //byte[] bf = br.ReadBytes((int)br.BaseStream.Length); //SearchBin(bf, a, ""); SearchBin(br, a, ""); } } }