diff --git a/reltools/ModuleBuilder.cs b/reltools/ModuleBuilder.cs index 46a345e..75a9e16 100644 --- a/reltools/ModuleBuilder.cs +++ b/reltools/ModuleBuilder.cs @@ -221,7 +221,7 @@ private byte[] Compile(string asm, IEnumerable 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}\"", @@ -230,8 +230,8 @@ private byte[] Compile(string asm, IEnumerable 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) diff --git a/reltools/ModuleDumper.cs b/reltools/ModuleDumper.cs index 224a6b9..6f1d302 100644 --- a/reltools/ModuleDumper.cs +++ b/reltools/ModuleDumper.cs @@ -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, @@ -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))