Skip to content
This repository has been archived by the owner on Apr 30, 2020. It is now read-only.

Commit

Permalink
Version 4
Browse files Browse the repository at this point in the history
  • Loading branch information
friendlyanon committed May 11, 2017
1 parent 8af0f55 commit c32a5d5
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions CFW2OFW Helper/Program.cs
Expand Up @@ -37,7 +37,7 @@ class G
public static readonly string makeNpdata = currentDir + "\\make_npdata.exe"; public static readonly string makeNpdata = currentDir + "\\make_npdata.exe";
public static readonly string patchPath = currentDir + "\\patch"; public static readonly string patchPath = currentDir + "\\patch";
public static readonly string DECPath = patchPath + "\\decrypted.data"; public static readonly string DECPath = patchPath + "\\decrypted.data";
public static readonly string version = "3"; public static readonly string version = "4";
public static readonly WebClient wc = new WebClient(); public static readonly WebClient wc = new WebClient();
public static uint FailedPatches = 0; public static uint FailedPatches = 0;
public static void Exit(string msg) public static void Exit(string msg)
Expand Down Expand Up @@ -533,10 +533,15 @@ static void GetPatches()
try try
{ {
Console.Write(fname + " ..."); Console.Write(fname + " ...");
if ((exists && new FileInfo(path).Length == 0) || !exists) G.wc.DownloadFile(url, part); string message = " local";
if ((exists && new FileInfo(path).Length == 0) || !exists)
{
G.wc.DownloadFile(url, part);
message = " done";
}
if (File.Exists(part)) File.Move(part, path); if (File.Exists(part)) File.Move(part, path);
G.patchFNames.Enqueue(fname); G.patchFNames.Enqueue(fname);
Green(" done"); Green(message);
} }
catch (WebException) catch (WebException)
{ {
Expand Down Expand Up @@ -738,10 +743,10 @@ static void ProcessGameFiles(string LICPath)
} }
string dest = G.targetDir + "\\" + toConvert.Replace(source, ""); string dest = G.targetDir + "\\" + toConvert.Replace(source, "");
p.StartInfo.Arguments = "-e \"" + toConvert + "\" \"" + dest + "\" 0 1 3 0 16"; p.StartInfo.Arguments = "-e \"" + toConvert + "\" \"" + dest + "\" 0 1 3 0 16";
p.Start();
p.WaitForExit();
if (File.Exists(dest)) if (File.Exists(dest))
File.Delete(dest); File.Delete(dest);
p.Start();
p.WaitForExit();
} }
p.StartInfo.Arguments = "-e \"" + LICPath + "\" \"" + G.targetDir + p.StartInfo.Arguments = "-e \"" + LICPath + "\" \"" + G.targetDir +
"\\LICDIR\\LIC.EDAT\" 1 1 3 0 16 3 00 EP9000-" + G.newID "\\LICDIR\\LIC.EDAT\" 1 1 3 0 16 3 00 EP9000-" + G.newID
Expand Down Expand Up @@ -984,7 +989,7 @@ static void Main(string[] args)
GetPatches(); GetPatches();
ProcessPatches(); ProcessPatches();
ProcessGameFiles(LICPath); ProcessGameFiles(LICPath);
Console.Write("\nDone.\nPress any key to exit . . ."); Console.Write("\nPress any key to exit . . .");
Console.ReadKey(true); Console.ReadKey(true);
} }
} }
Expand Down

0 comments on commit c32a5d5

Please sign in to comment.