Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if fo then fo.destroy() end
- fo = createForm()
- fo.Height = 100
- fo.Width = 400
- fo.Position = poScreenCenter
- drop = createComboBox(fo)
- drop.Width = fo.Width
- drop.Top = 0
- drop.Text = "All"
- drop.Font = getLuaEngine().mScript.Font -- make monospace based on lua engine script's font
- drop.ReadOnly = true
- l = createLabel(fo)
- l.Caption = 'Include Common Processes'
- l.Top = drop.Height + 5
- cb = createCheckBox(fo)
- cb.Top = l.Top
- cb.Left = l.Width + 5
- local function getIdName(str) return str:match('(%x+)%-(%w+)') end
- -- http://ccm.net/contents/533-windows-processes-introduction
- -- serpent.dump style lol
- local commonProcs = {["agentsvr.exe"]=1, ["defwatch.exe"]=1,
- ["monitor.exe"]=1, ["mcshield.exe"]=1, ["iamapp.exe"]=1, ["msnmsgr.exe"]=1,
- ["scardsvr.exe"]=1, ["updreg.exe"]=1, ["snmp.exe"]=1, ["dllhost.exe"]=1,
- ["hh.exe"]=1, ["netscp6.exe"]=1, ["helpctr.exe"]=1, ["nerocheck.exe"]=1,
- ["dw.exe"]=1, ["pstores.exe"]=1, ["point32.exe"]=1, ["ccregvfy.exe"]=1,
- ["wowexec.exe"]=1, ["snmptrap.exe"]=1, ["rpcss.exe"]=1, ["bcmsmmsg.exe"]=1,
- ["navapw32.exe"]=1, ["ypager.exe"]=1, ["ccapp.exe"]=1, ["rulaunch.exe"]=1,
- ["ddcman.exe"]=1, ["cconnect.exe"]=1, ["rnaapp.exe"]=1, ["taskswitch.exe"]=1,
- ["xl.exe"]=1, ["scanregw.exe"]=1, ["locator.exe"]=1, ["winword.exe"]=1,
- ["aim.exe"]=1, ["internat.exe"]=1, ["mssearch.exe"]=1, ["ctfmon.exe"]=1,
- ["kernel32.dll"]=1, ["notepad.exe"]=1, ["soffice.exe"]=1, ["atiptaxx.exe"]=1,
- ["unwise.exe"]=1, ["winzip32.exe"]=1, ["vshwin32.exe"]=1, ["wscript.exe"]=1,
- ["jusched.exe"]=1, ["wordpad.exe"]=1, ["mstask.exe"]=1, ["mspmspsv.exe"]=1,
- ["wkufind.exe"]=1, ["mprexe.exe"]=1, ["wkcalrem.exe"]=1, ["regedit.exe"]=1,
- ["wkdetect.exe"]=1, ["nwiz.exe"]=1, ["wins.exe"]=1, ["vsmon.exe"]=1,
- ["winvnc.exe"]=1, ["findfast.exe"]=1, ["winamp.exe"]=1, ["webscanx.exe"]=1,
- ["btwdins.exe"]=1, ["inetinfo.exe"]=1, ["ctsvccda.exe"]=1, ["qserver.exe"]=1,
- ["system"]=1, ["clisvcl.exe"]=1, ["sage.exe"]=1, ["msgsys.exe"]=1,
- ["iexplore.exe"]=1, ["spool32.exe"]=1, ["mdm.exe"]=1, ["ati2evxx.exe"]=1,
- ["wanmpsvc.exe"]=1, ["services.exe"]=1, ["userinit.exe"]=1, ["sgtray.exe"]=1,
- ["kbd.exe"]=1, ["reboot.exe"]=1, ["scm.exe"]=1, ["grpconv.exe"]=1,
- ["alg.exe"]=1, ["updatestats.exe"]=1, ["winlogon.exe"]=1, ["autorun.exe"]=1,
- ["wuser32.exe"]=1, ["mad.exe"]=1, ["runonce.exe"]=1, ["tkbell.exe"]=1,
- ["tgcmd.exe"]=1, ["tfswctrl.exe"]=1, ["mobsync.exe"]=1, ["studio.exe"]=1,
- ["stisvc.exe"]=1, ["livenote.exe"]=1, ["taskmon.exe"]=1, ["ntoskrnl.exe"]=1,
- ["realsched.exe"]=1, ["dit.exe"]=1, ["hidserv.exe"]=1, ["cmmpu.exe"]=1,
- ["wuauclt.exe"]=1, ["soundman.exe"]=1, ["netdde.exe"]=1, ["tapisrv.exe"]=1,
- ["wzqkpick.exe"]=1, ["actalert.exe"]=1, ["taskmgr.exe"]=1, ["sndvol32.exe"]=1,
- ["ccevtmgr.exe"]=1, ["cthelper.exe"]=1, ["smc.exe"]=1, ["em_exec.exe"]=1,
- ["avsynmgr.exe"]=1, ["dumprep.exe"]=1, ["acrotray.exe"]=1, ["winoa386.mod"]=1,
- ["cpd.exe"]=1, ["mmc.exe"]=1, ["firedaemon.exe"]=1, ["dfssvc.exe"]=1,
- ["osa.exe"]=1, ["winmgmt.exe"]=1, ["cdac11ba.exe"]=1, ["hkcmd.exe"]=1,
- ["svchost.exe"]=1, ["ntfrs.exe"]=1, ["mshta.exe"]=1, ["vptray.exe"]=1,
- ["ps2.exe"]=1, ["cvpnd.exe"]=1, ["ntvdm.exe"]=1, ["schwizex.exe"]=1,
- ["loadwc.exe"]=1, ["backweb-8876480.exe"]=1, ["psfree.exe"]=1,
- ["rtvscan.exe"]=1, ["rndal.exe"]=1, ["netscape.exe"]=1, ["wjview.exe"]=1,
- ["lsass.exe"]=1, ["mgabg.exe"]=1, ["uptodate.exe"]=1, ["ssdpsrv.exe"]=1,
- ["regsvc.exe"]=1, ["msimn.exe"]=1, ["ramsys.exe"]=1, ["ccpxysvc.exe"]=1,
- ["qttask.exe"]=1, ["nvsvc32.exe"]=1, ["evntsvc.exe"]=1, ["wcmdmgr.exe"]=1,
- ["devldr32.exe"]=1, ["avgcc32.exe"]=1, ["prpcui.exe"]=1, ["mnmsrvc.exe"]=1,
- ["lights.exe"]=1, ["dlg.exe"]=1, ["pctspk.exe"]=1, ["pds.exe"]=1,
- ["avgserv.exe"]=1, ["msiexec.exe"]=1, ["systray.exe"]=1, ["lexbces.exe"]=1,
- ["mapisp32.exe"]=1, ["acrord32.exe"]=1, ["nopdb.exe"]=1, ["osd.exe"]=1,
- ["rnathchk.exe"]=1, ["zlclient.exe"]=1, ["steam.exe"]=1, ["spoolss.exe"]=1,
- ["wmplayer.exe"]=1, ["agrsmmsg.exe"]=1, ["launch32.exe"]=1, ["ezsp_px.exe"]=1,
- ["msmsgs.exe"]=1, ["cisvc.exe"]=1, ["acsd.exe"]=1, ["wcescomm.exe"]=1,
- ["mplayer2.exe"]=1, ["tcpsvcs.exe"]=1, ["dsentry.exe"]=1, ["dmadmin.exe"]=1,
- ["mmtask.exe"]=1, ["mm_tray.exe"]=1, ["lvcoms.exe"]=1, ["lucomserver.exe"]=1,
- ["sbhc.exe"]=1, ["smss.exe"]=1, ["mmtask.tsk"]=1, ["stimon.exe"]=1,
- ["lexpps.exe"]=1, ["urlmap.exe"]=1, ["kazaa.exe"]=1, ["setup.exe"]=1,
- ["promon.exe"]=1, ["ireike.exe"]=1, ["atrack.exe"]=1, ["imapi.exe"]=1,
- ["spoolsv.exe"]=1, ["igfxtray.exe"]=1, ["srvany.exe"]=1, ["htpatch.exe"]=1,
- ["gamechannel.exe"]=1, ["mspaint.exe"]=1, ["sentry.exe"]=1, ["msconfig.exe"]=1,
- ["dxdllreg.exe"]=1, ["damon.exe"]=1, ["wisptis.exe"]=1, ["cmd.exe"]=1,
- ["pinger.exe"]=1, ["msgsrv32.exe"]=1, ["ddhelp.exe"]=1, ["directcd.exe"]=1,
- ["apoint.exe"]=1, ["cdplayer.exe"]=1, ["ptsnoop.exe"]=1, ["javaw.exe"]=1,
- ["mssvc.exe"]=1, ["realplay.exe"]=1, ["navapsvc.exe"]=1, ["msoobe.exe"]=1,
- ["msdtc.exe"]=1, ["cidaemon.exe"]=1, ["csrss.exe"]=1, ["wmiprvse.exe"]=1,
- ["dns.exe"]=1, ["ismserv.exe"]=1, ["rundll32.exe"]=1, ["xfr.exe"]=1,
- ["carpserv.exe"]=1, ["starteak.exe"]=1, ["sagent2.exe"]=1, ["nisum.exe"]=1,
- ["regsvr32.exe"]=1, ["mtx.exe"]=1, ["explorer.exe"]=1, ["wmiexe.exe"]=1,
- ["dadapp.exe"]=1, ["loadqm.exe"]=1,
- ['Dropbox.exe']=1, ['OneDrive.exe']=1,['Discord.exe']=1,['RuntimeBroker.exe']=1,
- ['Riot.exe']=1}
- -- getWindowlist doesn't actually seem to work well but... it's an option anyways
- local function updateList(list, dontCheckCommon, windowList)
- list.clear()
- local sorted = {}
- local plist = windowList and getWindowlist() or getProcesslist()
- local checkCommon = not windowList and not dontCheckCommon
- for id,name in pairs(plist) do
- item = ('%08X'):format(id) .. '-' .. name -- same format as getProcessList(list)
- if not checkCommon or not commonProcs[name] then
- sorted[#sorted+1] = item
- end
- end
- table.sort(sorted, function(a,b)
- local aid,aname = getIdName(a)
- local bid,bname = getIdName(b)
- return aname < bname
- end)
- for _,item in ipairs(sorted) do list.add(item) end
- end
- updateList(drop.Items)
- drop.OnChange = function(sender)
- local proc = sender.Items[sender.ItemIndex]
- local idString, name = getIdName(proc)
- local id = tonumber(idString,16)
- openProcess(id)
- end
- cb.OnChange = function(sender)
- updateList(drop.Items, sender.Checked)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement