Updated to 1.2 - Added version patch support for IOS patching

- Switched to scooby74029's mod of libWiiSharp 
                 - Bug fixes
This commit is contained in:
mzolob@gmail.com 2011-10-03 03:43:22 +00:00
parent bb29106150
commit 54204f3c8e
3 changed files with 52 additions and 10 deletions

View File

@ -35,6 +35,7 @@ namespace Sharpii
bool fs = false; bool fs = false;
bool es = false; bool es = false;
bool np = false; bool np = false;
bool vp = false;
int slot = -1; int slot = -1;
int version = -1; int version = -1;
@ -59,6 +60,9 @@ namespace Sharpii
case "-NP": case "-NP":
np = true; np = true;
break; break;
case "-VP":
vp = true;
break;
case "-SLOT": case "-SLOT":
if (i + 1 >= args.Length) if (i + 1 >= args.Length)
{ {
@ -76,6 +80,23 @@ namespace Sharpii
return; return;
} }
break; 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": case "-V":
if (i + 1 >= args.Length) if (i + 1 >= args.Length)
{ {
@ -151,6 +172,13 @@ namespace Sharpii
patcher.PatchNandPermissions(); patcher.PatchNandPermissions();
} }
if (vp == true)
{
if (Quiet.quiet > 2)
System.Console.WriteLine("Applying Version patch");
patcher.PatchVP();
}
if (slot > -1 || version > -1) if (slot > -1 || version > -1)
ios.FakeSign = true; ios.FakeSign = true;
@ -178,12 +206,18 @@ namespace Sharpii
else else
{ {
if (Quiet.quiet > 2) if (Quiet.quiet > 2)
System.Console.WriteLine("Saving file"); System.Console.Write("Saving file...");
if (output.Substring(output.Length - 4, 4).ToUpper() != ".WAD") if (output != "")
output = output + ".wad"; {
if (output.Substring(output.Length - 4, 4).ToUpper() != ".WAD")
output = output + ".wad";
}
ios.Save(input); ios.Save(input);
if (Quiet.quiet > 2)
System.Console.Write("Done!\n");
} }
if (Quiet.quiet > 1) if (Quiet.quiet > 1)
System.Console.WriteLine("Operation completed succesfully!"); System.Console.WriteLine("Operation completed succesfully!");
@ -204,22 +238,24 @@ namespace Sharpii
{ {
System.Console.WriteLine(""); System.Console.WriteLine("");
System.Console.WriteLine("Sharpii {0} - IOS - A tool by person66, using libWiiSharp.dll by leathl", Version.version); 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(""); System.Console.WriteLine("");
System.Console.WriteLine(" Usage:"); System.Console.WriteLine(" Usage:");
System.Console.WriteLine(""); 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(""); System.Console.WriteLine("");
System.Console.WriteLine(" Arguments:"); System.Console.WriteLine(" Arguments:");
System.Console.WriteLine(""); System.Console.WriteLine("");
System.Console.WriteLine(" input The input file/folder"); System.Console.WriteLine(" input The input file");
System.Console.WriteLine(" -o output The output file/folder"); System.Console.WriteLine(" -o output The output file");
System.Console.WriteLine(" -fs Patch Fakesigning"); System.Console.WriteLine(" -fs Patch Fakesigning");
System.Console.WriteLine(" -es Patch ES_Identify"); System.Console.WriteLine(" -es Patch ES_Identify");
System.Console.WriteLine(" -np Patch NAND Permissions"); 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 #"); System.Console.WriteLine(" -v # Change IOS version to #");
} }
} }

View File

@ -28,7 +28,13 @@ namespace Sharpii
if (args.Length < 1) if (args.Length < 1)
{ {
help(); 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++) for (int i = 1; i < args.Length; i++)
@ -149,5 +155,5 @@ namespace Sharpii
} }
public class Version public class Version
{ {
public static string version = "1.1"; public static string version = "1.2";
} }

Binary file not shown.