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 


Logging when calling game functions LUA

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
wulfcare
Advanced Cheater
Reputation: 0

Joined: 27 Feb 2023
Posts: 59

PostPosted: Fri Apr 21, 2023 5:54 pm    Post subject: Logging when calling game functions LUA Reply with quote

Hey guys,

I like to use lua to call game functions so I don't have load up visual studio each time. But I was wondering how I would be able to find out which argument causes crashes when I am experimenting with these functions. Is using a print() statement after each argument in executeCodeEx the best way? Any tips would be greatly appreciated.

local gameFunction= 'myGame.exe+84200'
local RCX = readPointer('myGame.exe+0x6610')
local RDX = 0x7
local R8 = 0xEC375FF0F0
local R9 = 0x1F9A5AF5770
local arg5 = 0x616

executeCodeEx(0, nil, gameFunction,
{0, RCX},
{0, RDX},
{0, R8},
{0, R9},
{0, arg5}
)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Sat Apr 22, 2023 4:44 am    Post subject: Reply with quote

after executeCodeEx have this code:
Code:

if readInteger(gameFunction)==nil then
  print("It crashed")
end


and perhaps add some information about the given parameters

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
wulfcare
Advanced Cheater
Reputation: 0

Joined: 27 Feb 2023
Posts: 59

PostPosted: Wed Apr 26, 2023 2:55 am    Post subject: Reply with quote

Is it possible to know exactly which argument caused the function to crash?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Wed Apr 26, 2023 8:09 am    Post subject: Reply with quote

attach debugger and set it to break on unexpected exceptions

then when it crashes it should break at the instruction that causes the crash.

now just figure out why

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
wulfcare
Advanced Cheater
Reputation: 0

Joined: 27 Feb 2023
Posts: 59

PostPosted: Wed Apr 26, 2023 4:12 pm    Post subject: Reply with quote

I have Break on unexpected exceptions set to always. The problem is when I set a breakpoint on the function and try and call the function using lua in cheat engine the game seems to lock up and then they both crash together.

If i just call the function from lua and I don't have a breakpoint set on the function only the game will crash.

Because they both crash when the breakpoint is set on the function when i try to call it I am unable to debug anything.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Thu Apr 27, 2023 2:31 am    Post subject: Reply with quote

use 2 ce instances. one that attaches the debugger and breaks on unexpected bp's and the other one executes the code
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
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