Skip to main content

Crate libdonut_rs

Crate libdonut_rs 

Source
Expand description

§Donut Loader API

Public API for configuring and building Donut instances.

§Example

use std::io;
use libdonut_rs::{Donut, DonutConfig, DonutHttpInstance};

fn main() -> io::Result<()> {
    let http_opts = DonutHttpInstance::new("http://127.0.0.1:9001", Some("/payload.bin"), 5, Some("GET"), false);
    let cfg = DonutConfig::new("C:\\Windows\\System32\\calc.exe").http_options(Some(http_opts));
    println!("Created config: {cfg:?}");

    let mut donut = Donut::new(&cfg)?;
    println!("Created donut object");
    let bp = donut.build()?;
    println!("Finished building donut object");

    let payload = bp.payload();
    let metadata = bp.metadata();
    println!("Metadata: {metadata:?}");
    println!("Payload size: {}", payload.len());
    Ok(())
}

§Versioning

§Notes

  • This crate is under active development. APIs may change.

Re-exports§

pub use prelude::Donut;
pub use prelude::DonutConfig;
pub use prelude::DonutInstanceStub;
pub use prelude::DonutHttpInstance;
pub use prelude::DonutModule;
pub use prelude::DonutInstance;
pub use prelude::DonutResult;
pub use prelude::DonutError;

Modules§

prelude
Module re-exports

Macros§

critical
Critical-level log
debug
Debug-level log (compiled out in release by default).
error
Error-level log
info
Info-level log
success
Success-level log
warn
Warning-level log

Constants§

DONUT_API_VERSION
API version const
DONUT_DEBUG_INSTANCE_VERSION
Header value for the instance (debug mode)