Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --------------------------- SET COLORS VARIABLE USE FOR MESSAGES
- blue="0x00F21200"
- red1="0x000000FF"
- red2="0x00995500"
- white="0x00FFFFFF"
- --------------------------- SET COMBO BOX FOR BROWSER SELECTION
- al = combobox_getItems(UDF1.CEComboBox1)
- strings_clear(al)
- strings_add(al, 'Browser list...')
- strings_add(al, 'Firefox')
- strings_add(al, 'Google Chrome')
- strings_add(al, 'Internet Explorer')
- strings_add(al, 'Maxthon')
- strings_add(al, 'UC Browser')
- strings_add(al, 'Firefox Unity Game')
- strings_add(al, 'Opera')
- strings_add(al, 'Comodo Dragon')
- setProperty(UDF1.CEComboBox1 , "ItemIndex", "0")
- all_enabled = 0
- success = 1
- -------------------------- LOOK UP FOR PIDS
- errorOnLookupFailure(false)
- alreadycheckedPIDS={}
- openNextProcTimer = createTimer(nil,false)
- timer_setInterval(openNextProcTimer, 1000)
- timer_onTimer(openNextProcTimer,
- function(sender)
- local tempPIDtable = getPids()
- if #tempPIDtable == 0 then return end
- timer_setEnabled(sender,false)
- openProcess(tempPIDtable[1])
- end)
- function checkProcessMajor()
- reinitializeSymbolhandler()
- if getAddress("pepflashplayer.dll")~=0 or getAddress("AdobeCPGetAPI") ~=0 then
- return true
- end
- return false
- end
- function getPids()
- local SL=createStringlist()
- getProcesslist(SL)
- local tempPIDtable={}
- for i=0,strings_getCount(SL)-1 do
- local entry = strings_getString(SL,i)
- local processname = entry:sub(10,255)
- local PID = tonumber('0x'..entry:sub(1,8))
- if processname == "chrome.exe" then
- if alreadycheckedPIDS[PID]~=true then
- table.insert(tempPIDtable,PID)
- end
- end
- end
- object_destroy(SL)
- return tempPIDtable
- end
- function checkProcess(sender)
- timer_setEnabled(sender,false)
- alreadycheckedPIDS[getOpenedProcessID()]=true
- if checkProcessMajor() then
- timer_setEnabled(openNextProcTimer,false)
- alreadycheckedPIDS={}
- enableBrowserPid()
- else
- timer_setEnabled(openNextProcTimer,true)
- end
- end
- checkProcessTimer = createTimer(nil,false)
- timer_setInterval(checkProcessTimer, 100)
- timer_onTimer(checkProcessTimer, checkProcess)
- function onOpenProcess()
- if success == 1 then return end
- timer_setEnabled(checkProcessTimer,true)
- end
- ----------------------------------------- BROWSER SELECTOR
- function scanBrowser()
- AttachItems = combobox_getItems(UDF1.CEComboBox1)
- AttachIndex = combobox_getItemIndex(UDF1.CEComboBox1)
- local font = getProperty(UDF1.CELabel1 , "Font")
- setProperty(font, "Color", white)
- control_setCaption(UDF1.CELabel1, "Attached to PID: " .. "Scanning Process...")
- processMessages()
- if AttachIndex == -1 then return end
- if AttachIndex == 0 then
- control_setCaption(UDF1.CELabel1, "Attached to PID: " .. "no Browser selected.")
- return
- end
- local check = strings_getString(AttachItems,AttachIndex)
- --- Google Chrome
- if check == 'Google Chrome' then
- success = 0
- local test = openProcess("chrome.exe")
- if test == nil then
- setProperty(font , "Color", red1)
- control_setCaption(UDF1.CELabel1, "Attached to PID: " .. "Chrome not found.")
- timer_setEnabled(openNextProcTimer,false)
- return
- end
- strings_add(getAutoAttachList(),"chrome.exe")
- timer_setEnabled(openNextProcTimer,true)
- return
- end
- --- Firefox and IE
- if check == 'Firefox' or check == 'Internet Explorer' then openProcess("FlashPlayerPlugin") end
- errorOnLookupFailure(false)
- reinitializeSymbolhandler()
- err=getAddress("kernel32.dll")==0
- if err==true then
- setProperty(font , "Color", red1)
- control_setCaption(UDF1.CELabel1, "Attached to PID: " .. "Flash player plugin not found")
- else
- local PID=getOpenedProcessID()
- setProperty(font, "Color", white)
- control_setCaption(UDF1.CELabel1, "Attached to PID: " .. PID .. " - flash player plugin")
- end
- --- Maxthon
- local check = strings_getString(AttachItems,AttachIndex)
- if check == 'Maxthon' then
- success = 0
- local test = openProcess("Maxthon.exe")
- if test == nil then
- setProperty(font , "Color", red1)
- control_setCaption(UDF1.CELabel1, "Attached to PID: " .. "Maxthon not found.")
- timer_setEnabled(openNextProcTimer,false)
- return
- end
- strings_add(getAutoAttachList(),"Opera.exe")
- timer_setEnabled(openNextProcTimer,true)
- return
- end
- --- UC Browser
- --- Firefox Unity Game
- --- Opera
- local check = strings_getString(AttachItems,AttachIndex)
- if check == 'Opera' then
- success = 0
- local test = openProcess("Opera.exe")
- if test == nil then
- setProperty(font , "Color", red1)
- control_setCaption(UDF1.CELabel1, "Attached to PID: " .. "Opera not found.")
- timer_setEnabled(openNextProcTimer,false)
- return
- end
- strings_add(getAutoAttachList(),"Maxthon.exe")
- timer_setEnabled(openNextProcTimer,true)
- return
- end
- --- Comodo Dragon
- end
- ----------------------------------------- SHOW ENABLED BROWSER SELECTED PID
- function enableBrowserPid()
- setProperty(getProperty(UDF1.CELabel1 , "Font"), "Color", white)
- local PID=getOpenedProcessID()
- local check = strings_getString(AttachItems,AttachIndex)
- if check == 'Firefox' or check == 'Internet Explorer' then
- control_setCaption(UDF1.CELabel1, "Attached to PID: " .. PID .. " - flash player plugin")
- elseif check == 'Google Chrome' then
- control_setCaption(UDF1.CELabel1, "Attached to PID: " .. PID .. " - chrome.exe")
- elseif check == 'Maxthon' then
- control_setCaption(UDF1.CELabel1, "Attached to PID: " .. PID .. " - maxthon.exe")
- -- elseif check == 'UC Browser' then
- -- control_setCaption(UDF1.CELabel1, "Attached to PID: " .. PID .. " - UCBrowser.exe")
- -- elseif check == 'Firefox Unity Game' then
- -- control_setCaption(UDF1.CELabel1, "Attached to PID: " .. PID .. " - ??????.exe")
- -- elseif check == 'Opera' then
- -- control_setCaption(UDF1.CELabel1, "Attached to PID: " .. PID .. " - opera.exe")
- -- elseif check == 'Comodo Dragon' then
- -- control_setCaption(UDF1.CELabel1, "Attached to PID: " .. PID .. " - ???????exe")
- end
- success = 1
- end
- ----------------------------------------- SET ON CLICK FUNCTION AND CLOSING
- control_onClick(UDF1.CEButton1, scanBrowser)
- form_onClose(UDF1, CloseTrainer)
- form_show(UDF1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement