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 


Why does the game crash when passing arguments through GUI

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

Joined: 27 Feb 2023
Posts: 59

PostPosted: Fri Apr 21, 2023 9:32 pm    Post subject: Why does the game crash when passing arguments through GUI Reply with quote

The game I am currently reversing uses a mainGameFunction that passes different opcodes through it to determine what the user is trying to do. When i do stuff like talk to npc or attack npc calling the game function works perfect when i pass in the arguments that are shown in cheat engines registers and stack. But when I try the exact same thing with any GUI element the game instantly crashes. Is there something different about GUIs that tend to do this?

If anyone has experienced a similar problem dealing with gui elements in a game I would love to know.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

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

perhaps the GUI controls can only be called from one specific thread and will cause a crash if anything but the GUI thread accesses a GUI element

Perhaps you can find this thread and find code only this thread accesses and then call the function from there

_________________
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: Sat Apr 22, 2023 4:38 pm    Post subject: Reply with quote

Thats a good idea, but unfortunately when i set a breakpoint on the function and check its thread ID on the memory viewer window, they both use the same thread id. If you come up with any other potential solutions, I would love to here them.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

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

How do you currently call mainGameFunction ? Using ce's executecode functions, or using an ingame hook ?

If executeCode the issue may still apply (Wrong threadID for GUI access)

_________________
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 9:15 pm    Post subject: Reply with quote

They both seem to share the same Thread ID, and the same TEB when I set a breakpoint on the function and use the function for an ingame action and use the function for interacting with the GUI. I am using threadlist to inspect.

This should mean they both are using the same thread? Or could I be missing something.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

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

how do you get the function to execute?

Using a code injection from a function that is called from the same thread, or using ce's executeCode(Ex) as ce's executeCodeEx runs in a different thread

_________________
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: Thu Apr 27, 2023 3:01 am    Post subject: Reply with quote

omg i didnt know you could do that. Thank you DB
Back to top
View user's profile Send private message
wulfcare
Advanced Cheater
Reputation: 0

Joined: 27 Feb 2023
Posts: 59

PostPosted: Thu Apr 27, 2023 1:47 pm    Post subject: Reply with quote

I debugged my code and it seems to crash at v19. I havn't dealt with volatile variables before, is there any tricks I need to do to when trying to call them?

volatile signed __int32 *v19; // [rsp+50h] [rbp-58h]

guiFunction(gameClient_1, v28, (__int64 *)v19, (__int64 *)a7);
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking 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