Advertisement
Guest User

Untitled

a guest
Mar 18th, 2018
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.19 KB | None | 0 0
  1. if fo then fo.destroy() end
  2. fo = createForm()
  3. fo.Height = 100
  4. fo.Width = 400
  5. fo.Position = poScreenCenter
  6.  
  7. drop = createComboBox(fo)
  8. drop.Width = fo.Width
  9. drop.Top = 0
  10. drop.Text = "All"
  11. drop.Font = getLuaEngine().mScript.Font -- make monospace based on lua engine script's font
  12. drop.ReadOnly = true
  13.  
  14. l = createLabel(fo)
  15. l.Caption = 'Include Common Processes'
  16. l.Top = drop.Height + 5
  17.  
  18. cb = createCheckBox(fo)
  19. cb.Top = l.Top
  20. cb.Left = l.Width + 5
  21.  
  22. local function getIdName(str) return str:match('(%x+)%-(%w+)') end
  23.  
  24. -- http://ccm.net/contents/533-windows-processes-introduction
  25. -- serpent.dump style lol
  26. local commonProcs = {["agentsvr.exe"]=1, ["defwatch.exe"]=1,
  27. ["monitor.exe"]=1, ["mcshield.exe"]=1, ["iamapp.exe"]=1, ["msnmsgr.exe"]=1,
  28. ["scardsvr.exe"]=1, ["updreg.exe"]=1, ["snmp.exe"]=1, ["dllhost.exe"]=1,
  29. ["hh.exe"]=1, ["netscp6.exe"]=1, ["helpctr.exe"]=1, ["nerocheck.exe"]=1,
  30. ["dw.exe"]=1, ["pstores.exe"]=1, ["point32.exe"]=1, ["ccregvfy.exe"]=1,
  31. ["wowexec.exe"]=1, ["snmptrap.exe"]=1, ["rpcss.exe"]=1, ["bcmsmmsg.exe"]=1,
  32. ["navapw32.exe"]=1, ["ypager.exe"]=1, ["ccapp.exe"]=1, ["rulaunch.exe"]=1,
  33. ["ddcman.exe"]=1, ["cconnect.exe"]=1, ["rnaapp.exe"]=1, ["taskswitch.exe"]=1,
  34. ["xl.exe"]=1, ["scanregw.exe"]=1, ["locator.exe"]=1, ["winword.exe"]=1,
  35. ["aim.exe"]=1, ["internat.exe"]=1, ["mssearch.exe"]=1, ["ctfmon.exe"]=1,
  36. ["kernel32.dll"]=1, ["notepad.exe"]=1, ["soffice.exe"]=1, ["atiptaxx.exe"]=1,
  37. ["unwise.exe"]=1, ["winzip32.exe"]=1, ["vshwin32.exe"]=1, ["wscript.exe"]=1,
  38. ["jusched.exe"]=1, ["wordpad.exe"]=1, ["mstask.exe"]=1, ["mspmspsv.exe"]=1,
  39. ["wkufind.exe"]=1, ["mprexe.exe"]=1, ["wkcalrem.exe"]=1, ["regedit.exe"]=1,
  40. ["wkdetect.exe"]=1, ["nwiz.exe"]=1, ["wins.exe"]=1, ["vsmon.exe"]=1,
  41. ["winvnc.exe"]=1, ["findfast.exe"]=1, ["winamp.exe"]=1, ["webscanx.exe"]=1,
  42. ["btwdins.exe"]=1, ["inetinfo.exe"]=1, ["ctsvccda.exe"]=1, ["qserver.exe"]=1,
  43. ["system"]=1, ["clisvcl.exe"]=1, ["sage.exe"]=1, ["msgsys.exe"]=1,
  44. ["iexplore.exe"]=1, ["spool32.exe"]=1, ["mdm.exe"]=1, ["ati2evxx.exe"]=1,
  45. ["wanmpsvc.exe"]=1, ["services.exe"]=1, ["userinit.exe"]=1, ["sgtray.exe"]=1,
  46. ["kbd.exe"]=1, ["reboot.exe"]=1, ["scm.exe"]=1, ["grpconv.exe"]=1,
  47. ["alg.exe"]=1, ["updatestats.exe"]=1, ["winlogon.exe"]=1, ["autorun.exe"]=1,
  48. ["wuser32.exe"]=1, ["mad.exe"]=1, ["runonce.exe"]=1, ["tkbell.exe"]=1,
  49. ["tgcmd.exe"]=1, ["tfswctrl.exe"]=1, ["mobsync.exe"]=1, ["studio.exe"]=1,
  50. ["stisvc.exe"]=1, ["livenote.exe"]=1, ["taskmon.exe"]=1, ["ntoskrnl.exe"]=1,
  51. ["realsched.exe"]=1, ["dit.exe"]=1, ["hidserv.exe"]=1, ["cmmpu.exe"]=1,
  52. ["wuauclt.exe"]=1, ["soundman.exe"]=1, ["netdde.exe"]=1, ["tapisrv.exe"]=1,
  53. ["wzqkpick.exe"]=1, ["actalert.exe"]=1, ["taskmgr.exe"]=1, ["sndvol32.exe"]=1,
  54. ["ccevtmgr.exe"]=1, ["cthelper.exe"]=1, ["smc.exe"]=1, ["em_exec.exe"]=1,
  55. ["avsynmgr.exe"]=1, ["dumprep.exe"]=1, ["acrotray.exe"]=1, ["winoa386.mod"]=1,
  56. ["cpd.exe"]=1, ["mmc.exe"]=1, ["firedaemon.exe"]=1, ["dfssvc.exe"]=1,
  57. ["osa.exe"]=1, ["winmgmt.exe"]=1, ["cdac11ba.exe"]=1, ["hkcmd.exe"]=1,
  58. ["svchost.exe"]=1, ["ntfrs.exe"]=1, ["mshta.exe"]=1, ["vptray.exe"]=1,
  59. ["ps2.exe"]=1, ["cvpnd.exe"]=1, ["ntvdm.exe"]=1, ["schwizex.exe"]=1,
  60. ["loadwc.exe"]=1, ["backweb-8876480.exe"]=1, ["psfree.exe"]=1,
  61. ["rtvscan.exe"]=1, ["rndal.exe"]=1, ["netscape.exe"]=1, ["wjview.exe"]=1,
  62. ["lsass.exe"]=1, ["mgabg.exe"]=1, ["uptodate.exe"]=1, ["ssdpsrv.exe"]=1,
  63. ["regsvc.exe"]=1, ["msimn.exe"]=1, ["ramsys.exe"]=1, ["ccpxysvc.exe"]=1,
  64. ["qttask.exe"]=1, ["nvsvc32.exe"]=1, ["evntsvc.exe"]=1, ["wcmdmgr.exe"]=1,
  65. ["devldr32.exe"]=1, ["avgcc32.exe"]=1, ["prpcui.exe"]=1, ["mnmsrvc.exe"]=1,
  66. ["lights.exe"]=1, ["dlg.exe"]=1, ["pctspk.exe"]=1, ["pds.exe"]=1,
  67. ["avgserv.exe"]=1, ["msiexec.exe"]=1, ["systray.exe"]=1, ["lexbces.exe"]=1,
  68. ["mapisp32.exe"]=1, ["acrord32.exe"]=1, ["nopdb.exe"]=1, ["osd.exe"]=1,
  69. ["rnathchk.exe"]=1, ["zlclient.exe"]=1, ["steam.exe"]=1, ["spoolss.exe"]=1,
  70. ["wmplayer.exe"]=1, ["agrsmmsg.exe"]=1, ["launch32.exe"]=1, ["ezsp_px.exe"]=1,
  71. ["msmsgs.exe"]=1, ["cisvc.exe"]=1, ["acsd.exe"]=1, ["wcescomm.exe"]=1,
  72. ["mplayer2.exe"]=1, ["tcpsvcs.exe"]=1, ["dsentry.exe"]=1, ["dmadmin.exe"]=1,
  73. ["mmtask.exe"]=1, ["mm_tray.exe"]=1, ["lvcoms.exe"]=1, ["lucomserver.exe"]=1,
  74. ["sbhc.exe"]=1, ["smss.exe"]=1, ["mmtask.tsk"]=1, ["stimon.exe"]=1,
  75. ["lexpps.exe"]=1, ["urlmap.exe"]=1, ["kazaa.exe"]=1, ["setup.exe"]=1,
  76. ["promon.exe"]=1, ["ireike.exe"]=1, ["atrack.exe"]=1, ["imapi.exe"]=1,
  77. ["spoolsv.exe"]=1, ["igfxtray.exe"]=1, ["srvany.exe"]=1, ["htpatch.exe"]=1,
  78. ["gamechannel.exe"]=1, ["mspaint.exe"]=1, ["sentry.exe"]=1, ["msconfig.exe"]=1,
  79. ["dxdllreg.exe"]=1, ["damon.exe"]=1, ["wisptis.exe"]=1, ["cmd.exe"]=1,
  80. ["pinger.exe"]=1, ["msgsrv32.exe"]=1, ["ddhelp.exe"]=1, ["directcd.exe"]=1,
  81. ["apoint.exe"]=1, ["cdplayer.exe"]=1, ["ptsnoop.exe"]=1, ["javaw.exe"]=1,
  82. ["mssvc.exe"]=1, ["realplay.exe"]=1, ["navapsvc.exe"]=1, ["msoobe.exe"]=1,
  83. ["msdtc.exe"]=1, ["cidaemon.exe"]=1, ["csrss.exe"]=1, ["wmiprvse.exe"]=1,
  84. ["dns.exe"]=1, ["ismserv.exe"]=1, ["rundll32.exe"]=1, ["xfr.exe"]=1,
  85. ["carpserv.exe"]=1, ["starteak.exe"]=1, ["sagent2.exe"]=1, ["nisum.exe"]=1,
  86. ["regsvr32.exe"]=1, ["mtx.exe"]=1, ["explorer.exe"]=1, ["wmiexe.exe"]=1,
  87. ["dadapp.exe"]=1, ["loadqm.exe"]=1,
  88. ['Dropbox.exe']=1, ['OneDrive.exe']=1,['Discord.exe']=1,['RuntimeBroker.exe']=1,
  89. ['Riot.exe']=1}
  90.  
  91. -- getWindowlist doesn't actually seem to work well but... it's an option anyways
  92. local function updateList(list, dontCheckCommon, windowList)
  93.   list.clear()
  94.   local sorted = {}
  95.   local plist = windowList and getWindowlist() or getProcesslist()
  96.   local checkCommon = not windowList and not dontCheckCommon
  97.   for id,name in pairs(plist) do
  98.     item = ('%08X'):format(id) .. '-' .. name -- same format as getProcessList(list)
  99.     if not checkCommon or not commonProcs[name] then
  100.       sorted[#sorted+1] = item
  101.     end
  102.   end
  103.   table.sort(sorted, function(a,b)
  104.     local aid,aname = getIdName(a)
  105.     local bid,bname = getIdName(b)
  106.     return aname < bname
  107.   end)
  108.   for _,item in ipairs(sorted) do list.add(item) end
  109. end
  110. updateList(drop.Items)
  111.  
  112. drop.OnChange = function(sender)
  113.   local proc = sender.Items[sender.ItemIndex]
  114.   local idString, name = getIdName(proc)
  115.   local id = tonumber(idString,16)
  116.   openProcess(id)
  117. end
  118.  
  119.  
  120. cb.OnChange = function(sender)
  121.   updateList(drop.Items, sender.Checked)
  122. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement