Posted: Sat Jan 07, 2023 7:29 am Post subject: Learning how to use Create Thread
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
Joined: 09 May 2003 Posts: 25814 Location: The netherlands
Posted: Sat Jan 07, 2023 7:49 am Post subject:
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
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.
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