Skip to content

Commit

Permalink
Fix FBI 2.x compatibility
Browse files Browse the repository at this point in the history
Thanks liomajor for that fix!
FBI 2.x with no banner currently does not work.
  • Loading branch information
Shadowtrance committed Apr 14, 2016
1 parent 39a5b93 commit 1ea0328
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 42 deletions.
42 changes: 6 additions & 36 deletions Universal Inject Generator/GenExeFS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ public static void GenexeFs(MainForm mainForm)
{
try
{
File.Copy(Variables.WPath[2] + "/" + "inject_exefs" + "/" + "code.bin",
Variables.WPath[2] + "/" + "hs_exefs" + "/" + "code.bin", true);
File.Copy(Variables.WPath[2] + "/" + "hs_exefs" + "/" + "banner.bnr",
Variables.WPath[2] + "/" + "inject_exefs" + "/" + "banner.bnr", true);

//Generate New Exefs
//Generate No Banner Exefs
using (Process genExefs = new Process
{
StartInfo =
Expand All @@ -24,39 +24,9 @@ public static void GenexeFs(MainForm mainForm)
UseShellExecute = false,
RedirectStandardOutput = true,
Arguments =
@" -c -z -t exefs -f " + Variables.WPath[2] + "/" + "hs_mod_exefs.bin" +
" --exefs-dir " + Variables.WPath[2] + "/" + "hs_exefs" +
" --header " + Variables.WPath[2] + "/" + "hs_exefs.bin"
}
})
{
genExefs.OutputDataReceived += (o, args) => Variables.SortOutputHandler(o, args, mainForm);
genExefs.Start();

genExefs.BeginOutputReadLine();

genExefs.WaitForExit();
genExefs.Close();
}

File.Copy(Variables.WPath[2] + "/" + "inject_exefs" + "/" + "banner.bnr",
Variables.WPath[2] + "/" + "hs_exefs" + "/" + "banner.bnr", true);

File.Copy(Variables.WPath[2] + "/" + "inject_exefs" + "/" + "icon.icn",
Variables.WPath[2] + "/" + "hs_exefs" + "/" + "icon.icn", true);

using (Process genExefs = new Process
{
StartInfo =
{
FileName = Variables.WPath[1] + "/" + Variables.Tools[0],
CreateNoWindow = true,
UseShellExecute = false,
RedirectStandardOutput = true,
Arguments =
@" -c -z -t exefs -f " + Variables.WPath[2] + "/" + "hs_mod_banner_exefs.bin" +
" --exefs-dir " + Variables.WPath[2] + "/" + "hs_exefs" +
" --header " + Variables.WPath[2] + "/" + "hs_exefs.bin"
@" -c -z -t exefs -f " + Variables.WPath[2] + "/" + "inject_no_banner_exefs.bin" +
" --exefs-dir " + Variables.WPath[2] + "/" + "inject_exefs" +
" --header " + Variables.WPath[2] + "/" + "inject_exefs.bin"
}
})
{
Expand Down
3 changes: 2 additions & 1 deletion Universal Inject Generator/GenRomFs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static void GenRomfs(MainForm mainForm)
File.Copy(Variables.WPath[1] + "/" + "dummy.bin",
Variables.WPath[2] + "/" + "dummy_romfs" + "/" + "dummy.bin", true);

//Generate new Romfs
//Generate dummy Romfs
using (Process genRomfs = new Process
{
StartInfo =
Expand All @@ -43,6 +43,7 @@ public static void GenRomfs(MainForm mainForm)
if (!File.Exists(Variables.WPath[2] + "/" + "inject_romfs.bin"))
{
File.Copy(Variables.WPath[2] + "/" + "dummy_romfs.bin", Variables.WPath[2] + "/" + "inject_romfs.bin", true);
File.Delete(Variables.WPath[2] + "/" + "dummy_romfs.bin");
}
MergeExh.MergeExheader(mainForm);
}
Expand Down
10 changes: 5 additions & 5 deletions Universal Inject Generator/RebuildHS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static void RebuildHnS_1(MainForm mainForm)
" --exh " + Variables.WPath[2] + "/" + "merge_exhdr.bin" +
" --plain " + Variables.WPath[2] + "/" + "hs_plain.bin" +
" --logo " + Variables.WPath[2] + "/" + "hs_logo.bin" +
" --exefs " + Variables.WPath[2] + "/" + "hs_mod_exefs.bin" +
" --exefs " + Variables.WPath[2] + "/" + "inject_no_banner_exefs.bin" +
" --romfs " + Variables.WPath[2] + "/" + "inject_romfs.bin"
}
}))
Expand Down Expand Up @@ -61,7 +61,7 @@ public static void RebuildHnS_1(MainForm mainForm)
" --header " + Variables.WPath[2] + "/" + "hs_hdr.bin" +
" --exh " + Variables.WPath[2] + "/" + "merge_exhdr.bin" +
" --plain " + Variables.WPath[2] + "/" + "hs_plain.bin" +
" --exefs " + Variables.WPath[2] + "/" + "hs_mod_exefs.bin" +
" --exefs " + Variables.WPath[2] + "/" + "inject_no_banner_exefs.bin" +
" --romfs " + Variables.WPath[2] + "/" + "inject_romfs.bin"
}
}))
Expand All @@ -83,7 +83,7 @@ public static void RebuildHnS_1(MainForm mainForm)
}
}

//Rebuild HS Inject App - No Banner
//Rebuild HS Inject App - Banner
public static void RebuildHnS_2(MainForm mainForm)
{
try
Expand All @@ -110,7 +110,7 @@ public static void RebuildHnS_2(MainForm mainForm)
" --exh " + Variables.WPath[2] + "/" + "merge_exhdr.bin" +
" --plain " + Variables.WPath[2] + "/" + "hs_plain.bin" +
" --logo " + Variables.WPath[2] + "/" + "hs_logo.bin" +
" --exefs " + Variables.WPath[2] + "/" + "hs_mod_banner_exefs.bin" +
" --exefs " + Variables.WPath[2] + "/" + "inject_exefs.bin" +
" --romfs " + Variables.WPath[2] + "/" + "inject_romfs.bin"
}
})
Expand Down Expand Up @@ -143,7 +143,7 @@ public static void RebuildHnS_2(MainForm mainForm)
" --header " + Variables.WPath[2] + "/" + "hs_hdr.bin" +
" --exh " + Variables.WPath[2] + "/" + "merge_exhdr.bin" +
" --plain " + Variables.WPath[2] + "/" + "hs_plain.bin" +
" --exefs " + Variables.WPath[2] + "/" + "hs_mod_banner_exefs.bin" +
" --exefs " + Variables.WPath[2] + "/" + "inject_exefs.bin" +
" --romfs " + Variables.WPath[2] + "/" + "inject_romfs.bin"
}
})
Expand Down

0 comments on commit 1ea0328

Please sign in to comment.