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 


Safe upload tool for ".EXE" Trainer. (Windows - 32

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> LUA Tutorials
View previous topic :: View next topic  
Author Message
AylinCE
Grandmaster Cheater Supreme
Reputation: 31

Joined: 16 Feb 2017
Posts: 1234

PostPosted: Sat Mar 13, 2021 11:18 am    Post subject: Safe upload tool for ".EXE" Trainer. (Windows - 32 Reply with quote

I think for this coding example, I should write a "Manifesto of Responsibility".

Responsibility Manifesto;

I take the legal and conscientious responsibility that may arise from the misuse of the code below and I declare that the Cheat Engine Program is not supportive of the abuse of this code.


The coding presented below is completely instructive and; I remind you that the affiliates using this code will have accepted the "Manifesto of Liability" above.

Otherwise; Cheat Engine is not responsible for what purpose you use this program.

--############################################--

We made many tools with Cheat Engine and Lua coding ..
* Trainers to fix game bugs. (!) Wink
*Mp3 player
* 61-key piano
* Playable games
* Useful program helpers for Windows
etc.

We also presented these tools as ".CETRAINER", which is CE's own infrastructure, and also as ".EXE" program.
However, our ".EXE" applications were blocked by constant Windows security.
We will now fix this issue with a bootstrap tool.

For the coding resource that is the subject of the "Manifesto of Liability", take a look at the Windows release;

Reference;
https://docs.microsoft.com/en-us/troubleshoot/windows-server/networking/netsh-advfirewall-firewall-control-firewall-behavior

Turn On or Off Real-time Protection for Microsoft Defender Antivirus;

https://www.tenforums.com/tutorials/3569-turn-off-real-time-protection-microsoft-defender-antivirus.html

----------------------------------------------------------------------------------------
Now let's synchronize this code with Lua;

Example Trainer filename; Get "SampleGameTrainer64bits.EXE or (32bits)"

Code:
local text4=[[netsh advfirewall firewall add rule name="SampleGameTrainer64bits" dir=in action=allow program= "]]..path..[[SampleGameTrainer64bits.EXE" enable=yes remoteip=157.60.0.1,172.16.0.0/16,LocalSubnet profile=domain
netsh advfirewall firewall add rule name="SampleGameTrainer64bits" dir=in action=allow program="]]..path..[[SampleGameTrainer64bits.EXE" enable=yes remoteip=157.60.0.1,172.16.0.0/16,LocalSubnet profile=private]]


If you notice, the name of Trainer is used in 4 different places in the code.
Replace them with your Trainer name.

We are still a beginner and explanations will be presented with examples.

We will use 4 buttons, what will it do;

Button 1) Windows "Firewall" and "DEF" will be turned off and on.
Button 2) To get the right Trainer, it will be understood how many bits the Windows has.
Button 3) A folder will be opened on the Desktop and will put the Trainer in the folder.
Button 4) will make the Trainer put in the Windows Safe Programs List and the Scan "to ignore" list.

--###########################################--
Code:
if DTool1 then DTool1.destroy() end

DTool1=createForm()
DTool1.Position=poDesktopCenter DTool1.Width=405 DTool1.Height=200
DTool1.BorderStyle=bsNone
DTool1.setLayeredAttributes(0x000100, 255, LWA_COLORKEY | LWA_ALPHA )
DTool1.Color=0x000100

local TPnl1=createPanel(DTool1) TPnl1.Height=200 TPnl1.Width=405
TPnl1.Left=0 TPnl1.Top=0 TPnl1.color=0x000100 TPnl1.BevelWidth=4
TPnl1.BevelColor=16711744

local TDesc1=createPanel(TPnl1)
TDesc1.Width=285 TDesc1.Height=32 TDesc1.Left=60  TDesc1.Top=18
TDesc1.Font.Size=12 TDesc1.Font.Style="fsBold" TDesc1.OptimalFill=true
TDesc1.color=16776960 TDesc1.BevelWidth=4 TDesc1.BevelColor=16711744
TDesc1.caption="Trainer Download Tool  V1.0"
TDesc1.OnMouseDown = function() DTool1.DragNow() end

local TBits1=createPanel(TPnl1)
TBits1.Width=165 TBits1.Height=50 TBits1.Left=120  TBits1.Top=65
TBits1.Font.Size=17 TBits1.Font.Style="fsBold" TBits1.OptimalFill=true
TBits1.color=16776960 TBits1.caption="Win Bits?"
TBits1.BevelWidth=4 TBits1.BevelColor=16711744
TBits1.OnMouseDown = function() DTool1.DragNow() end
--------------------------------------------------

local TPnl2=createPanel(TPnl1)
TPnl2.Width=177 TPnl2.Height=23 TPnl2.Left=18  TPnl2.Top=130
TPnl2.Font.Size=10 TPnl2.OptimalFill=true
TPnl2.caption="Close DEF"

local TPnl3=createPanel(TPnl1)
TPnl3.Width=177 TPnl3.Height=23 TPnl3.Left=210  TPnl3.Top=130
TPnl3.Font.Size=10 TPnl3.OptimalFill=true
 TPnl3.caption="Windows Bits? (32-64)"

local TPnl4=createPanel(TPnl1)
TPnl4.Width=177 TPnl4.Height=23 TPnl4.Left=18  TPnl4.Top=160
TPnl4.Font.Size=10 TPnl4.OptimalFill=true
TPnl4.caption="Download Trainer" TPnl4.Enabled=false

local TPnl5=createPanel(TPnl1)
TPnl5.Width=177 TPnl5.Height=23 TPnl5.Left=210  TPnl5.Top=160
TPnl5.Font.Size=10 TPnl5.OptimalFill=true
 TPnl5.caption="Add Trainer (DEF) List"
 ------------------------------------------------

local TPnl6=createPanel(TPnl1)
TPnl6.Height=32 TPnl6.Width=35 TPnl6.Left=18 TPnl6.Top=18
TPnl6.caption="-" TPnl6.Font.Size=34

local TPnl7=createPanel(TPnl1)
TPnl7.Height=32 TPnl7.Width=35 TPnl7.Left=352 TPnl7.Top=18
TPnl7.caption="X" TPnl7.Font.Size=19

function btnEff2(btis2) --16776960
btis2.Font.Style="fsBold"
btis2.color=16776960
btis2.cursor= - 21
btis2.BevelWidth=3
btis2.Font.Color=0
btis2.BevelColor=16744192
btis2.OnMouseMove=function()
btis2.BevelColor=16711744 end
btis2.OnMouseLeave=function()
btis2.BevelColor=16744192
end
end
btnEff2(TPnl2) btnEff2(TPnl3) btnEff2(TPnl4) btnEff2(TPnl5)
btnEff2(TPnl6) btnEff2(TPnl7)

--############################################################################--
--############################################################################--

TPnl6.OnClick=function() --min
DTool1.WindowState = "wsMinimized"
end
TPnl7.OnClick=function() --close
 closeCE()
 return caFree()
end

--############################################################################--
--Create a folder for the trainer.
local sf = os.getenv("USERPROFILE").."\\Desktop"; -- or TrainerOrigin or getMainForm()
local path = (sf.."\\MyTrainerFolderName")

function pth11()
os.execute([[mkdir "]]..sf..[[\MyTrainerFolderName"]])
end

--------------------------------------------------------------------------------
--Turn off Windows Defender.
local text1=[[netsh advfirewall set domainprofile state off
netsh advfirewall set privateprofile state off
netsh advfirewall set Publicprofile state off
netsh advfirewall set currentprofile state off]]

--Turn on Windows Defender.
local text2=[[netsh advfirewall set domainprofile state on
netsh advfirewall set privateprofile state on
netsh advfirewall set Publicprofile state on
netsh advfirewall set currentprofile state on]]

--Define 32-bit Trainer to Windows Firewall.
local text3=[[netsh advfirewall firewall add rule name="SampleGameTrainer32bits" dir=in action=allow program= "]]..path..[[SampleGameTrainer32bits.EXE" enable=yes remoteip=157.60.0.1,172.16.0.0/16,LocalSubnet profile=domain
netsh advfirewall firewall add rule name="SampleGameTrainer32bits" dir=in action=allow program="]]..path..[[SampleGameTrainer32bits.EXE" enable=yes remoteip=157.60.0.1,172.16.0.0/16,LocalSubnet profile=private]]

--Define 64-bit Trainer to Windows Firewall.
local text4=[[netsh advfirewall firewall add rule name="SampleGameTrainer64bits" dir=in action=allow program= "]]..path..[[SampleGameTrainer64bits.EXE" enable=yes remoteip=157.60.0.1,172.16.0.0/16,LocalSubnet profile=domain
netsh advfirewall firewall add rule name="SampleGameTrainer64bits" dir=in action=allow program="]]..path..[[SampleGameTrainer64bits.EXE" enable=yes remoteip=157.60.0.1,172.16.0.0/16,LocalSubnet profile=private]]

