Program.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using System.Collections.Generic;
  3. namespace OpenVIII.Search
  4. {
  5. /// <summary>
  6. /// Application searches libraries for strings. Not the fastest thing.
  7. /// </summary>
  8. internal class Program
  9. {
  10. #region Methods
  11. private static void Main(string[] args)
  12. {
  13. Memory.Init(null, null, null, args);
  14. Console.Write("Insert string you would like to find. This assumes you are looking for FF8 formatted strings." +
  15. "\r\nThere may be special characters in your string so you might have to remove words to get a match.\r\n The search is case sensitive.\r\n Input: ");
  16. FF8String sval = Console.ReadLine()?.Trim((Environment.NewLine + " _").ToCharArray());
  17. if (sval == null) return;
  18. //new FF8String(new byte[] { 0x10, 0, 0, 0, 0x02, 0, 0, 0 });
  19. var s = new Search(sval);//used to find file a string is in. disable if not using.
  20. var rs = s.Results;
  21. Console.WriteLine(rs.Count > 0
  22. ? $"Found \"{sval}\" {rs.Count} times. Results below."
  23. : $"Cannot find \"{sval}\"...");
  24. foreach (var r in rs)
  25. {
  26. Console.WriteLine($"{r.Item1}, {r.Item2}, {r.Item3}");
  27. }
  28. Console.WriteLine($"Press [Enter] to exit...");
  29. Console.ReadLine();
  30. }
  31. #endregion Methods
  32. }
  33. }