Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions implants/imix/src/install.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use anyhow::{anyhow, Result};
use eldritch::runtime::Message;
use pb::eldritch::Tome;
use std::{collections::HashMap, fmt::Write};
use std::collections::HashMap;

pub async fn install() {
#[cfg(debug_assertions)]
Expand Down
2 changes: 1 addition & 1 deletion implants/imix/src/task.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::Result;
use eldritch::runtime::messages::Dispatcher;
use pb::c2::{ReportTaskOutputRequest, Task, TaskError, TaskOutput};
use pb::c2::{ReportTaskOutputRequest, TaskError, TaskOutput};
use transport::Transport;

/*
Expand Down
4 changes: 2 additions & 2 deletions implants/lib/eldritch/src/file/read_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ pub fn read(path: String) -> Result<String> {
let data = fs::read_to_string(entry_path)?;
res.push_str(data.as_str());
}
Err(local_err) => {
Err(_err) => {
#[cfg(debug_assertions)]
log::debug!("Failed to parse glob {}\n{}", path, local_err);
log::debug!("Failed to parse glob {}\n{}", path, _err);
}
}
}
Expand Down
27 changes: 12 additions & 15 deletions implants/lib/eldritch/src/runtime/messages/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@ pub use report_text::ReportTextMessage;
pub use transport::Transport;

use anyhow::Result;
use derive_more::From;
use derive_more::{Display, From};
use report_agg_output::ReportAggOutputMessage;
use std::future::Future;

#[cfg(debug_assertions)]
use derive_more::Display;

// Dispatcher defines the shared "dispatch" method used by all `Message` variants to send their data using a transport.
pub trait Dispatcher {
fn dispatch(self, transport: &mut impl Transport) -> impl Future<Output = Result<()>> + Send;
Expand All @@ -38,34 +35,34 @@ pub trait Dispatcher {
* This enables eldritch library functions to communicate with the caller API, enabling structured data reporting
* as well as resource requests (e.g. fetching assets).
*/
#[cfg_attr(debug_assertions, derive(Debug, Display, PartialEq))]
#[derive(From, Clone)]
#[cfg_attr(debug_assertions, derive(Debug, PartialEq))]
#[derive(Display, From, Clone)]
pub enum Message {
#[cfg_attr(debug_assertions, display(fmt = "FetchAsset"))]
#[display(fmt = "FetchAsset")]
FetchAsset(FetchAssetMessage),

#[cfg_attr(debug_assertions, display(fmt = "ReportCredential"))]
#[display(fmt = "ReportCredential")]
ReportCredential(ReportCredentialMessage),

#[cfg_attr(debug_assertions, display(fmt = "ReportError"))]
#[display(fmt = "ReportError")]
ReportError(ReportErrorMessage),

#[cfg_attr(debug_assertions, display(fmt = "ReportFile"))]
#[display(fmt = "ReportFile")]
ReportFile(ReportFileMessage),

#[cfg_attr(debug_assertions, display(fmt = "ReportProcessList"))]
#[display(fmt = "ReportProcessList")]
ReportProcessList(ReportProcessListMessage),

#[cfg_attr(debug_assertions, display(fmt = "ReportText"))]
#[display(fmt = "ReportText")]
ReportText(ReportTextMessage),

#[cfg_attr(debug_assertions, display(fmt = "ReportStart"))]
#[display(fmt = "ReportStart")]
ReportStart(ReportStartMessage),

#[cfg_attr(debug_assertions, display(fmt = "ReportFinish"))]
#[display(fmt = "ReportFinish")]
ReportFinish(ReportFinishMessage),

#[cfg_attr(debug_assertions, display(fmt = "ReportAggOutput"))]
#[display(fmt = "ReportAggOutput")]
ReportAggOutput(ReportAggOutputMessage),
}

Expand Down