Beispiel #1
0
        private async Task <ReverseEngineerResult> GetOutputAsync()
        {
            var path = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()) + ".json";

            File.WriteAllText(path, options.Write());

            var launchPath = DropNetCoreFiles();

            var startInfo = new ProcessStartInfo
            {
                FileName  = "dotnet",
                Arguments = $"\"{launchPath}\" \"{path}\"",
            };

            var standardOutput = await RunProcessAsync(startInfo);

            try
            {
                File.Delete(path);
            }
            catch
            {
                // Ignore
            }

            return(resultDeserializer.BuildResult(standardOutput));
        }
        public ReverseEngineerResult GetOutput()
        {
            if (!IsDotnetInstalled())
            {
                throw new Exception($"Reverse engineer error: Unable to launch 'dotnet' version 3 or newer. Do you have it installed?");
            }

            var path = Path.GetTempFileName() + "json";

            File.WriteAllText(path, options.Write());

            var launchPath = DropNetCoreFiles();

            var startInfo = new ProcessStartInfo
            {
                FileName               = Path.Combine(launchPath ?? throw new InvalidOperationException(), "efreveng.exe"),
                Arguments              = "\"" + path + "\"",
                UseShellExecute        = false,
                RedirectStandardOutput = true,
                RedirectStandardError  = true,
                CreateNoWindow         = true
            };

            var standardOutput = RunProcess(startInfo);

            return(BuildResult(standardOutput));
        }
        public ReverseEngineerResult GetOutput()
        {
            var path = Path.GetTempFileName() + "json";

            File.WriteAllText(path, options.Write());

            var launchPath = DropNetCoreFiles();

            var startInfo = new ProcessStartInfo
            {
                FileName               = Path.Combine(launchPath ?? throw new InvalidOperationException(), "efreveng.exe"),
                Arguments              = "\"" + path + "\"",
                UseShellExecute        = false,
                RedirectStandardOutput = true,
                RedirectStandardError  = true,
                CreateNoWindow         = true
            };

            var standardOutput = new StringBuilder();

            using (var process = Process.Start(startInfo))
            {
                while (process != null && !process.HasExited)
                {
                    standardOutput.Append(process.StandardOutput.ReadToEnd());
                }
                if (process != null)
                {
                    standardOutput.Append(process.StandardOutput.ReadToEnd());
                }
            }

            return(BuildResult(standardOutput.ToString()));
        }
Beispiel #4
0
        private ReverseEngineerResult GetOutput()
        {
            var path = Path.GetTempFileName() + "json";

            File.WriteAllText(path, options.Write());

            var launchPath = Path.Combine(Path.GetTempPath(), "efreveng");

            var startInfo = new ProcessStartInfo
            {
                FileName  = Path.Combine(launchPath ?? throw new InvalidOperationException(), GetExeName()),
                Arguments = "\"" + path + "\"",
            };

            var standardOutput = RunProcess(startInfo);

            return(resultDeserializer.BuildResult(standardOutput));
        }
        public ReverseEngineerResult GetOutput()
        {
            var path = Path.GetTempFileName() + "json";

            File.WriteAllText(path, options.Write());

            var launchPath = Path.Combine(Path.GetTempPath(), "efreveng");

            var startInfo = new ProcessStartInfo
            {
                FileName               = Path.Combine(launchPath ?? throw new InvalidOperationException(), GetExeName()),
                Arguments              = "\"" + path + "\"",
                UseShellExecute        = false,
                RedirectStandardOutput = true,
                RedirectStandardError  = true,
                CreateNoWindow         = true
            };

            var standardOutput = RunProcess(startInfo);

            return(resultDeserializer.BuildResult(standardOutput));
        }
        private async Task <ReverseEngineerResult> GetOutputAsync()
        {
            var path = Path.GetTempFileName() + ".json";

            File.WriteAllText(path, options.Write());

            var launchPath = await DropNetCoreFilesAsync();

            var startInfo = new ProcessStartInfo
            {
                FileName  = Path.Combine(launchPath ?? throw new InvalidOperationException(), GetExeName()),
                Arguments = "\"" + path + "\"",
            };

            var standardOutput = await RunProcessAsync(startInfo);

            try
            {
                File.Delete(path);
            }
            catch { }

            return(resultDeserializer.BuildResult(standardOutput));
        }