--------------------------------------------------------------------------------
local ind1=1
local win1=""
local arch=""
local target1=64

TPnl2.OnClick=function() --bit
if ind1==1 then
os.execute(text1)
os.execute("PowerShell Set-MpPreference -DisableRealtimeMonitoring $true") --Turn off real-time protection.
ind1=2
TPnl2.caption="Open  DEF"
else
os.execute(text2)
os.execute("PowerShell Set-MpPreference -DisableRealtimeMonitoring $false")  --Turn on real-time protection.
ind1=1
TPnl2.caption="Close  DEF"
  end
end

--------------------------------------------------------------------------------
--Determine how many bit versions of Windows you have.
--And detect Windows or Linux distinction.

TPnl3.OnClick=function() --bit
if (os.getenv"os" or ""):match"^Windows" then
   win1="Windows"
   arch = os.getenv"PROCESSOR_ARCHITECTURE"
else
   win1="Linux"/s /q
   arch = io.popen"uname -m":read"*a"
end
if (arch or ""):match"64" then
   win2="64 bit"
   target1=64
TBits1.caption="Win 64 bits"
TPnl4.visible=true
else
   win2="32 bit"
   target1=32
TBits1.caption="Win 32 bits"
end
TPnl4.Enabled=true TPnl4.Font.Size=9
TPnl4.caption=("Download "..win2.." Trainer")
return
end

--We forgot to remind you; Include the Trainer's 32 and 64 bit files in the vehicle. (CE >> Table >> Add file)
--And remember; Check the extension after adding the Trainer. (".exe" or ".EXE")

TPnl4.OnClick=function()
pth11() --The folder on the desktop is made up.
sleep(300)
 if path then
if target1==32 then
 Trainer32bits = findTableFile('SampleGameTrainer32bits.EXE').Stream
  player_path = path..'\\SampleGameTrainer32bits.EXE'
 Trainer32bits.saveToFile(player_path)
 TPnl4.caption="Down. Trainer Success!"
 else
 Trainer64bits = findTableFile('SampleGameTrainer64bits.EXE').Stream
  player_path = path..'\\SampleGameTrainer64bits.EXE'
 Trainer64bits.saveToFile(player_path) TPnl4.caption="Down. Trainer Success!"
  end
 end
end

--It will add the Trainer to the Windows Safe Programs list and the list of folders to be ignored in virus scanning.

TPnl5.OnClick=function() --add tr
if target1==32 then
os.execute(text3)
ud2=[[SampleGameTrainer32bits.EXE]]
pls1=([[powershell.exe Add-MpPreference -ExclusionPath ']]..ud2..[[']])
if ud2 then sleep(400) os.execute(pls1) end
showMessage("Add Trainer Success!")
end
if target1==64 then
os.execute(text4)
ud2=[[SampleGameTrainer64bits.EXE]]
pls1=([[powershell.exe Add-MpPreference -ExclusionPath ']]..ud2..[[']])
if ud2 then sleep(400) os.execute(pls1) end
showMessage("Add Trainer Success!")
end
end


--###############################################################--
That's all of the current coding.

*Before I forget; You will present this tool with the extension ".CETRAINER".
And the user computer must have Cheat Engine.

However, anyone who uses this coding with Cheat Engine will be deemed to have accepted the "Manifesto of Liability" above.

Here is an example of CT using all coding;
https://www.dosyaupload.com/gohR

(Since it contains 32 and 64 bit Trainer.exe, the tool is 14 MB in size. This may be a problem. Wink )

If this encoding helped you, don't forget to add +1 Reputation (Rep).

See you in the next coding "that works". Idea Idea Idea

Enjoy it! Cool

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past


Last edited by AylinCE on Mon Mar 15, 2021 2:17 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Oxijen
Expert Cheater
Reputation: 0

Joined: 07 May 2020
Posts: 163
Location: On The Moon

PostPosted: Sat Mar 13, 2021 3:59 pm    Post subject: Reply with quote

Cool Cool Cool
_________________
I can see you Hitler
Especially When I am On the Moon!!
You are Right now in cheat engine forum Wink
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 Tutorials -> LUA Tutorials 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 cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites