Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Problem Attach Browser (on .exe trainer)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Yaiko
How do I cheat?
Reputation: 0

Joined: 01 Feb 2017
Posts: 2
Location: Colombia

PostPosted: Wed Feb 01, 2017 4:19 pm    Post subject: Problem Attach Browser (on .exe trainer) Reply with quote

Hello everyone, I have a problem with LUA script code, the creator it's "Corroder", the code it works good in .CETRAINER archive, but if i want to make an .EXE trainer i can not, because it can't find the browser.

Here it is the original code: forum.cheatengine. org/viewtopic.php?t=601158

Code:


f     = {}
f[1]  = createForm(false)
f[2]  = createGroupBox(f[1])
f[3]  = createLabel(f[2])
f[4] = createComboBox(f[2])
f[5] = createButton(f[2])
setProperty(f[1] , "ShowInTaskBar", 'stAlways')
setProperty(f[1] , "Position", "poScreenCenter")
setProperty(f[1] , "BiDiMode", "bdLeftToRight")
control_setSize(f[1], 425, 110)
control_setSize(f[2], 400, 90)
control_setSize(f[4], 255, 21)
control_setSize(f[5], 107, 28)
control_setPosition(f[2], 10, 5)
control_setPosition(f[3], 10, 45)
control_setPosition(f[4], 10, 15)
control_setPosition(f[5], 280, 15)
control_setCaption(f[1], "Attach Browser")
control_setCaption(f[3], "Attached To Process : Satus: waiting...")
control_setCaption(f[5], "Select Process")

al = combobox_getItems(f[4])
strings_clear(al)
strings_add(al, 'Browser list...')
strings_add(al, 'Google Chrome')
strings_add(al, 'Firefox')
strings_add(al, 'Firefox(Unity Game)')
strings_add(al, 'Maxthon')
strings_add(al, 'Gameroom')
strings_add(al, 'Gameroom (Unity Game)')
setProperty(f[4] , "ItemIndex", "0")
all_enabled = 0
success = 1

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={}
      enableHacks()
   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

function scanBrowser()
   AttachItems = combobox_getItems(f[4])
   AttachIndex = combobox_getItemIndex(f[4])
   control_setCaption(f[3], "Attached to PID: " .. "Scanning Process, Please wait...")
   processMessages()
   if AttachIndex == -1 then return end
   if AttachIndex == 0 then
       beep()
      beep()
      control_setCaption(f[3], "Attached to PID: " .. "no Browser selected.")
      return
   end
   local check = strings_getString(AttachItems,AttachIndex)
   if check == 'Google Chrome' then
      success = 0
      local test = openProcess("chrome.exe")
      if test == nil then
         beep()
          beep()
         control_setCaption(f[3], "Attached to PID: " .. "Chrome not found.")
         timer_setEnabled(openNextProcTimer,false)
         return
      end
      strings_add(getAutoAttachList(),"chrome.exe")
      timer_setEnabled(openNextProcTimer,true)
      return
   end

    local temp = false
   if check == 'Gameroom' then
      facebookarcadescan()
      return
   else
      temp = false
   end


   if check == 'Gameroom (Unity Game)' then
      facebookarcadeunityscan()
      return
   else
      temp = false
   end

   if check == 'Firefox' or check == 'Internet Explorer' or check == 'SeaMonkey Windows 7' then openProcess("FlashPlayerPlugin") end
      errorOnLookupFailure(false)
      reinitializeSymbolhandler()
      err=getAddress("kernel32.dll")==0
   if err==true then
      beep()
      beep()
      control_setCaption(f[3], "Attached to PID: " .. "Flash player plugin not found")
   else
      local PID=getOpenedProcessID()
      beep()
      control_setCaption(f[3], "Attached to PID: " .. PID .. " - flash player plugin")
   end

      if check == 'Firefox(Unity Game)' or check == 'Internet Explorer Windows XP' or check == 'SeaMonkey Windows XP' then openProcess("plugin-container.exe") end
      errorOnLookupFailure(false)
      reinitializeSymbolhandler()
      err=getAddress("kernel32.dll")==0
   if err==true then
      beep()
      beep()
      control_setCaption(f[3], "Attached to PID: " .. "Flash player plugin not found")
   else
      local PID=getOpenedProcessID()
      beep()
      control_setCaption(f[3], "Attached to PID: " .. PID .. " - flash player plugin")
   end

      local check = strings_getString(AttachItems,AttachIndex)
   if check == 'Maxthon' then
      success = 0
      local test = openProcess("Maxthon.exe")
      if test == nil then
         beep()
         beep()
         control_setCaption(f[3], "Attached to PID: " .. "Maxthon not found.")
         timer_setEnabled(openNextProcTimer,false)
         return
      end
      strings_add(getAutoAttachList(),"Maxthon.exe")
      timer_setEnabled(openNextProcTimer,true)
      return
   end
end

