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 


Error getAddress in compiled EXE trainer

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

Joined: 08 Aug 2017
Posts: 2

PostPosted: Tue Aug 08, 2017 3:49 pm    Post subject: Error getAddress in compiled EXE trainer Reply with quote

Hello. I have code that works well in the Cheat Engine .CT. But the problem is that the right address is not determined immediately after the start of the game. If the exe is compiled, then the program will produce an error "failure determining what means" for a few seconds. Then it stops, with the message "Stack overflow". ErrorOnLookupFailure (false) does not solve the problem, the program still stops. Pcall I also tried.

This error does not appear if the trainer is started after the game starts. But I wanted to ask if it is possible to make the process monitor work correctly.

Code:

RunProcess = 0
BaseOffset = 0
StringOffset = "[Game.exe+2A82E0]"

function ProcessMonitor()
  if (getProcessIDFromProcessName("Game.exe") == nil) then
    if (RunProcess == 1) then
      RunProcess = 0
      BaseOffset = 0
    end
  else
    if (RunProcess == 0) then
      RunProcess = 1
      OpenProcess("Game.exe")
    end
    BaseOffset = getAddress(StringOffset)
  end
end
RunTimer = createTimer(nil)
timer_setInterval(RunTimer, 100)
timer_onTimer(RunTimer, ProcessMonitor)
timer_setEnabled(RunTimer, true)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 341

Joined: 09 May 2003
Posts: 19985
Location: The netherlands

PostPosted: Tue Aug 08, 2017 4:14 pm    Post subject: Reply with quote

add a timer of 20 to 30 seconds to your trainer after opening the process.

then in the timer first call reinitializeSymbolhandler(true) and then your normal code

and use getAddressSafe

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Back to top
View user's profile Send private message MSN Messenger
Tachyon
How do I cheat?
Reputation: 0

Joined: 08 Aug 2017
Posts: 2

PostPosted: Tue Aug 08, 2017 4:49 pm    Post subject: Reply with quote

After using getAddressSafe, the error "attempt to call a nil value" appears.
20 sec pause - solution does not fit.

I tried to print the address to the Cheat Engine table and take it from there using the command
BaseOffset = addresslist.getMemoryRecordByID(33).Value
or
BaseOffset = tonumber(addresslist.getMemoryRecordByID(33).Value)

Again, everything works well in .CT, but there was an error in exe.
After the reinitializeSymbolhandler (true) was added, this option worked in exe too. Thank you. However, I still do not understand why the problem with getAddress.

UPD: but with this option exe loses memory. After one minute of work, the trainer process takes 3 GB of memory. And it stops with the error "Thread creation error" and "Stack overflow".

PS: Yes, for sure, the memory leak is due to reinitializeSymbolhandler (true). I checked by removing it.
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