mirror of
https://github.com/LBPUnion/UnionPatcher.git
synced 2025-08-04 23:28:52 +00:00
Fixed compilation error; formatting fixes
This commit is contained in:
parent
58c418362b
commit
77b693ae08
2 changed files with 5 additions and 7 deletions
|
@ -72,17 +72,17 @@ namespace LBPUnion.UnionPatcher.Gui {
|
||||||
ElfFile eboot = new(this.filePicker.FilePath);
|
ElfFile eboot = new(this.filePicker.FilePath);
|
||||||
|
|
||||||
if(eboot.IsValid == false) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(eboot.Is64Bit == null) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(string.IsNullOrWhiteSpace(eboot.Architecture)) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ namespace LBPUnion.UnionPatcher {
|
||||||
|
|
||||||
public string Name { get; } = "Binary Blob";
|
public string Name { get; } = "Binary Blob";
|
||||||
|
|
||||||
public bool IsValid { get; }
|
public bool IsValid { get; } = false;
|
||||||
public bool? Is64Bit { get; } = null;
|
public bool? Is64Bit { get; } = null;
|
||||||
public bool? IsBigEndian { get; } = null;
|
public bool? IsBigEndian { get; } = null;
|
||||||
public string Architecture { get; } = null;
|
public string Architecture { get; } = null;
|
||||||
|
@ -35,10 +35,8 @@ namespace LBPUnion.UnionPatcher {
|
||||||
public byte[] Contents { get; } = null;
|
public byte[] Contents { get; } = null;
|
||||||
|
|
||||||
public ElfFile(byte[] fileContents) {
|
public ElfFile(byte[] fileContents) {
|
||||||
if(fileContents.length < 52) {
|
if(fileContents.Length < 52)
|
||||||
IsValid = false;
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
IsValid = fileContents[0x00..0x04].SequenceEqual(new byte[] {0x7F, (byte)'E', (byte)'L', (byte)'F'});
|
IsValid = fileContents[0x00..0x04].SequenceEqual(new byte[] {0x7F, (byte)'E', (byte)'L', (byte)'F'});
|
||||||
if(!IsValid) return;
|
if(!IsValid) return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue