diff --git a/UnionPatcher.Gui/MainForm.cs b/UnionPatcher.Gui/MainForm.cs index cd650c0..e35daa6 100644 --- a/UnionPatcher.Gui/MainForm.cs +++ b/UnionPatcher.Gui/MainForm.cs @@ -72,17 +72,17 @@ namespace LBPUnion.UnionPatcher.Gui { ElfFile eboot = new(this.filePicker.FilePath); if(eboot.IsValid == false) { - this.CreateOkDialog("Eboot Error", $"{eboot.Name} is not a valid ELF file (magic number mismatch)\nThe EBOOT must be decrypted before using this tool").ShowModal(); + this.CreateOkDialog("EBOOT Error", $"{eboot.Name} is not a valid ELF file (magic number mismatch)\nThe EBOOT must be decrypted before using this tool").ShowModal(); return; } if(eboot.Is64Bit == null) { - this.CreateOkDialog("Eboot Error", $"{eboot.Name} does not target a valid system").ShowModal(); + this.CreateOkDialog("EBOOT Error", $"{eboot.Name} does not target a valid system").ShowModal(); return; } if(string.IsNullOrWhiteSpace(eboot.Architecture)) { - this.CreateOkDialog("Eboot Error", $"{eboot.Name} does not target a valid architecture (PowerPC or ARM)").ShowModal(); + this.CreateOkDialog("EBOOT Error", $"{eboot.Name} does not target a valid architecture (PowerPC or ARM)").ShowModal(); return; } diff --git a/UnionPatcher/ElfFile.cs b/UnionPatcher/ElfFile.cs index 6a24bfc..1fb4f5b 100644 --- a/UnionPatcher/ElfFile.cs +++ b/UnionPatcher/ElfFile.cs @@ -27,7 +27,7 @@ namespace LBPUnion.UnionPatcher { public string Name { get; } = "Binary Blob"; - public bool IsValid { get; } + public bool IsValid { get; } = false; public bool? Is64Bit { get; } = null; public bool? IsBigEndian { get; } = null; public string Architecture { get; } = null; @@ -35,10 +35,8 @@ namespace LBPUnion.UnionPatcher { public byte[] Contents { get; } = null; public ElfFile(byte[] fileContents) { - if(fileContents.length < 52) { - IsValid = false; + if(fileContents.Length < 52) return; - } IsValid = fileContents[0x00..0x04].SequenceEqual(new byte[] {0x7F, (byte)'E', (byte)'L', (byte)'F'}); if(!IsValid) return;