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 


[Feature] Add support for serving table and changes on web

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

Joined: 26 Jun 2013
Posts: 6

PostPosted: Mon Jul 12, 2021 4:01 am    Post subject: [Feature] Add support for serving table and changes on web Reply with quote

Hi
I've been using cheat engine for many years and It's a great tool
recently I was doing some machine learning stuff, and getting feedback directly from the game memory seems like a good idea to me
but the easiest way that came to my mind was to serve the table and It's current values as a simple json response

for sending the changes we can maybe use server sent events, or a simple websocket that broadcasts changes globally

I need this feature, I would write it myself If I knew where to start, but I believe it will be a lot faster if a maintainer do this, and I believe it will be a feature that only needs a few hours to deliver.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8515
Location: 127.0.0.1

PostPosted: Mon Jul 12, 2021 11:23 am    Post subject: Reply with quote

CE has a share feature already with its CEShare community system. You can setup a share server for tables etc. to handle something like this. You can find more info on how this works in the autorun folder that comes with CE.

Here's the readme for the CEShare system:
https://raw.githubusercontent.com/cheat-engine/cheat-engine/master/Cheat%20Engine/docs/ceshare.txt

ceshare.lua and the sub-folder ceshare in there will have other info you need.

Otherwise, you can create your own trainer framework that loads parts of itself from a website each time it loads. There's a ton of topics already that cover this exact thing in the Lua sections.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
jd1378
How do I cheat?
Reputation: 0

Joined: 26 Jun 2013
Posts: 6

PostPosted: Mon Jul 12, 2021 12:01 pm    Post subject: Reply with quote

From what I understood, ceshare is for sharing tables, but not serving live values of a table

I think maybe I was not clear enough, What I want is Not to share the table or to activate/inactivate using web requests, but what I want is to be able to observe the current values and changes of a table that is currently opened in cheatengine
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8515
Location: 127.0.0.1

PostPosted: Mon Jul 12, 2021 10:21 pm    Post subject: This post has 1 review(s) Reply with quote

Ah sorry, misread what you were asking for.

CE's tables are made in XML format, while you are requesting JSON, the format being used by CE itself is XML but you could write your own formatting setup in Lua to parse the current table information and rebuild it as a JSON blob instead.

Serving it elsewhere would be a means of setting up CE to listen for requests which you can do with LuaSocket.

Your need/request for this is a tad specific to be something to directly add to CE since it can be done in Lua as well as a plugin. So it's unlikely DarkByte would see a point to adding something this specific into CE directly.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
jd1378
How do I cheat?
Reputation: 0

Joined: 26 Jun 2013
Posts: 6

PostPosted: Wed Jul 14, 2021 3:07 am    Post subject: Reply with quote

Thanks for the reply

It is still fine to get the data in xml format, I can probably handle it as it is

but I don't know where to look for on how to create and load plugins, is there any guide on this ? I would really appreciate it if you could provide a super simple sample code for the start, Or even a simple list of the functions and the tools (and maybe guides) that I need to use to get the functionality I need

also as another request, it would be nice to have this feature in a cheatengine standalone trainer, if this feature makes it's way to cheatengine that is.
Back to top
View user's profile Send private message
Doraneko
Newbie cheater
Reputation: 1

Joined: 22 Jul 2018
Posts: 10
Location: Japan Tokyo

PostPosted: Wed Jul 14, 2021 5:07 am    Post subject: Reply with quote

Read the memory with a dynamic analysis tool such as frida, which can be written in python, and implement an api server such as flask.
This is very easy if you have already realized the analysis of the target application.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8515
Location: 127.0.0.1

PostPosted: Wed Jul 14, 2021 12:04 pm    Post subject: Reply with quote

jd1378 wrote:
Thanks for the reply

It is still fine to get the data in xml format, I can probably handle it as it is

but I don't know where to look for on how to create and load plugins, is there any guide on this ? I would really appreciate it if you could provide a super simple sample code for the start, Or even a simple list of the functions and the tools (and maybe guides) that I need to use to get the functionality I need


CE's plugin stuff can be found here:
https://github.com/cheat-engine/cheat-engine/tree/master/Cheat%20Engine/plugin

The main plugin header exposing the features/functions is:
https://github.com/cheat-engine/cheat-engine/blob/master/Cheat%20Engine/plugin/cepluginsdk.h

There are a few plugins posted on the Github link that show how to use the plugin system with some basic setups. You can find some others on Github too via searching for the main export of CE plugins:
https://github.com/search?q=CEPlugin_InitializePlugin&type=code

You'd want to probably look into creating a plugin with the main type of: ADDRESSLISTPLUGIN_INIT

Also look at all the memrec_* related functions to pull information from the table.

Which should give you access to the address list of a loaded table.

You can also do all of this from Lua too, since Lua has full access to CE's UI related things and such. CE's Lua information can be found here:
https://raw.githubusercontent.com/cheat-engine/cheat-engine/master/Cheat%20Engine/bin/celua.txt

Quote:

also as another request, it would be nice to have this feature in a cheatengine standalone trainer, if this feature makes it's way to cheatengine that is.


This is possible if you are using CE's Lua system as you can create a table Lua script that does all of this that will be included with the trainer when its created.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
jd1378
How do I cheat?
Reputation: 0

Joined: 26 Jun 2013
Posts: 6

PostPosted: Fri Jul 16, 2021 4:23 am    Post subject: Reply with quote

Thanks a lot for the info! I'll definitely look into it, hopefully will be able to get it working
Back to top
View user's profile Send private message
jd1378
How do I cheat?
Reputation: 0

Joined: 26 Jun 2013
Posts: 6

PostPosted: Fri Jul 30, 2021 8:26 am    Post subject: Reply with quote

Thanks to the help you provided I managed to create a plugin in c# that has the basic functionality I need for now

for those who are interested I hosted the source on github (can't paste full url, sry):
jd1378/CEWebServePlugin
Back to top
View user's profile Send private message
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