diff --git a/Sharpii/IOS.cs b/Sharpii/IOS.cs index eb295f6..b597698 100644 --- a/Sharpii/IOS.cs +++ b/Sharpii/IOS.cs @@ -35,6 +35,7 @@ namespace Sharpii bool fs = false; bool es = false; bool np = false; + bool vp = false; int slot = -1; int version = -1; @@ -59,6 +60,9 @@ namespace Sharpii case "-NP": np = true; break; + case "-VP": + vp = true; + break; case "-SLOT": if (i + 1 >= args.Length) { @@ -76,6 +80,23 @@ namespace Sharpii return; } break; + case "-S": + if (i + 1 >= args.Length) + { + Console.WriteLine("ERROR: No slot set"); + return; + } + if (!int.TryParse(args[i + 1], out slot)) + { + Console.WriteLine("Invalid slot {0}...", args[i + 1]); + return; + } + if (slot < 3 || slot > 255) + { + Console.WriteLine("Invalid slot {0}...", slot); + return; + } + break; case "-V": if (i + 1 >= args.Length) { @@ -151,6 +172,13 @@ namespace Sharpii patcher.PatchNandPermissions(); } + if (vp == true) + { + if (Quiet.quiet > 2) + System.Console.WriteLine("Applying Version patch"); + patcher.PatchVP(); + } + if (slot > -1 || version > -1) ios.FakeSign = true; @@ -178,12 +206,18 @@ namespace Sharpii else { if (Quiet.quiet > 2) - System.Console.WriteLine("Saving file"); + System.Console.Write("Saving file..."); - if (output.Substring(output.Length - 4, 4).ToUpper() != ".WAD") - output = output + ".wad"; + if (output != "") + { + if (output.Substring(output.Length - 4, 4).ToUpper() != ".WAD") + output = output + ".wad"; + } ios.Save(input); + + if (Quiet.quiet > 2) + System.Console.Write("Done!\n"); } if (Quiet.quiet > 1) System.Console.WriteLine("Operation completed succesfully!"); @@ -204,22 +238,24 @@ namespace Sharpii { System.Console.WriteLine(""); System.Console.WriteLine("Sharpii {0} - IOS - A tool by person66, using libWiiSharp.dll by leathl", Version.version); - System.Console.WriteLine(" Code based off PatchIOS by leathl"); + System.Console.WriteLine(" Code based off PatchIOS by leathl"); System.Console.WriteLine(""); System.Console.WriteLine(""); System.Console.WriteLine(" Usage:"); System.Console.WriteLine(""); - System.Console.WriteLine(" Sharpii.exe IOS input [-o output] [-fs] [-es] [-np] [-s slot] [-v version]"); + System.Console.WriteLine(" Sharpii.exe IOS input [-o output] [-fs] [-es] [-np] [-vp] [-s slot]"); + System.Console.WriteLine(" [-v version]"); System.Console.WriteLine(""); System.Console.WriteLine(""); System.Console.WriteLine(" Arguments:"); System.Console.WriteLine(""); - System.Console.WriteLine(" input The input file/folder"); - System.Console.WriteLine(" -o output The output file/folder"); + System.Console.WriteLine(" input The input file"); + System.Console.WriteLine(" -o output The output file"); System.Console.WriteLine(" -fs Patch Fakesigning"); System.Console.WriteLine(" -es Patch ES_Identify"); System.Console.WriteLine(" -np Patch NAND Permissions"); - System.Console.WriteLine(" -slot # Change IOS slot to #"); + System.Console.WriteLine(" -vp Add version patch"); + System.Console.WriteLine(" -s # Change IOS slot to #"); System.Console.WriteLine(" -v # Change IOS version to #"); } } diff --git a/Sharpii/Program.cs b/Sharpii/Program.cs index e3e53d5..718e4b0 100644 --- a/Sharpii/Program.cs +++ b/Sharpii/Program.cs @@ -28,7 +28,13 @@ namespace Sharpii if (args.Length < 1) { help(); - return; + Environment.Exit(0); + } + + if (!File.Exists("libWiiSharp.dll")) + { + System.Console.WriteLine("ERROR: libWiiSharp.dll not found"); + Environment.Exit(0); } for (int i = 1; i < args.Length; i++) @@ -149,5 +155,5 @@ namespace Sharpii } public class Version { - public static string version = "1.1"; + public static string version = "1.2"; } \ No newline at end of file diff --git a/Sharpii/libWiiSharp.dll b/Sharpii/libWiiSharp.dll index b96ffb0..26ed1d9 100644 Binary files a/Sharpii/libWiiSharp.dll and b/Sharpii/libWiiSharp.dll differ