iocutil 0.1.3

IoC utilities for malware researchers
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use iocutil::prelude::*;

fn main() {
    // use ContentHash to bundle of hashes(sha256 / sha1 / md5)

    // calculate hashes of file content
    let c = ContentHash::of_file(r"C:\Windows\notepad.exe").unwrap();
    println!("notepad.exe => {:?}", c);

    // calculate hashes of arbitrary content which implements std::io::Read with Hasher
    let mut hasher = Hasher::new();
    let mut res = reqwest::get("https://example.com/").unwrap();
    std::io::copy(&mut res, &mut hasher).unwrap();

    let c: ContentHash = hasher.digests();
    println!("example.com => {:?}", c);
}