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 


Calling Mono method crashed the game in a strange way

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

Joined: 22 Dec 2024
Posts: 6

PostPosted: Mon Feb 03, 2025 3:37 am    Post subject: Calling Mono method crashed the game in a strange way Reply with quote

Hi,

I tried to use aa script to call the mono game method `UpdateQuest`, which manages the player's new tasks and progress. The strange thing about it is: the script ran without problems when I just launched the game and loaded the save. BUT after I proceeded with a task or finished one in the gameplay (both would trigger the game process to use the `UpdateQuest` method), calling the method with the same aa script often led to a game crash.

I know the game had less free memory because `alloc()` often allocated memory over 2 GB away from where the method was located. Does that have anything to do with this crash?

Here is my script (I am sure the mono feature was opened when used):
Code:

        [ENABLE]

        alloc(InvokeMonoClassMethod, $100)
        createThread(InvokeMonoClassMethod)
        alloc(self, 8)

        InvokeMonoClassMethod:
        sub rsp,28
        call mono-2.0-bdwgc.mono_get_root_domain
        mov rcx,rax
        call mono-2.0-bdwgc.mono_thread_attach
        mov [self], rax
        mov rcx,23A26ABC1E0    // the QuestData class instance
        mov rdx,83D                  // questID
        mov r8d,1                      // quest progress
        mov r9d,1                      // progress status
        call QuestData:UpdateQuest
        mov rcx,[self]
        call mono-2.0-bdwgc.mono_thread_detach
        add rsp,28
        ret

        [DISABLE]
        dealloc(self)
        dealloc(InvokeMonoClassMethod)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 467

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

PostPosted: Mon Feb 03, 2025 8:04 am    Post subject: Reply with quote

likely the QuestData class instance (23A26ABC1E0) changed upon loading a save/restart the game
_________________
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
Qiuzy
How do I cheat?
Reputation: 0

Joined: 22 Dec 2024
Posts: 6

PostPosted: Mon Feb 03, 2025 12:35 pm    Post subject: Reply with quote

Dark Byte wrote:
likely the QuestData class instance (23A26ABC1E0) changed upon loading a save/restart the game
No, it wasn't.

It is not a script for automation. I got the instance address from another script and then copy-pasted it back here in this script whenever restarting the game process. I also ensured the instance address hadn't changed when I proceeded/finished a quest in-game.

The crashing went as follows:

    1. Launched the game
    2. Loaded a save
    3. Ran script 1 to get the instance address of `QuestData`
    4. Copy-pasted the address back to this script, right after `mov rcx,`
    5. I hadn't done anything about quests in the game so far
    6. Ran this script multiple times with different rdx, r8, r9, all succeeded
    7. Proceeded with any quest in the game, the game itself would use the same method to update quest statuses
    8. Used script 1 to check the instance address of `QuestData` wasn't changed
    8. Ran this script again, the game crashed (not always but often)


I've checked everything I could. Quite frustrating.
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 Discussions 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