function facebookarcadescan (sender)
errorOnLookupFailure(false);
facebookarcade = openProcess("CefSharp.BrowserSubprocess.exe")
facebookarcadeAttach =   {
                  AllProcesses = {};
                  RightProccess = function () return (getAddress("CefSharp.BrowserSubprocess.exe")~=0 or getAddress("CefSharp.BrowserSubprocess.exe")~=0) end;
                  FindProcess = function () if (facebookarcadeAttach.Started) then return end; if (#facebookarcadeAttach.AllProcesses == 0) then facebookarcadeAttach.GetfacebookarcadeProcesses(); end; createNativeThread(function ()   facebookarcadeAttach.Started = true; for k,v in pairs(facebookarcadeAttach.AllProcesses) do openProcess(k); reinitializeSymbolhandler(); if (facebookarcadeAttach.RightProccess()) then facebookarcadeAttach.Function(); facebookarcadeAttach.Started = false; break; end; end; facebookarcadeAttach.AllProcesses = {}; facebookarcadeAttach.Started = false; end); end;
                  GetfacebookarcadeProcesses = function () local SL=createStringlist(); getProcesslist(SL); 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:lower() == 'CefSharp.BrowserSubprocess.exe' then facebookarcadeAttach.AllProcesses[PID] = true; end; end; end;
                  Started = false;
                  Start = function (Function) facebookarcadeAttach.Function = Function; facebookarcadeAttach.FindProcess();end;
                  Function = nil;

               };

facebookarcadeAttach.Start(function () messageDialog('Attached to Gameroom', mtInformation, mbOK); end)
      errorOnLookupFailure(false)
      reinitializeSymbolhandler()
      err=getAddress("CefSharp.BrowserSubprocess.exe")==0
   if err==true then
      beep()
      beep()
      control_setCaption(f[3], "Attached to PID: " .. "Gameroom Not Found")
   else
      local PID=getOpenedProcessID()
      beep()
      control_setCaption(f[3], "Attached to PID: " .. PID .. " - Gameroom")
   end
end

function facebookarcadeunityscan (sender)
errorOnLookupFailure(false);
facebookarcadeunity = openProcess("fbunity")
facebookarcadeunityAttach =   {
                  AllProcesses = {};
                  RightProccess = function () return (getAddress("fbunity")~=0 or getAddress("fbunity")~=0) end;
                  FindProcess = function () if (facebookarcadeunityAttach.Started) then return end; if (#facebookarcadeunityAttach.AllProcesses == 0) then facebookarcadeunityAttach.GetfacebookarcadeunityProcesses(); end; createNativeThread(function ()   facebookarcadeunityAttach.Started = true; for k,v in pairs(facebookarcadeunityAttach.AllProcesses) do openProcess(k); reinitializeSymbolhandler(); if (facebookarcadeunityAttach.RightProccess()) then facebookarcadeunityAttach.Function(); facebookarcadeunityAttach.Started = false; break; end; end; facebookarcadeunityAttach.AllProcesses = {}; facebookarcadeunityAttach.Started = false; end); end;
                  GetfacebookarcadeunityProcesses = function () local SL=createStringlist(); getProcesslist(SL); 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:lower() == 'fbunity' then facebookarcadeunityAttach.AllProcesses[PID] = true; end; end; end;
                  Started = false;
                  Start = function (Function) facebookarcadeunityAttach.Function = Function; facebookarcadeunityAttach.FindProcess();end;
                  Function = nil;

               };

facebookarcadeunityAttach.Start(function () messageDialog('Attached to Gameroom', mtInformation, mbOK); end)
      errorOnLookupFailure(false)
      reinitializeSymbolhandler()
      err=getAddress("fbunity")==0
   if err==false then
      beep()
      beep()
      control_setCaption(f[3], "Attached to PID: " .. "Gameroom Unity Game Not Found")
   else
      local PID=getOpenedProcessID()
      beep()
      control_setCaption(f[3], "Attached to PID: " .. PID .. " - Gameroom(Unity Game)")
   end
end

function enableHacks()
   setProperty(getProperty(f[3] , "Font"), "Color", white)
   local PID=getOpenedProcessID()
   local check = strings_getString(AttachItems,AttachIndex)
   if check == 'Firefox' or check == 'Internet Explorer' then
      control_setCaption(f[3], "Attached to PID: " .. PID .. " - flash player plugin")
      beep()
    elseif check == 'Google Chrome' then
      control_setCaption(f[3], "Attached to PID: " .. PID .. " - chrome.exe")
      beep()
   elseif check == 'Maxthon' then
      control_setCaption(f[3], "Attached to PID: " .. PID .. " - Maxthon.exe")
       beep()
    elseif check == 'SeaMonkey' then
      control_setCaption(f[3], "Attached to PID: " .. PID .. " - SeaMonkey")
       beep()
    end
   success = 1
end

function CloseTrainer()
   form_hide(f[1])
   closeCE()
end

control_onClick(f[5], scanBrowser)
form_onClose(f[1], CloseTrainer)
form_show(f[1])



Thanks...
Back to top
View user's profile Send private message Send e-mail
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Wed Feb 01, 2017 6:37 pm    Post subject: Reply with quote

The script seem only check for flashplayer_plugin or plugin-container. It's mean the script has created for browser game.

Then this one (work for CE 6.6), will check all process running in memory when you click open attach button, if you want attach flashplayer_plugin, choose the first one in process list. If you want attach FB Game room, choose the third or fourth FBG process. Also this one can save as standalone trainer with no issues.

other post : http://forum.cheatengine.org/viewtopic.php?t=601158



Attach_Browser_04_All_Process_CE6.6.CT
 Description:

Download
 Filename:  Attach_Browser_04_All_Process_CE6.6.CT
 Filesize:  2.79 KB
 Downloaded:  771 Time(s)

Back to top
View user's profile Send private message
Yaiko
How do I cheat?
Reputation: 0

Joined: 01 Feb 2017
Posts: 2
Location: Colombia

PostPosted: Wed Feb 01, 2017 8:01 pm    Post subject: Reply with quote

Corroder wrote:
The script seem only check for flashplayer_plugin or plugin-container. It's mean the script has created for browser game.

Then this one (work for CE 6.6), will check all process running in memory when you click open attach button, if you want attach flashplayer_plugin, choose the first one in process list. If you want attach FB Game room, choose the third or fourth FBG process. Also this one can save as standalone trainer with no issues.


Thanks for answering, what i need its that detect the process in which the unity or flash game runs on firefox or chrome and that the trainer it can save as .exe

ty, im a beginner at lua code
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites