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 


(help) I need the button disable

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
gallomk
Newbie cheater
Reputation: 0

Joined: 13 Feb 2016
Posts: 15

PostPosted: Wed Feb 17, 2016 11:47 am    Post subject: (help) I need the button disable Reply with quote

I need the button "Habilitar" can disable the hack once active

Code:
blue="0x00F21200"
red1="0x000000FF"
red2="0x00000099"
white="0x00FFFFFF"

function setHack_Information()
  t =
  {
{'Hack 1',
[[LuaCall(Aobswap("24 01 62 08 11 05 00 00","24 16 62 08 11 05 00 00"))]],
[[Enter AOB for this hack - Eq. Long Line]]},

{'Hack 2',
[[LuaCall(Aobswap("80 3b 47 47","80 3b d1 48"))]],
[[Enter AOB for this hack - Eq. All Rooms]]}
}
end

----------------------------------------- COMBOBOX CONTENT -----------------------------------------
setHack_Information()
al = combobox_getItems(MainGUI_1.MainGUI_10)
strings_clear(al)
strings_add(al, 'Browser list...')
strings_add(al, 'Firefox')
strings_add(al, 'Google Chrome')
strings_add(al, 'Internex Explorer')
setProperty(MainGUI_1.MainGUI_10 , "ItemIndex", "0")
all_enabled = 0
success = 1
TeL = listbox_getItems(MainGUI_1.MainGUI_15)
TempSave = {}
strings_clear(TeL)
check = 0
i = 0
repeat
if t[i+1]==nil then
   check = 1
else
   i = i+1
   strings_add(TeL, t[i][1])
   TempSave[i] = {}
   TempSave[i][1] = t[i][1]
   TempSave[i][2] = t[i][2]
   TempSave[i][3] = t[i][3]
   TempSave[i][4] = 2
   TempSave[i][5] = 0
   check = 0
end
until check == 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)

----------------------------------------- CHECKPROCESS / PIDS -----------------------------------------

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

----------------------------------------- BROWSER SELECT -----------------------------------------

function scanBrowser()
   AttachItems = combobox_getItems(MainGUI_1.MainGUI_10)
   AttachIndex = combobox_getItemIndex(MainGUI_1.MainGUI_10)
   control_setEnabled(MainGUI_1.MainGUI_16, false)
   control_setEnabled(MainGUI_1.MainGUI_17, false)
    control_setEnabled(MainGUI_1.MainGUI_23, false)
   local font = getProperty(MainGUI_1.MainGUI_9 , "Font")
   setProperty(font, "Color", white)
   control_setCaption(MainGUI_1.MainGUI_9, "Attached to PID: " .. "Scanning Process...")
   processMessages()
   if AttachIndex == -1 then return end
   if AttachIndex == 0 then
      control_setCaption(MainGUI_1.MainGUI_9, "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
         setProperty(font , "Color", red1)
         control_setCaption(MainGUI_1.MainGUI_9, "Attached to PID: " .. "Chrome not found.")
         timer_setEnabled(openNextProcTimer,false)
         return
      end
      strings_add(getAutoAttachList(),"chrome.exe")
      timer_setEnabled(openNextProcTimer,true)
      return
   end
   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(MainGUI_1.MainGUI_9, "Attached to PID: " .. "Flash player plugin not found")
   else
      local PID=getOpenedProcessID()
      setProperty(font, "Color", white)
      control_setCaption(MainGUI_1.MainGUI_9, "Attached to PID: " .. PID .. " - flash player plugin")
      control_setEnabled(MainGUI_1.MainGUI_16, true)
      control_setEnabled(MainGUI_1.MainGUI_17, true)
        control_setEnabled(MainGUI_1.MainGUI_23, true)
   end
end

----------------------------------------- ENABLE HACKS -----------------------------------------
function enableHacks()
   setProperty(getProperty(MainGUI_1.MainGUI_9 , "Font"), "Color", white)
   local PID=getOpenedProcessID()
   local check = strings_getString(AttachItems,AttachIndex)
   if check == 'Firefox' or check == 'Internet Explorer' then
      control_setCaption(MainGUI_1.MainGUI_9, "Attached to PID: " .. PID .. " - flash player plugin")
   elseif check == 'Google Chrome' then
      control_setCaption(MainGUI_1.MainGUI_9, "Attached to PID: " .. PID .. " - chrome.exe")
   end
   success = 1
    control_setEnabled(MainGUI_1.MainGUI_16, true)
   control_setEnabled(MainGUI_1.MainGUI_17, true)
    control_setEnabled(MainGUI_1.MainGUI_23, true)
end

----------------------------------------- PROGRESS BAR -----------------------------------------
function show_progressbar()
     control_setPosition(MainGUI_1.MainGUI_22, 10, 205)
     control_setCaption(MainGUI_1.MainGUI_22, '')
     control_setVisible(MainGUI_1.MainGUI_18, false)
     control_setVisible(MainGUI_1.MainGUI_19, false)
     control_setVisible(MainGUI_1.MainGUI_20, true)
     control_setVisible(MainGUI_1.MainGUI_21, true)
     control_setVisible(MainGUI_1.MainGUI_22, true)
     progressbar_setPosition(MainGUI_1.MainGUI_20, 0)
end

function hide_progressbar()
    control_setVisible(MainGUI_1.MainGUI_20, false)
    control_setVisible(MainGUI_1.MainGUI_21, false)
    control_setVisible(MainGUI_1.MainGUI_22, false)
    control_setVisible(MainGUI_1.MainGUI_18, true)
    control_setVisible(MainGUI_1.MainGUI_19, true)
end

----------------------------------------- EXECUTE HACKS -----------------------------------------
function ExecuteHacks()
    HLS = listbox_getItemIndex(MainGUI_1.MainGUI_15)
    LIST = listbox_getItems(MainGUI_1.MainGUI_15)
    if HLS == -1 then return end
    i = HLS+1
    font=getProperty(MainGUI_1.MainGUI_21, 'Font')
    control_setVisible(MainGUI_1.MainGUI_18, false)
    control_setVisible(MainGUI_1.MainGUI_19, false)
    control_setVisible(MainGUI_1.MainGUI_20, false)
    control_setVisible(MainGUI_1.MainGUI_21, true)
    control_setVisible(MainGUI_1.MainGUI_22, false)
    if t[i][2]==nil then
         setProperty(font, 'Color', white)
         control_setCaption(MainGUI_1.MainGUI_21, "You allready enabled this hack !")
         return
    end
    control_setEnabled(MainGUI_1.MainGUI_16, false)
    control_setEnabled(MainGUI_1.MainGUI_17, false)
    control_setEnabled(MainGUI_1.MainGUI_23, false)
    control_setCaption(MainGUI_1.MainGUI_21, "Executing hack...")
    control_setVisible(MainGUI_1.MainGUI_22, true)
    control_setCaption(MainGUI_1.MainGUI_22, '')
    control_setPosition(MainGUI_1.MainGUI_22, 10, 185)
    strings_setString(LIST, HLS, t[i][1])
    processMessages()
    if TempSave[i][4] == 2 then
      Asm = autoAssemble(t[i][2])
      font=getProperty(MainGUI_1.MainGUI_22, 'Font')
      control_setCaption(MainGUI_1.MainGUI_21, "Executing hack. Finished.")
      if AobSwapCheck~=true then
        TempText = t[i][1]..' - Failed'
        TempSave[i][5] = t[i][1]..' - Failed'
        strings_setString(LIST, HLS, TempText)
        setProperty(font, 'Color', red1)
        control_setCaption(MainGUI_1.MainGUI_22, 'Failed to enable !\nHack allready enabled or game was updated.')
      else
        TempText = t[i][1]..' - Enabled'
        TempSave[i][5] = t[i][1]..' - Enabled'
        strings_setString(LIST, HLS, TempText)
        setProperty(font, 'Color', white)
        control_setCaption(MainGUI_1.MainGUI_22, 'Hack enabled. Enjoy it !')
        t[i][2] = nil
        TempSave[i][4] = 1
      end
    end
    if TempSave[i][4] == 0 then TempSave[i][4] = 2 end
    control_setEnabled(MainGUI_1.MainGUI_16, true)
    control_setEnabled(MainGUI_1.MainGUI_17, true)
    control_setEnabled(MainGUI_1.MainGUI_23, true)
end

----------------------------------------- EXECUTE ALL HACKS  -----------------------------------------
function ExecuteAllHacks()
     font=getProperty(MainGUI_1.MainGUI_21, 'Font')
     if all_enabled == 1 then
        control_setVisible(MainGUI_1.MainGUI_18, false)
        control_setVisible(MainGUI_1.MainGUI_19, false)
        control_setVisible(MainGUI_1.MainGUI_20, false)
        control_setVisible(MainGUI_1.MainGUI_21, true)
        control_setVisible(MainGUI_1.MainGUI_22, false)
        setProperty(font, 'Color', white)
        control_setCaption(MainGUI[21], "You allready enabled all hacks !")
        return
     end
     lb = listbox_getItems(MainGUI_1.MainGUI_15)
     LIST = listbox_getItems(MainGUI_1.MainGUI_15)
     control_setEnabled(MainGUI_1.MainGUI_16, false)
     control_setEnabled(MainGUI_1.MainGUI_17, false)
     control_setEnabled(MainGUI_1.MainGUI_23, false)
     show_progressbar()
     progressbar_setMax(MainGUI_1.MainGUI_20, strings_getCount(lb))
     for i = 1, strings_getCount(lb) do
         strings_setString(LIST, i-1, t[i][1])
     end
    count = 0
     for i = 1, strings_getCount(lb) do
          control_setCaption(MainGUI_1.MainGUI_21, "Executing hack: "..t[i][1])
          progressbar_setPosition(MainGUI_1.MainGUI_20, i)
          processMessages()
        if TempSave[i][4] == 2 then
              Asm = autoAssemble(t[i][2])
            if AobSwapCheck~=true then
                    TempSave[i][5] = t[i][1]..' - Failed'
                    strings_setString(LIST, i-1, TempSave[i][5])
             else
                   TempSave[i][5] = t[i][1]..' - Enabled'
                    strings_setString(LIST, i-1, TempSave[i][5])
                   t[i][2] = nil
               TempSave[i][4] = 1
               count = count + 1
             end
         else
              count = count + 1
                 TempSave[i][5] = t[i][1]..' - Enabled'
                 strings_setString(LIST, i-1, TempSave[i][5])
         end
      if TempSave[i][4] == 0 then TempSave[i][4] = 2 end
   end
    control_setEnabled(MainGUI_1.MainGUI_16, true)
    control_setEnabled(MainGUI_1.MainGUI_17, true)
    control_setEnabled(MainGUI_1.MainGUI_23, true)
    control_setCaption(MainGUI_1.MainGUI_21, "Executing hack. Finished ! ")
    font=getProperty(MainGUI_1.MainGUI_22, 'Font')
   if count == strings_getCount(lb) then
      setProperty(font, 'Color', white)
        control_setCaption(MainGUI_1.MainGUI_22, 'All hacks enabled. Enjoy it !')
        all_enabled = 1
   else
      diff = strings_getCount(lb) - count
        if diff == 1 then
           text = "hack"
        else
           text = "hacks"
        end
        setProperty(font, 'Color', red1)
       control_setCaption(MainGUI_1.MainGUI_22, 'Failed to enable ' .. diff .. ' ' .. text .. ' !')
   end
end

----------------------------------------- RESET HACKS  -----------------------------------------
function ResetAllHacks()
     lb = listbox_getItems(MainGUI_1.MainGUI_15)
     ct = strings_getCount(lb)
     for i = 1, ct do
         strings_setString(lb, i-1, t[i][1])
         TempSave[i][4] = 2
         t[i][2]= TempSave[i][2]
     end
     all_enabled = 0
     hide_progressbar()
     control_setVisible(MainGUI_1.MainGUI_19, false)
     control_setCaption(MainGUI_1.MainGUI_18, 'All hacks reseted.')
end

----------------------------------------- AOB SWAP -----------------------------------------
function DEC_HEX(IN)
   local B,K,OUT,I,D=16,"0123456789ABCDEF","",0
    if IN<1 then
      OUT=0
      return OUT
   end
   while IN>0 do
      I=I+1
      IN,D=math.floor(IN/B),math.mod(IN,B)+1
      OUT=string.sub(K,D,D)..OUT
   end
   return OUT
end

function Aobswap(search, change)
     aobs = AOBScan(search, "+W")
     if(aobs == nil) then
      AobSwapCheck=false
    else
       j = stringlist_getCount(aobs)
      for i = 1, j do
          address=stringlist_getString(aobs,i-1)
          for i = 1, string.len(change), 3 do
             z = string.sub(change, i, i+2)
             x, y = string.find(z, "%?+")
              if (x == nil) then
                script=[[
                ]]..address.."+"..(DEC_HEX((i-1)/3))..[[:
                db ]]..z..[[
                ]]
                autoAssemble(script)
             end
          end
       end
      object_destroy(aobs);
      aobs=nil
      AobSwapCheck=true
   end
end

----------------------------------------- HACK DESCRIPTION -----------------------------------------
function HackDescriptionsChange()
    hide_progressbar()
    control_setCaption(MainGUI_1.MainGUI_18, 'Description:')
    HLS = listbox_getItemIndex(MainGUI_1.MainGUI_15)
    if HLS == -1 then return end
    i = HLS+1
    if t[i][3]~='' and t[i][3]~=nil then
      control_setCaption(MainGUI_1.MainGUI_19 ,t[i][3])
    else
      control_setCaption(MainGUI_1.MainGUI_19, "no description available.")
    end
end

---------------------------------------- KONGHACK / EXIT -----------------------------------------
function OpenKonghack()
   shellExecute("/")
end

function CloseTrainer()
   form_hide(MainGUI_1)
   closeCE()
end

----------------------------------------- ONCLICK EVENTS  -----------------------------------------
control_onClick(MainGUI_1.MainGUI_12, scanBrowser)
control_onClick(MainGUI_1.MainGUI_13, OpenKonghack)
control_onClick(MainGUI_1.MainGUI_16, ExecuteHacks)
control_onClick(MainGUI_1.MainGUI_17, ExecuteAllHacks)
control_onClick(MainGUI_1.MainGUI_23, ResetAllHacks)
setMethodProperty(MainGUI_1.MainGUI_15, 'OnSelectionChange', HackDescriptionsChange)
form_onClose(MainGUI_1, CloseTrainer)
form_show(MainGUI_1)



ccc.jpg
 Description:
 Filesize:  218.25 KB
 Viewed:  5953 Time(s)

ccc.jpg


Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 62

Joined: 01 Oct 2008
Posts: 959

PostPosted: Wed Feb 17, 2016 12:40 pm    Post subject: Reply with quote

It may be useless for a disable option for byte-code cheat, flash/unity byte-code cheat effect cannot be revert once after the cheat has been taken effect. Reverting the bytecode aob before the cheat taken effect mean never applied the cheat.
It is in contrast that native code (x86) cheat can be turned on/off in real time.
That's because normally once bytecode is compiled to native code, any modification to the bytecode is irrelevant to the compiled native code.

Anyway, the trainer template does not handle paired enable/disable, but you may add extra cheat by explicitly reverting the aob bytes, given there is no wildcard (since then it cannot be revert by the AOBSwap function).
eg. just simply swap the 1st and 2nd aob string

Code:

{'Hack 1',
[[LuaCall(Aobswap("24 01 62 08 11 05 00 00","24 16 62 08 11 05 00 00"))]],
[[Enter AOB for this hack - Eq. Long Line]]},
{'Revert Hack 1',
[[LuaCall(Aobswap("24 16 62 08 11 05 00 00","24 01 62 08 11 05 00 00"))]],
[[Enter AOB for this hack - Eq. Long Line]]},

... but there may be risk to convert aob not suppose to be converted.

bye~

_________________
- Retarded.
Back to top
View user's profile Send private message
gallomk
Newbie cheater
Reputation: 0

Joined: 13 Feb 2016
Posts: 15

PostPosted: Wed Feb 17, 2016 12:53 pm    Post subject: Reply with quote

panraven wrote:
It may be useless for a disable option for byte-code cheat, flash/unity byte-code cheat effect cannot be revert once after the cheat has been taken effect. Reverting the bytecode aob before the cheat taken effect mean never applied the cheat.
It is in contrast that native code (x86) cheat can be turned on/off in real time.
That's because normally once bytecode is compiled to native code, any modification to the bytecode is irrelevant to the compiled native code.

Anyway, the trainer template does not handle paired enable/disable, but you may add extra cheat by explicitly reverting the aob bytes, given there is no wildcard (since then it cannot be revert by the AOBSwap function).
eg. just simply swap the 1st and 2nd aob string

Code:

{'Hack 1',
[[LuaCall(Aobswap("24 01 62 08 11 05 00 00","24 16 62 08 11 05 00 00"))]],
[[Enter AOB for this hack - Eq. Long Line]]},
{'Revert Hack 1',
[[LuaCall(Aobswap("24 16 62 08 11 05 00 00","24 01 62 08 11 05 00 00"))]],
[[Enter AOB for this hack - Eq. Long Line]]},

... but there may be risk to convert aob not suppose to be converted.

bye~



here I leave another trainer I did, but this one goes.
when activated, it gives me the ability to disable it.


Code:
function CreateTrainer()

  function setHack_Information()
  --########### Trainer Appearance edit ############--
  --Trainer Name
  control_setCaption(ht[1], 'Hack MAA')
  --Game hacks title
  control_setCaption(ht[1.2] ,'Marvel Avengers Alliance Febrero 2016')
  --Creator credits
  control_setCaption(ht[1.1] ,'¯\(°_o)/¯Winuntu Team¯\(°_o)/¯ el Hack se Actualiza cada 15 o 30 dias')
  --Hack enteries
  t =
  {

--Entry 7:
{'Dejar',[[//code from here to '[DISABLE]' will be used to enable the cheat

 
 
aobscan(hitkill,89 77 18 12 B0 B0 01 00 00) // should be unique
alloc(newmem,$1000)

label(code)
label(return)

newmem:

code:
  //mov [ebx+18],esi
  mov [ebx+18],#1
  mov esi,[eax+000001B0]
  jmp return

hitkill:
  jmp code
  nop
  nop
  nop
  nop
return:
registersymbol(hitkill)]],[[habilitalo hasta que todos queden con 1 de vida,
despues deshabilitalo para matar al enemigo.]],[[(¯`•¸•´¯)( Hack Habilitado )(¯`•¸•´¯)]], 'yes',[[hitkill:
  db 89 77 18 12 B0 B0 01 00 00]],[[hack desactivado]]},


}
end
ht = {}
ht[1] = createForm()
ht[2] = createPanel(ht[1])
ht[1.1] = createLabel(ht[2])
ht[1.2] = createLabel(ht[2])
ht[1.3] = createLabel(ht[2])
ht[3] = createGroupBox(ht[2])
ht[3.1] = createLabel(ht[3])
ht[3.2] = createLabel(ht[3])
ht[3.3] = createLabel(ht[3])
ht[3.4] = createLabel(ht[3])
ht[4] = createListBox(ht[3])
ht[5] = createButton(ht[3])
setProperty(ht[1] , 'Position', 'poScreenCenter')
setProperty(ht[1] , 'BorderIcons', '[biSystemMenu]')
setProperty(ht[1] , 'BiDiMode', 'bdLeftToRight')
setProperty(ht[2] , 'BiDiMode', 'bdLeftToRight')
local FontHeight = getProperty(ht[1.2] , 'Font')
setProperty(FontHeight , 'Color', 0x000000FE)
setProperty(FontHeight , 'Style', '[fsBold]')
setProperty(FontHeight , 'Height', '20')
local FontHeight = getProperty(ht[3.1] , 'Font')
setProperty(FontHeight , 'Color', 0x00007F00)
setProperty(FontHeight , 'Style', '[fsBold]')
setProperty(FontHeight , 'Height', '16')
local FontHeight = getProperty(ht[3.3] , 'Font')
setProperty(FontHeight , 'Color', 0x00F21200)
local FontHeight = getProperty(ht[1.3] , 'Font')
setProperty(FontHeight , 'Color', 0x00FF0482)
setProperty(FontHeight , 'Style', '[fsBold]')
control_setSize(ht[1], 400, 300)
x,y = control_getSize(ht[1])
control_setSize(ht[2], x,y)
control_setPosition(ht[1.1], 5, y-17)
control_setPosition(ht[1.3], 313, y-17)
control_setPosition(ht[1.2], 10, 2.5)
control_setSize(ht[3], x*0.965, y*0.85)
control_setPosition(ht[3], 5,y*1.095-y)
control_setCaption(ht[3], 'Hacks')
control_setPosition(ht[3.1], 5, 0)
control_setCaption(ht[3.1],'Seleccione un Hack de la lista, a continuación, presione Habilitar!')
X,Y = control_getSize(ht[3])
control_setSize(ht[4], X*0.75-6, 64)
X,Y = control_getSize(ht[4])
control_setPosition(ht[4],5, 20)
control_setSize(ht[5], X*0.34-6, 64)
control_setPosition(ht[5],X+6, 20)
control_setCaption(ht[5], 'Habilitar')
control_setPosition(ht[3.3] ,5, Y+20)
control_setCaption(ht[3.3] , 'Descripción del Hack seleccionado:')
control_setPosition(ht[3.4] ,5, Y+35)
control_setCaption(ht[3.4] , 'Hack no seleccionado...')
setHack_Information()
local TeL = listbox_getItems(ht[4])
TempSave = {}
strings_clear(TeL)
check = 0
i = 0
repeat
  if t[i+1]==nil then
    check = 1
  else
    i = i+1
    strings_add(TeL, t[i][1])
    if t[i][8]==nil then t[i][8]=2 end
    if t[i][5]=='no' then t[i][5]=nil end
    TempSave[i] = {}
    TempSave[i][1] = t[i][1]
    TempSave[i][2] = t[i][2]
    TempSave[i][3] = t[i][3]
    TempSave[i][4] = t[i][4]
    TempSave[i][5] = t[i][5]
    TempSave[i][6] = t[i][6]
    TempSave[i][7] = t[i][7]
    TempSave[i][8] = t[i][8]
    check = 0
  end
until check == 1
----------------------------------------- EXECUTE HACKS -----------------------------------------
function ExecuteHacksScripts()
  HLS = listbox_getItemIndex(ht[4])
  if HLS == -1 then return end
  i = HLS+1
  if t[i][5]=='no' or t[i][5]==nil and t[i][2]==nil then return showMessage(t[i][4]) end
  if t[i][5]=='yes' and TempSave[i][8]==1 then
    Asm=false
    if type(t[i][6])=='string' then
      Asm = autoAssemble(t[i][6])
    elseif type(t[i][6])=='function' then
      t[i][6]() --Executes it as an function
      Asm=true
    end
    if Asm~=true then
      return showMessage('Algo no salio bien, Hack no Habilitado! ?? ')
    end
    if AobSwapCheck~=true and AobSwapCheck~=nil then
      AobSwapCheck=nil
      return showMessage('Algo no salio bien, Hack no Habilitado! ?? ')
    end
    AobSwapCheck=nil
    t[i][1] = TempSave[i][1]
    t[i][2] = TempSave[i][2]
    t[i][3] = TempSave[i][3]
    t[i][4] = TempSave[i][4]
    t[i][5] = TempSave[i][5]
    t[i][6] = TempSave[i][6]
    t[i][7] = TempSave[i][7]
    t[i][8] = TempSave[i][8]
    local TempText
    TempText = t[i][1]
    strings_setString( TeL, HLS, TempText )
    OriginalCap=nil
    control_setCaption(ht[5], 'Enable')
    if t[i][7]=='' then
      showMessage('Done disabling hack')
    else
      showMessage(t[i][7])
    end
    TempSave[i][8] = 0
  end
  if TempSave[i][8] == 2 then
    if type(t[i][2])=='string' then
      Asm = autoAssemble(t[i][2])
    elseif type(t[i][2])=='function' then
      t[i][2]() --Executes it as an function
      Asm=true
    elseif type(t[i][2])=='nil' then
      Asm=true
    end
    if Asm~=true then
      return showMessage('Algo no salio bien, Hack no Habilitado! ?? ')
    end
    if AobSwapCheck~=true and AobSwapCheck~=nil then
      AobSwapCheck=nil
      return showMessage('Algo no salio bien, Hack no Habilitado! ?? ')
    end
    AobSwapCheck=nil
    local TempText
    TempText = t[i][1]..' - Listo!'
    strings_setString( TeL, HLS, TempText )
    if t[i][5]=='yes' then control_setCaption(ht[5], 'Disable') end
    if t[i][4]=='' then
      showMessage('Done enabling hack')
    else
      showMessage(t[i][4])
    end
    t[i][2] = nil
    t[i][4] = 'Este Hack ya esta habilitado!'
    TempSave[i][8] = 1
  end
  if TempSave[i][8] == 0 then TempSave[i][8] = 2 end
end
function HackDescriptionsChange()
  HLS = listbox_getItemIndex(ht[4])
  if HLS == -1 then return end
  i = HLS+1
  if t[i][3]~='' and t[i][3]~=nil then
    control_setCaption(ht[3.4],t[i][3])
  else
    control_setCaption(ht[3.4],'Theres no descriptions available about this hack')
  end
  if t[i][5]=='yes' and TempSave[i][8]==1 then control_setCaption(ht[5], 'Deshabilitar') end
  if t[i][5]=='yes' and TempSave[i][8]==2 then control_setCaption(ht[5], 'Habilitar') end
  if t[i][5]==nil then control_setCaption(ht[5], 'Habilitar') end
end
function CloseProgram()
  closeCE()
end
form_onClose(ht[1],CloseProgram)
control_onClick(ht[5],ExecuteHacksScripts)
setMethodProperty(ht[4], 'OnSelectionChange', HackDescriptionsChange)
end
----------------------------------------- AOB SWAP -----------------------------------------
function DEC_HEX(IN)
local B,K,OUT,I,D=16,"0123456789ABCDEF","",0
   if IN<1 then
  OUT=0
  return OUT
   end
while IN>0 do
I=I+1
IN,D=math.floor(IN/B),math.mod(IN,B)+1
OUT=string.sub(K,D,D)..OUT
end
return OUT
end
function Aobswap(search, change)
   aobs = AOBScan(search)
   if(aobs ~= nil) then
   j = stringlist_getCount(aobs)
   for i = 1, j do
   address=stringlist_getString(aobs,i-1)
   for i = 1, string.len(change), 3 do
   z = string.sub(change, i, i+2)
   x, y = string.find(z, "%?+")
   if (x == nil) then
   script=[[
   ]]..address.."+"..(DEC_HEX((i-1)/3))..[[:
   db ]]..z..[[
   ]]
   autoAssemble(script)
   end
   end
   end
   object_destroy(aobs);
   aobs=nil
end
end
function AobswapC(search, change)
   aobs = AOBScan(search)
   if(aobs == nil) then AobSwapCheck=false else
   j = stringlist_getCount(aobs)
   for i = 1, j do
   address=stringlist_getString(aobs,i-1)
   for i = 1, string.len(change), 3 do
   z = string.sub(change, i, i+2)
   x, y = string.find(z, "%?+")
   if (x == nil) then
   script=[[
   ]]..address.."+"..(DEC_HEX((i-1)/3))..[[:
   db ]]..z..[[
   ]]
   autoAssemble(script)
   end
   end
   end
   object_destroy(aobs);
   aobs=nil
   AobSwapCheck=true
  end
end
InformationText="Antes de continuar!\nAdjunte a su navegador, Use de la lista y adjunta\n\nTenga en cuenta que debe adjuntar al proceso correcto de su navegador.\nSino el hack (s) no funcionará\n\nAl éxito de que adjuntar bien, el botón Continuar estará disponible"
AttachFirst     = {}
AttachFirst[1]  = createForm(false)
AttachFirst[2]  = createPanel(AttachFirst[1])
AttachFirst[3]  = createButton(AttachFirst[2])
AttachFirst[4]  = createLabel(AttachFirst[2])
AttachFirst[5]  = createGroupBox(AttachFirst[2])
AttachFirst[6]  = createLabel(AttachFirst[5])
AttachFirst[7]  = createLabel(AttachFirst[5])
AttachFirst[9]  = createLabel(AttachFirst[5])
AttachFirst[10] = createComboBox(AttachFirst[5])
AttachFirst[12] = createButton(AttachFirst[5])
AttachFirst[13] = createLabel(AttachFirst[2])
setProperty(AttachFirst[1] , "Position", "poScreenCenter")
setProperty(AttachFirst[1] , "BorderIcons", "[biSystemMenu]")
setProperty(AttachFirst[1] , "BiDiMode", "bdLeftToRight")
setProperty(AttachFirst[2] , "BiDiMode", "bdLeftToRight")
setProperty(AttachFirst[2] , "BiDiMode", "bdLeftToRight")
setProperty(AttachFirst[10] , "ReadOnly", "True")
local FontHeight = getProperty(AttachFirst[4] , "Font")
setProperty(FontHeight , "Style", "[fsBold]")
setProperty(FontHeight , "Height", "17")
local FontHeight = getProperty(AttachFirst[5] , "Font")
setProperty(FontHeight , "Style", "[fsBold]")
--
local FontHeight = getProperty(AttachFirst[6] , "Font")
setProperty(FontHeight , "Style", "[]")
setProperty(FontHeight , "Height", "14")
local FontHeight = getProperty(AttachFirst[7] , "Font")
setProperty(FontHeight , "Style", "[]")
setProperty(FontHeight , "Height", "13")
local FontHeight = getProperty(AttachFirst[9] , "Font")
setProperty(FontHeight , "Style", "[fsBold]")
setProperty(FontHeight , "Height", "14")
local FontHeight = getProperty(AttachFirst[7] , "Font")
setProperty(FontHeight , "Color", 0x000000FE)
setProperty(FontHeight , "Color", 0x000000FE)
local FontHeight = getProperty(AttachFirst[9] , "Font")
setProperty(FontHeight , "Color", 0x00007F00)
--
local FontHeight = getProperty(AttachFirst[10] , "Font")
setProperty(FontHeight , "Style", "[]")
setProperty(FontHeight , "Height", "13")
local FontHeight = getProperty(AttachFirst[12] , "Font")
setProperty(FontHeight , "Style", "[]")
setProperty(FontHeight , "Height", "13")
setProperty(AttachFirst[13], "Cursor", "-21")
local FontHeight = getProperty(AttachFirst[13] , "Font")
setProperty(FontHeight , "Style", "[fsBold]")
setProperty(FontHeight , "Height", "20")
setProperty(FontHeight , "Color", 0x00800180)
--
control_setEnabled(AttachFirst[3], false)
control_setSize(AttachFirst[1], 385, 250)
x,y = control_getSize(AttachFirst[1])
control_setSize(AttachFirst[2], x,y)
control_setSize(AttachFirst[3], 75,25)
control_setSize(AttachFirst[5], 375,190)
control_setSize(AttachFirst[10], 205,21)
control_setSize(AttachFirst[12], 79,45)
control_setPosition(AttachFirst[3], 303,219)
control_setPosition(AttachFirst[4], 5,5)
control_setPosition(AttachFirst[5], 5,25)
control_setPosition(AttachFirst[6], 5,0)
control_setPosition(AttachFirst[7], 5,110)
control_setPosition(AttachFirst[9], 5,150)
control_setPosition(AttachFirst[10], 75,108)
control_setPosition(AttachFirst[12], 287,97)
control_setPosition(AttachFirst[13], 5,219)
control_setCaption(AttachFirst[1],"Formulario de Colocación!")
control_setCaption(AttachFirst[3],"Continuar")
control_setCaption(AttachFirst[4],"Un momento...")
control_setCaption(AttachFirst[5],"Colocación")
control_setCaption(AttachFirst[6],InformationText)
control_setCaption(AttachFirst[7],"Proceso?")
control_setCaption(AttachFirst[9],"Actualmente unido a PID: ")
control_setCaption(AttachFirst[12],"Adjuntar")
control_setCaption(AttachFirst[13],"._-¦ Winuntu Team ¦ -_.")
al = combobox_getItems(AttachFirst[10])
strings_clear(al)
function OpenFlashacking()
shellExecute("fref=ts")
end
----------------------------------------- COMBOBOX CONTENT -----------------------------------------
strings_add(al, 'Desplegar....')
strings_add(al, 'chrome.exe')
strings_add(al, 'FlashPlayerPlugin.exe')
strings_add(al, 'Firefox.exe')
setProperty(AttachFirst[10] , "ItemIndex", "0")
success = 1
process = "chrome.exe" -- you can set this variable by using combobox,
                       -- editbox or soemthing
function ResetChrome()
success = 0
local test = openProcess("chrome.exe") if test ==nil then return showMessage("Chrome was not found!!"),timer_setEnabled(openNextProcTimer,false) end
  strings_add(getAutoAttachList(),process)
  timer_setEnabled(openNextProcTimer,true)
end
------------------------------------BROWSER SELECT-----------------------------------------
function enableCheatsGuiWhatEver()
  -- initialize UI (or reinitialize UI)
  -- or whatever you want to do afer finding right process:
  -- enabling controls, cheats
local PID=getOpenedProcessID()
control_setCaption(AttachFirst[1],"Attaching Form!")
control_setEnabled(AttachFirst[3], true)
control_setCaption(AttachFirst[9], "Currently attached to PID: " .. PID)
success = 1
showMessage("Todo salio con éxito... Continuar?")
end
-- this function returns true if good process, false if bad
function checkProcessMajor()
  reinitializeSymbolhandler()
  -- for Chrome flash
  if getAddress("pepflashplayer.dll")~=0 or
     getAddress("AdobeCPGetAPI")     ~=0 then
       return true
  end
  -- you can change above condition to something else.
  -- for example you can make aobscan check -  if pattern found -> return true
  return false -- return false by default
end
-- #############################################################################
-- do not thouch code below (unless you know what you are doing)
errorOnLookupFailure(false)
alreadycheckedPIDS={} -- checked processes pids
openNextProcTimer = createTimer(nil,false)
timer_setInterval(openNextProcTimer, 1000)
timer_onTimer(openNextProcTimer,
function (sender)
  local tempPIDtable = getPids()
  if #tempPIDtable == 0 then return end
  --OK, we have new PID
  timer_setEnabled(sender,false)
  openProcess(tempPIDtable[1])
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 == process 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)
  -- add currently opened process to ignore list
  -- (openNextProc will ignore those)
  alreadycheckedPIDS[getOpenedProcessID()]=true
  if checkProcessMajor() then
    -- OUR TARGET FOUND
    timer_setEnabled(openNextProcTimer,false)
    alreadycheckedPIDS={}
    enableCheatsGuiWhatEver()
  else
    timer_setEnabled(openNextProcTimer,true)
  end
end
function onOpenProcess()
if success == 1 then return end
  timer_setEnabled(checkProcessTimer,true)
end
checkProcessTimer = createTimer(nil,false)
timer_setInterval(checkProcessTimer, 100)
timer_onTimer(checkProcessTimer, checkProcess)
function AttachToChrome()
control_setCaption(AttachFirst[1],"Colocación...! - Por favor, espere buscando el proceso...")
ResetChrome()
end
function AttachList()
  AttachItems = combobox_getItems(AttachFirst[10])
  AttachIndex = combobox_getItemIndex(AttachFirst[10])
  if AttachIndex == -1 then return end
  if AttachIndex == 0 then return showMessage("Please pick a process from the list") end
  if strings_getString(AttachItems,AttachIndex)=='chrome.exe' then return AttachToChrome() end
   openProcess(strings_getString(AttachItems,AttachIndex))
   errorOnLookupFailure(false)
   reinitializeSymbolhandler()
   err=getAddress("kernel32.dll")==0
      if err==true then
         showMessage("Couldn't find the process")
      else
         local PID=getOpenedProcessID()
         control_setCaption(AttachFirst[9], "Currently attached to PID: " .. PID)
         control_setEnabled(AttachFirst[3], true)
         showMessage("Attached successfully!")
      end
end
function AttachClose()
closeCE()
end
function ExecuteHack()
CreateTrainer()
form_hide(AttachFirst[1])
end
control_onClick(AttachFirst[3], ExecuteHack)
control_onClick(AttachFirst[12],AttachList)
form_onClose(AttachFirst[1],AttachClose)
control_onClick(AttachFirst[13],OpenFlashacking)
form_show(AttachFirst[1])
Back to top
View user's profile Send private message
diamond818
Newbie cheater
Reputation: 0

Joined: 04 Jan 2016
Posts: 10

PostPosted: Thu Feb 18, 2016 7:13 am    Post subject: Reply with quote

How to insert an image in the backgroud of the trainer as gallomk has done..Anyone please tell...thanks..
Back to top
View user's profile Send private message
lolAnonymous
Expert Cheater
Reputation: 1

Joined: 19 Jul 2015
Posts: 154

PostPosted: Thu Feb 18, 2016 3:03 pm    Post subject: Reply with quote

Add this in property :-
Code:
attachBackground(MAXGUI[1] ,[[pic name.jpg]])
setProperty(MAXGUI[1] , "color", black)


and this in the top of your script :-

Code:
function attachBackground(wc,tblFile)
local p = createPicture()
p.loadFromStream(findTableFile(tblFile).Stream)
wc.OnPaint = function(sender)
local c = sender.getCanvas()
local bitmap = p.getBitmap()
c.draw(0,0,bitmap)
end
end


Don't forget to remove the panel...
Back to top
View user's profile Send private message
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