Bl4ckC4t1337

procSpy

Jun 17th, 2021
662
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. get_procs_pids = function()
  2.     comp = get_shell.host_computer
  3.     procs = comp.show_procs()
  4.     procs = procs.split("\n")[1:]
  5.     proc_pids = {}
  6.     for proc in procs
  7.         proc_pids[proc.split(" ")[1]] = proc
  8.     end for
  9.     return proc_pids
  10. end function
  11.  
  12. display_history = function(history={}, proc_pids={})
  13.     for key in proc_pids.indexes
  14.         if not history.hasIndex(key) then
  15.             print("[Running] " + proc_pids[key])
  16.         end if
  17.     end for
  18.    
  19.     for key in history.indexes
  20.         if not proc_pids.hasIndex(key) then
  21.             print("[Stopped] " + history[key])
  22.         end if
  23.     end for
  24.     return proc_pids
  25. end function
  26.  
  27.  
  28. history = {}
  29.  
  30. while true
  31.     proc_pids = get_procs_pids()
  32.     history = display_history(history, proc_pids)
  33. end while
RAW Paste Data