MantisBT - Cheat Engine
View Issue Details
0000342Cheat Enginepublic2014-09-05 03:442014-09-06 12:57
Assigned ToDark Byte 
PlatformOSOS Version
Summary0000342: In Lua, getAddress/inModule can return errors that pcall() cannot catch
DescriptionI am trying to find some addreses which do not always exist, as the target is a .NET program and the functions are only JIT'd when they are called.

If I try to call getAddress or inModule to find whether they exist, I get the error:
  Error:Failure determining what asdf means
  Script Error

Script execution is then halted, and if the script is run automatically with the table, cheat engine immediately closes and takes the debugged program with it.

I tried catching this error with popen, as explained in , and while popen can catch errors I throw myself, it cannot catch the errors that getAddress or inModule throw.

With this bug, I can't periodically check for if the functions appear later, and have to ensure that every function my script wants to debug has been called before I load my cheat table with the lua script in it.
TagsNo tags attached.
Attached Files

Dark Byte   
2014-09-05 18:24   
Call errorOnLookupFailure(false) so the lookup will result into address 0 instead of erroring out
2014-09-05 22:31   
Ah, yep. That works fine, thanks. I've updated the wiki to include this function in the Lua function list, and added references to it in getAddress and inModule so hopefully no one else checking the wiki will get caught by this.

Issue History
2014-09-05 03:44ThisIsADogHelloNew Issue
2014-09-05 18:24Dark ByteNote Added: 0000692
2014-09-05 18:24Dark ByteStatusnew => feedback
2014-09-05 22:31ThisIsADogHelloNote Added: 0000693
2014-09-06 12:57Dark ByteStatusfeedback => resolved
2014-09-06 12:57Dark ByteResolutionopen => fixed
2014-09-06 12:57Dark ByteAssigned To => Dark Byte