Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.49 KB | None | 0 0
  1. function checkProcessMajor()
  2.         reinitializeSymbolhandler()
  3.         if getAddress("pepflashplayer.dll")~=0 or
  4.                 getAddress("AdobeCPGetAPI")     ~=0 then
  5.                 return true
  6.         end
  7.         return false
  8. end
  9. alreadycheckedPIDS={}
  10. openNextProcTimer = createTimer(nil,false)
  11. timer_setInterval(openNextProcTimer, 1000)
  12. timer_onTimer(openNextProcTimer,
  13. function (sender)
  14.         local tempPIDtable = getPids()
  15.         if #tempPIDtable == 0 then return end
  16.         timer_setEnabled(sender,false)
  17.         openProcess(tempPIDtable[1])
  18. end
  19. )
  20. function getPids()
  21.         local SL=createStringlist()
  22.         getProcesslist(SL)
  23.         local tempPIDtable={}
  24.         for i=0,strings_getCount(SL)-1 do
  25.                 local entry = strings_getString(SL,i)
  26.                 local processname = entry:sub(10,255)
  27.                 local PID = tonumber('0x'..entry:sub(1,8))
  28.                 if processname == process then
  29.                         if alreadycheckedPIDS[PID]~=true then
  30.                                 table.insert(tempPIDtable,PID)
  31.                         end
  32.                 end
  33.         end
  34.         object_destroy(SL)
  35.         return tempPIDtable
  36. end
  37. function checkProcess(sender)
  38.         timer_setEnabled(sender,false)
  39.         alreadycheckedPIDS[getOpenedProcessID()]=true
  40.         if checkProcessMajor() then
  41.                 timer_setEnabled(openNextProcTimer,false)
  42.                 alreadycheckedPIDS={}
  43.                 enableCheatsGuiWhatEver()
  44.         else
  45.                 timer_setEnabled(openNextProcTimer,true)
  46.         end
  47. end
  48.  
  49. function AttachList()
  50.         AttachItems = combobox_getItems(AttachFirst[10])
  51.         AttachIndex = combobox_getItemIndex(AttachFirst[10])
  52.         if AttachIndex == -1 then return end
  53.         if AttachIndex == 0 then return showMessage("Selecione um processo:") end
  54.         if strings_getString(AttachItems,AttachIndex)=='chrome.exe' then return AttachToChrome() end
  55.         openProcess(strings_getString(AttachItems,AttachIndex))
  56.         errorOnLookupFailure(false)
  57.         reinitializeSymbolhandler()
  58.         err=getAddress("kernel32.dll")==0
  59.         if err==true then
  60.                 showMessage("Processo não encontrado.")
  61.         else
  62.                 local PID=getOpenedProcessID()
  63.                 control_setCaption(AttachFirst[9], "Aplicado ao PID nº: " .. PID)
  64.                 control_setEnabled(AttachFirst[3], true)
  65.                 showMessage("Sucesso")
  66.         end
  67. end
  68. function AttachClose()
  69.         closeCE()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement