Skip to content

Commit

Permalink
Fix for temp path handling when temp path has spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Sammi-Husky committed Mar 3, 2023
1 parent 2fc06e8 commit d6f3d79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions reltools/ModuleBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ private byte[] Compile(string asm, IEnumerable<string> defines, out string listi
ProcResult asResult = Util.StartProcess("lib/powerpc-eabi-as.exe",
"-mgekko",
"-mregnames",
$"-alc={tmpLst}",
$"-alc=\"{tmpLst}\"",
"--listing-rhs-width=900",
$"{_defs}",
$"\"{tmpSrc}\"",
Expand All @@ -230,8 +230,8 @@ private byte[] Compile(string asm, IEnumerable<string> defines, out string listi
// copy instruction bytes to raw bin file
ProcResult cpResult = Util.StartProcess("lib/powerpc-eabi-objcopy.exe",
$"-O binary",
$"{tmpBin}",
$"{tmpOut}");
$"\"{tmpBin}\"",
$"\"{tmpOut}\"");


if (asResult.ExitCode == 0 && cpResult.ExitCode == 0)
Expand Down
7 changes: 3 additions & 4 deletions reltools/ModuleDumper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private static string[] GetAsm(ModuleSectionNode node)
StartInfo = new ProcessStartInfo
{
FileName = Path.Combine(Path.GetDirectoryName(tmp), "lib/vdappc.exe"),
Arguments = $"{tmpPath} 0",
Arguments = $@"""{tmpPath}"" 0",
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true,
Expand Down Expand Up @@ -344,11 +344,10 @@ private unsafe string TryDumpString(VoidPtr addr, ref int i, ref bool needsAlign
private unsafe void DumpCode(ModuleSectionNode node, string filepath)
{
var lines = GetAsm(node);

if(lines.Length == 0)
if (lines.Length == 0)
{
LogOutput.AppendLine("Failed to get ASM!");
throw new Exception("Failed to disassembly target");
return;
}

using (var writer = File.CreateText(filepath))
Expand Down

0 comments on commit d6f3d79

Please sign in to comment.