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 


Support trainer for 32-bit and 64-bit OS

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Razi
Expert Cheater
Reputation: 1

Joined: 17 Jan 2018
Posts: 205

PostPosted: Tue Oct 01, 2019 6:17 am    Post subject: Support trainer for 32-bit and 64-bit OS Reply with quote

How to support trainer for 32-bit and 64-bit OS? Made a trainer with addresses (0x009ACA65). So, I need to redo the addresses to ex.: readBytes('ePSXe ENG.exe + 5E9738'). But I want to support both:
Code:
readBytes('ePSXe.exe + 5E9738')
--and
readBytes('ePSXe ENG.exe + 5E9738')

at the same time. Regardless of whether you run ePSXe.exe or ePSXe ENG.exe. So, I want to support trainer for 32 and 64 bit OS and for ePSXe.exe and ePSXe ENG.exe. What do I need to do in this case?

Solution found.
Code:
GameName1 = 'ePSXe ENG.exe'
GameName2 = 'ePSXe.exe'
GameID1 = getProcessIDFromProcessName(GameName1)
GameID2 = getProcessIDFromProcessName(GameName2)
if (GameID1 == nil) and (GameID2 ~= nil) then
openProcess(GameName2)
baseaddr = getAddress(GameName2)
elseif (GameID1 ~= nil) and (GameID2 == nil) then
openProcess(GameName1)
baseaddr = getAddress(GameName1)
elseif (GameID1 == nil) and (GameID2 == nil) then
closeCE()
return end


Will such a trainer work on all 32 and 64-bit OS?


Last edited by Razi on Sun Nov 10, 2019 1:04 am; edited 1 time in total
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Oct 02, 2019 12:56 pm    Post subject: Reply with quote

You can use the following to test if CE and the attached process are 64bit or not:

Code:

cheatEngineIs64Bit(): Returns true if CE is 64-bit, false if 32-bit
targetIs64Bit(): Returns true if the target process is 64-bit, false if 32-bit

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
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