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 


Cheat Engine Script export to C++

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Game Hacking Dojo
Master Cheater
Reputation: 1

Joined: 17 Sep 2023
Posts: 250

PostPosted: Tue Sep 19, 2023 11:48 am    Post subject: Cheat Engine Script export to C++ Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4719

PostPosted: Tue Sep 19, 2023 2:18 pm    Post subject: Reply with quote

Game Hacking Dojo wrote:
... 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.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Sep 20, 2023 12:00 am    Post subject: Re: Cheat Engine Script export to C++ Reply with quote

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.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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