Skip to content

Commit

Permalink
Seems to work (#796)
Browse files Browse the repository at this point in the history
  • Loading branch information
hulto authored Nov 4, 2024
1 parent 79ffc42 commit 3a96be6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/_docs/user-guide/imix.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ rustup target add x86_64-unknown-linux-musl
sudo apt update
sudo apt install musl-tools
cd realm/implants/imix/
RUSTFLAGS="-C target-feature=+crt-static" cargo build --release --target=x86_64-unknown-linux-musl
RUSTFLAGS="-C target-feature=+crt-static" cargo build --release --bin imix --target=x86_64-unknown-linux-musl
```

### MacOS
Expand Down
11 changes: 0 additions & 11 deletions implants/imix/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,11 @@ mod install;
mod run;
mod task;
mod version;
#[cfg(feature = "win_service")]
pub mod win_service;

#[tokio::main(flavor = "multi_thread", worker_threads = 128)]
pub async fn lib_entry() {
#[cfg(debug_assertions)]
run::init_logging();

#[cfg(feature = "win_service")]
match windows_service::service_dispatcher::start("imix", ffi_service_main) {
Ok(_) => {}
Err(_err) => {
#[cfg(debug_assertions)]
log::error!("Failed to start service (running as exe?): {_err}");
}
}

run::handle_main().await
}
4 changes: 3 additions & 1 deletion implants/imix/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#[cfg(all(feature = "win_service", windows))]
#[macro_use]
extern crate windows_service;
#[cfg(all(feature = "win_service", windows))]
mod win_service;

mod agent;
mod config;
Expand Down Expand Up @@ -43,6 +45,6 @@ define_windows_service!(ffi_service_main, service_main);
#[cfg(feature = "win_service")]
#[tokio::main(flavor = "multi_thread", worker_threads = 128)]
async fn service_main(arguments: Vec<std::ffi::OsString>) {
imix::win_service::handle_service_main(arguments);
crate::win_service::handle_service_main(arguments);
handle_main().await;
}

0 comments on commit 3a96be6

Please sign in to comment.