mirror of
https://github.com/LBPUnion/UnionPatcher.git
synced 2025-08-09 17:48:43 +00:00
Use file-scoped namespaces
This commit is contained in:
parent
a90da4e7b3
commit
bccb6749d1
9 changed files with 393 additions and 393 deletions
|
@ -2,53 +2,53 @@
|
|||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
||||
namespace LBPUnion.UnionPatcher.Cli {
|
||||
public static class Program {
|
||||
public const string Version = "1.0";
|
||||
namespace LBPUnion.UnionPatcher.Cli;
|
||||
|
||||
private static string fileName;
|
||||
public static class Program {
|
||||
public const string Version = "1.0";
|
||||
|
||||
public static string FileName {
|
||||
get {
|
||||
if(fileName != null) return fileName;
|
||||
private static string fileName;
|
||||
|
||||
return fileName = Path.GetFileName(Process.GetCurrentProcess().MainModule?.FileName);
|
||||
}
|
||||
}
|
||||
public static string FileName {
|
||||
get {
|
||||
if(fileName != null) return fileName;
|
||||
|
||||
public static void Main(string[] args) {
|
||||
if(args.Length < 3) {
|
||||
PrintHelp();
|
||||
return;
|
||||
}
|
||||
|
||||
ElfFile eboot = new(new FileInfo(args[0]));
|
||||
|
||||
if(!eboot.IsValid) {
|
||||
Console.WriteLine($"{eboot.Name} is not a valid ELF file (magic number mismatch)");
|
||||
Console.WriteLine("The EBOOT must be decrypted before using this tool");
|
||||
return;
|
||||
}
|
||||
|
||||
if(eboot.Is64Bit == null) {
|
||||
Console.WriteLine($"{eboot.Name} does not target a valid system");
|
||||
return;
|
||||
}
|
||||
|
||||
if(string.IsNullOrWhiteSpace(eboot.Architecture)) {
|
||||
Console.WriteLine($"{eboot.Name} does not target a valid architecture (PowerPC or ARM)");
|
||||
return;
|
||||
}
|
||||
|
||||
Console.WriteLine($"{eboot.Name} targets {eboot.Architecture}");
|
||||
|
||||
Patcher.PatchFile(args[0], args[1], args[2]);
|
||||
Console.WriteLine($"Successfully patched Server URL to {args[1]}.");
|
||||
}
|
||||
|
||||
public static void PrintHelp() {
|
||||
Console.WriteLine($"UnionPatcher {Version}");
|
||||
Console.WriteLine($" Usage: {FileName} <Input EBOOT.elf> <Server URL> <Output filename>");
|
||||
return fileName = Path.GetFileName(Process.GetCurrentProcess().MainModule?.FileName);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Main(string[] args) {
|
||||
if(args.Length < 3) {
|
||||
PrintHelp();
|
||||
return;
|
||||
}
|
||||
|
||||
ElfFile eboot = new(new FileInfo(args[0]));
|
||||
|
||||
if(!eboot.IsValid) {
|
||||
Console.WriteLine($"{eboot.Name} is not a valid ELF file (magic number mismatch)");
|
||||
Console.WriteLine("The EBOOT must be decrypted before using this tool");
|
||||
return;
|
||||
}
|
||||
|
||||
if(eboot.Is64Bit == null) {
|
||||
Console.WriteLine($"{eboot.Name} does not target a valid system");
|
||||
return;
|
||||
}
|
||||
|
||||
if(string.IsNullOrWhiteSpace(eboot.Architecture)) {
|
||||
Console.WriteLine($"{eboot.Name} does not target a valid architecture (PowerPC or ARM)");
|
||||
return;
|
||||
}
|
||||
|
||||
Console.WriteLine($"{eboot.Name} targets {eboot.Architecture}");
|
||||
|
||||
Patcher.PatchFile(args[0], args[1], args[2]);
|
||||
Console.WriteLine($"Successfully patched Server URL to {args[1]}.");
|
||||
}
|
||||
|
||||
public static void PrintHelp() {
|
||||
Console.WriteLine($"UnionPatcher {Version}");
|
||||
Console.WriteLine($" Usage: {FileName} <Input EBOOT.elf> <Server URL> <Output filename>");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue