tasklist-rs

tasklist-rs

a small crate let you can easily get tasklist and process information on windows

what information you can get

  1. Process name,pid,parrentID,theradsID.
  2. Process starttime,exittime,and CPU_time(including kernel time and user time).
  3. Process path and commandline params.
  4. Process SID and Domain/User.
  5. Process IO infomation , including all of IO_COUNTERS member.
  6. Process memory information , including all of PROCESS_MEMORY_COUNTERS member.
  7. Process handles information , use GetProcessHandleCount Api.
  8. Process file infomation , use GetFileVersionInfoExW Api.
  9. Pterate over all processes

remember some infomation need higher privilege in some specific windows versions

example

```rust use tasklist;

fn main(){

unsafe{
    let tl = tasklist::Tasklist::new();
    for i in tl{
        println!("{} {} {}",i.get_pid(),i.get_pname(),i.get_user());
    }
}

} ```

tasklist-rs

```rust use tasklist;

fn main(){ for i in unsafe{tasklist::Tasklist::new()}{ let cpn = match i.getfileinfo().get("CompanyName"){ Some(h)=>h.tostring(), None=>"".tostring(), }; let des = match i.getfileinfo().get("FileDescription"){ Some(h)=>h.tostring(), None=>"".tostring(), }; println!("\t{} \t{} \t{} \t{}",i.getpname(),i.getpid(),cpn,des) } } ```

tasklist-rs

Usage

Add this to your Cargo.toml:

toml [dependencies] tasklist = "0.2.0"