2026-02-16 10:03:23 -07:00
|
|
|
use unshell::{info, tree::Branch};
|
2025-11-12 17:39:11 -07:00
|
|
|
|
2025-11-05 22:59:01 -07:00
|
|
|
fn main() {
|
2026-02-16 10:03:23 -07:00
|
|
|
let mut manager = Branch::new();
|
2026-02-04 22:19:16 -07:00
|
|
|
manager.init_logger();
|
2025-11-05 15:17:31 -07:00
|
|
|
|
2026-02-09 10:27:15 -07:00
|
|
|
info!("Test thing!");
|
2026-02-04 22:19:16 -07:00
|
|
|
info!("Test thing!");
|
|
|
|
|
|
2026-02-15 17:59:35 -07:00
|
|
|
// loop {
|
|
|
|
|
// if test123(&mut manager) {
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
2026-02-04 22:19:16 -07:00
|
|
|
|
2026-02-09 10:27:15 -07:00
|
|
|
// println!("Test");
|
2025-12-20 18:19:08 -07:00
|
|
|
}
|
2025-11-06 00:01:46 -07:00
|
|
|
|
2026-01-30 14:05:07 -07:00
|
|
|
// use std::{any::Any, collections::HashMap, fs::File, io::Read};
|
2025-11-24 13:13:06 -07:00
|
|
|
|
2026-01-30 14:05:07 -07:00
|
|
|
// use static_init::dynamic;
|
|
|
|
|
// use unshell_lib::{
|
|
|
|
|
// ModuleError,
|
|
|
|
|
// config::{PayloadConfig, RuntimeConfig},
|
|
|
|
|
// module::{Manager, Module},
|
|
|
|
|
// };
|
|
|
|
|
// use unshell_obfuscate::{obs, symbol};
|
2025-11-24 13:13:06 -07:00
|
|
|
|
2026-01-30 14:05:07 -07:00
|
|
|
// #[macro_use]
|
|
|
|
|
// extern crate unshell_lib;
|
2025-11-24 13:13:06 -07:00
|
|
|
|
2026-01-30 14:05:07 -07:00
|
|
|
// // The main and initial 'configuration' for a payload
|
2025-11-12 17:39:11 -07:00
|
|
|
|
2026-01-30 14:05:07 -07:00
|
|
|
// #[dynamic]
|
|
|
|
|
// static PAYLOAD_CONFIG: PayloadConfig = PayloadConfig {
|
|
|
|
|
// id: symbol!("Test ID"),
|
|
|
|
|
// components: Vec::new(),
|
|
|
|
|
// runtime_config: vec![RuntimeConfig {
|
|
|
|
|
// parent_component: symbol!("client").to_string(),
|
|
|
|
|
// name: symbol!("client runtime").to_string(),
|
|
|
|
|
// config: HashMap::from([
|
|
|
|
|
// (symbol!("host").to_string(), obs!("localhost:1234")),
|
|
|
|
|
// (symbol!("retry").to_string(), obs!("1000")),
|
|
|
|
|
// ]),
|
|
|
|
|
// }],
|
|
|
|
|
// };
|
2025-12-20 14:08:17 -07:00
|
|
|
|
2026-01-30 14:05:07 -07:00
|
|
|
// fn main() {
|
2025-11-25 14:27:06 -07:00
|
|
|
|
2026-01-30 14:05:07 -07:00
|
|
|
// debug!("Initialized");
|
2025-11-05 22:59:01 -07:00
|
|
|
|
2026-01-30 14:05:07 -07:00
|
|
|
// match run() {
|
|
|
|
|
// Ok(_) => {}
|
|
|
|
|
// Err(e) => {
|
|
|
|
|
// error!("ERROR! '{:?}'", e);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
2025-12-20 18:19:08 -07:00
|
|
|
|
2026-01-30 14:05:07 -07:00
|
|
|
// fn run() -> Result<(), Box<dyn std::error::Error>> {
|
|
|
|
|
// let args = std::env::args();
|
2025-12-20 18:19:08 -07:00
|
|
|
|
2026-01-30 14:05:07 -07:00
|
|
|
// // TEMPORARY, load the module paths from command line args.
|
|
|
|
|
// let mut modules = Vec::new();
|
|
|
|
|
// for arg in args.skip(1) {
|
|
|
|
|
// // debug!("Loading module: {}", arg);
|
2025-12-20 18:19:08 -07:00
|
|
|
|
2026-01-30 14:05:07 -07:00
|
|
|
// // let mut file = File::open(arg).map_err(|e| ModuleError::Error(e.to_string().into()))?;
|
|
|
|
|
// // let mut buffer = Vec::new();
|
|
|
|
|
// // file.read_to_end(&mut buffer)
|
|
|
|
|
// // .map_err(|e| ModuleError::Error(e.to_string().into()))?;
|
|
|
|
|
|
|
|
|
|
// debug!("Initializing module: {}", arg);
|
|
|
|
|
// let module = Module::new(&arg)?;
|
|
|
|
|
|
|
|
|
|
// modules.push(module);
|
|
|
|
|
|
|
|
|
|
// // modules.push(Module::new(&arg)?)
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// // let modules = vec
|
|
|
|
|
|
|
|
|
|
// debug!("Starting manager...");
|
|
|
|
|
|
|
|
|
|
// // Run the manager, this is blocking.
|
|
|
|
|
// let manager = Manager::start(&PAYLOAD_CONFIG, modules);
|
|
|
|
|
|
|
|
|
|
// Manager::join(manager);
|
|
|
|
|
|
|
|
|
|
// Ok(())
|
|
|
|
|
// }
|