Posted: Tue Sep 19, 2023 11:48 am Post subject: Cheat Engine Script export to C++
Hello everyone,
I make a lot of cheats using Cheat Engine. But sometimes I find it more comfortable to use C++, especially when making function calls or want to finalise my work to share. However, using C++ to write assembly for 64-bit processes is somehow complicated with MSVC (I didn't like the syntax in GCC at all) and I did not find a way that works for MSVC (It works with GCC. I'd rather not use GCC). Please if you know something tell.
But, I found that I could write direct bytes and achieve the same results. However, I would love it if Cheat Engines scripts could be shown or exported as bytes-only. I know I could enable the script and copy the bytes but when I have tons of scripts that's going to be so much easier.
I am working on making a template in C++ for trainer-making regardless of the processes or the technique. To import from Cheat Engine to C++ with ease. I couldn't find such a thing. I don't know why no one made one. Or I just didn't see them. If there's a template or source code please tell me.
... if Cheat Engines scripts could be shown or exported as bytes-only.
That's impossible in general. i.e. RIP-relative addressing.
You could use Lua to automate the conversion of simple code injections to bytes without too much trouble, but you'll still have to deal with some bytes manually. This won't be as simple as "allocate some memory, write some bytes, and done." _________________
I don't know where I'm going, but I'll figure it out when I get there.
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
Posted: Wed Sep 20, 2023 12:00 am Post subject: Re: Cheat Engine Script export to C++
Game Hacking Dojo wrote:
However, using C++ to write assembly for 64-bit processes is somehow complicated with MSVC (I didn't like the syntax in GCC at all) and I did not find a way that works for MSVC (It works with GCC. I'd rather not use GCC). Please if you know something tell.
MSVC does not support direct inline assembly when compiling for 64bit. Check my post here for more info on how to work around it to still use ASM in a different manner with MSVC x64:
https://forum.cheatengine.org/viewtopic.php?p=5785942#5785942
Game Hacking Dojo wrote:
However, I would love it if Cheat Engines scripts could be shown or exported as bytes-only. I know I could enable the script and copy the bytes but when I have tons of scripts that's going to be so much easier.
This isn't possible for a number of reasons. Not all of CE's scripting is directly convertable to ASM, and not all of it is convertable as-is. Some of it has to be 'executed' on the fly, allocations have to be made, addresses have to be calculated properly, etc. If you are looking to just convert code cave related things, look into projects like AsmJIT and other JIT-like tooling. You can achieve a similar effect using libraries like that. _________________
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