private static bool CurrentRomIsArchive() { var path = GlobalWin.MainForm.CurrentlyOpenRom; if (path == null) { return false; } using (var file = new HawkFile()) { file.Open(path); if (!file.Exists) { return false; } return file.IsArchive; } }
private static byte[] GetRomBytes() { var path = GlobalWin.MainForm.CurrentlyOpenRom; if (path == null) { return new byte[] { 0xFF }; } using (var file = new HawkFile()) { file.Open(path); if (!file.Exists) { return null; } if (file.IsArchive) { var stream = file.GetStream(); return stream.ReadAllBytes(); } return File.ReadAllBytes(path); } }
private static byte[] GetRomBytes() { var path = GlobalWin.MainForm.CurrentlyOpenRomArgs.OpenAdvanced.SimplePath; if (string.IsNullOrEmpty(path)) { return new byte[] { 0xFF }; } using (var file = new HawkFile()) { file.Open(path); if (!file.Exists) { return null; } if (file.IsArchive) { var stream = file.GetStream(); return stream.ReadAllBytes(); } return File.ReadAllBytes(path); } }