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 


Learning how to use Create Thread

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Bennnie
Newbie cheater
Reputation: 0

Joined: 29 Aug 2012
Posts: 11

PostPosted: Sat Jan 07, 2023 7:29 am    Post subject: Learning how to use Create Thread Reply with quote

In 'Memory viewer -> Tools -> Create Thread' there is a Cheat Engine function to spawn threads from within cheat engine that uses the target's programs code. I would like to use that function to be able to start off events in games. I am currently trying to learn how to use that function but I can't get to get it to work. The games always crash when using it.

I made a very basic console program in C#. It contains an extremely simple parameterless method that I want to start from CE:
public void Func1()
{
Console.WriteLine("-1");
}

In the attachments you see Cheat Engine on the left, and Visual Studio on the right. The start of the function must be 07574F70.

When starting a thread in CE, I expect '-1' to be written to the console like Func1() has been executed. But that does not happen. Instead it crashes with '(process 13840) exited with code -1073741819.'.

I also tried filing in the registry values by starting the thread, instantly hit a breakpoint and filling in the registry values but that also doesn't work. That also shouldn't be necessary because it is a parameterless method, right...?

Any tips for getting to fire Func1() from CE without crashing the progam? Any help is greatly appreciated Very Happy



CE+VS disassembler.png
 Description:
disassembler
 Filesize:  108.01 KB
 Viewed:  2467 Time(s)

CE+VS disassembler.png


Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Sat Jan 07, 2023 7:49 am    Post subject: Reply with quote

c# is the worst when experimenting with creating threads as each thread has a TLS that needs to be setup before it can access any .net function, and not to mention that since it's a method of the class ExThread you need to provide it an instance to an existing ExThread object, or make it a static method/class that can run without initializing "self"


I recommend writing your test application in C (not even C++) and experiment with that

_________________
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
Bennnie
Newbie cheater
Reputation: 0

Joined: 29 Aug 2012
Posts: 11

PostPosted: Sat Jan 07, 2023 9:08 am    Post subject: Reply with quote

Not the answer I was hoping for. If I cant do this to a program i've written in c#, it would also mean that doing this in a game would probably make it very hard (as in, impossible for me) to kick off a function in a game. It depends on the language it has been written in of course.

Thanks for the help. I guess I need to brush up my C skills.
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