Skip to content

Rust crate to get the processes list on the operating system, with their name and id

License

Notifications You must be signed in to change notification settings

mgostIH/process_list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Functionalities

This crate exposes functionalities for dealing with processes and modules loaded inside them in a streaming manner.

Process Listing

This crate exposes a for_each_process function to deal sequentially with every process open in the operating system.

Example

Printing every process to stdout

use std::path::{Path, PathBuf};
use process_list::for_each_process;
fn print_processes(id : u32, name : &Path) {
    println!("Id: {} --- Name: {}", id, name.display());
}

for_each_process(print_processes).unwrap();

Modules Listing

This crate exposes a for_each_module function to deal sequentially with every module loaded in a process.

Example

Printing every module loaded in the current process to stdout

use process_list::for_each_module;
use std::process;

fn print_stuff() {
    env_logger::init();
    for_each_module(process::id(), |(address, size), name| {
        println!("{:016X} - {} \t {}", address, size, name.display())
    })
    .unwrap();
}

Features

You can enable the log feature of this crate in order to get logging from it.

Support

For now only Windows is supported, but it should be simple enough to port on other operating systems.

It's not a priority but pull requests are well accepted.

About

Rust crate to get the processes list on the operating system, with their name and id

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages