Updated to 1.4 - Added the ability to send arguments in the SendDol function

- Changed the way the SendDol function works a little
               - More code cleanup and bug fixes
This commit is contained in:
mzolob@gmail.com 2011-10-19 14:55:06 +00:00
parent cab265a001
commit 475336b843
4 changed files with 70 additions and 26 deletions

View File

@ -25,22 +25,21 @@ namespace Sharpii
{
public static void SendDol(string[] args)
{
if (args.Length < 3)
if (args.Length < 2)
{
SendDol_help();
return;
}
string input = args[1];
string ip = "";
string protocol = "JODI";
bool compress = true;
//Check if file exists
if (File.Exists(input) == false)
if (args[1].ToUpper() == "-H" || args[1].ToUpper() == "-HELP")
{
System.Console.WriteLine("ERROR: Unable to open file: {0}", input);
SendDol_help();
return;
}
string input = "";
string ip = "";
string protocol = "JODI";
string arguments = "";
bool compress = true;
//Get parameters
for (int i = 1; i < args.Length; i++)
@ -55,6 +54,29 @@ namespace Sharpii
}
ip = args[i + 1];
break;
case "-DOL":
if (i + 1 >= args.Length)
{
Console.WriteLine("ERROR: No dol set");
return;
}
input = args[i + 1];
//Check if file exists
if (File.Exists(input) == false)
{
System.Console.WriteLine("ERROR: Unable to open file: {0}", input);
return;
}
if (i + 1 < args.Length)
{
for (int n = i + 2; n < args.Length; n++)
{
arguments = arguments + "\x0000";
arguments = arguments + args[n];
}
}
break;
case "-NOCOMP":
compress = false;
break;
@ -95,7 +117,7 @@ namespace Sharpii
if (Quiet.quiet > 1)
System.Console.Write("Sending file...");
file.TransmitFile(input);
file.TransmitFile(Path.GetFileName(input) + arguments, File.ReadAllBytes(input));
if (Quiet.quiet > 1)
System.Console.Write("Done!\n");
@ -120,15 +142,19 @@ namespace Sharpii
System.Console.WriteLine("");
System.Console.WriteLine(" Usage:");
System.Console.WriteLine("");
System.Console.WriteLine(" Sharpii.exe SendDol file -ip ip_adress [-old] [-nocomp]");
System.Console.WriteLine(" Sharpii.exe SendDol -ip ip_adress [-old] [-nocomp] -dol file [args]");
System.Console.WriteLine("");
System.Console.WriteLine("");
System.Console.WriteLine(" Arguments:");
System.Console.WriteLine("");
System.Console.WriteLine(" file The dol file to send");
System.Console.WriteLine(" -dol file The dol file to send");
System.Console.WriteLine(" -ip ip_adress The IP address of your wii");
System.Console.WriteLine(" -old Use for the old (1.0.4 and below) HBC");
System.Console.WriteLine(" -nocomp Disable compression");
System.Console.WriteLine(" args Dol arguments");
System.Console.WriteLine("");
System.Console.WriteLine(" NOTE: Any arguments after '-dol file' will be sent as dol");
System.Console.WriteLine(" arguments");
}
}
}

View File

@ -180,5 +180,5 @@ namespace Sharpii
}
public class Version
{
public static string version = "1.3";
public static string version = "1.4";
}

View File

@ -1,5 +1,5 @@
/------------------------------------------------------------------------------>
Sharpii 1.3
Sharpii 1.4
<---------------------------------------------------------------->
An app by person66
libWiiSharp.dll by leathl (mod by scooby74029)
@ -40,7 +40,7 @@ help with.
/----NOTES
/------------------------------>
NUS Downloading:
NUS Downloading:
/------------------>
When downloading single contents from NUS (using the -s argument) make
sure you have both the path, and the file name when specifying the output.
@ -51,7 +51,7 @@ NUS Downloading:
Also note that When Downloading single contents, it will only save the
decrypted file.
WAD Editing:
WAD Editing:
/------------------>
When changing the type of WAD (using the -type argument) some of the types
may not work, as they have not all been tested. Here is a list of what the
@ -65,6 +65,16 @@ WAD Editing:
For more details see http://wiibrew.org/wiki/Title_database
SendDol:
/------------------>
When using Sharpii's SendDol function, please note that any arguments placed
after the '-dol file' argument will be sent as dol arguments.
Also note that for compression to actually work, 'zlib1.dll' must be placed in
the same directory as Sharpii. This file is not included, but it can easily be
found online. If you are sending a zip file instead of a dol, it wont be
compressed at all, no matter what.
/----SOURCE
/------------------------------>
@ -95,6 +105,10 @@ See "LICENSE.txt" for more information.
/----CHANGELOG
/------------------------------>
1.4
- Added the ability to send arguments in the SendDol function
- Changed the way the SendDol function works a little
- More code cleanup and bug fixes
1.3
- Added the ability to copy parts of one WAD to a different
WAD (either the banner, the icon, the sound, or the dol)

View File

@ -90,6 +90,10 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Content Include="LICENSE.txt" />
<Content Include="README.txt" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.