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 "Puppet" Coordinates

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

Joined: 13 Aug 2022
Posts: 13

PostPosted: Sat Aug 13, 2022 10:56 pm    Post subject: Cheat Engine "Puppet" Coordinates Reply with quote

I am going to attempt to make this as short and to the point as I can. Basically, what I am trying to do is have cheat engine dump my values externally (to a text document, a dll, or even a webpage possibly) and then have another instance of cheat engine on another computer receive this data possibly through some form of script injection and edit the values accordingly on the fly. My end result is to make a form of "puppet multiplayer" by reading the coordinates of the player on one end and making an npc be forced to snap to them on the other. I already have both the players and npcs xyz coordinate pointers and know how to share the values as they update in real time but I would like the values from another machine to be dumped and updated on my end, or even just with two instances on the same pc. Has anybody ever attempted anything like this? Would lua be necessary for this? Where would I begin making a script that can do this?
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Sun Aug 14, 2022 2:37 am    Post subject: Reply with quote

You are playing an online game, just find the structure for all characters, identify which one is yours and which one is theirs. Set your coordinates to theirs without dealing with all that. Besides, the game itself has the best, most up-to-date info. Anything you do other than look at it introduces extra delay. This would be fairly simple to accomplish with just an aa script.

Also, the rules say we can't help you cheat online games so you will have to get better help elsewhere.
Back to top
View user's profile Send private message
Quarter187
Newbie cheater
Reputation: 0

Joined: 13 Aug 2022
Posts: 13

PostPosted: Sun Aug 14, 2022 10:32 am    Post subject: Reply with quote

I am not playing an online game. I am trying to create the illusion of 2 players in a single player game. I know there will be delay and all kinds of issues. I simply would like to know how to dump my values somewhere and inject them.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sun Aug 14, 2022 11:31 am    Post subject: Reply with quote

Learn about networking APIs. LuaSocket might be of interest.

At a high level, the first step is to connect with the other PC. If both PCs are on the same LAN, this is easy; if they're not, the safest thing would be for both to connect to a central server (you'll need to rent one) that handles the data transfer. You could alternatively modify some settings on your router and have your computer acting as the server, but if you don't know what you're doing, this is a very easy way to allow anyone to hack your network.

I don't know why you want to do this, but it probably isn't worth the effort.

_________________
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
panraven
Grandmaster Cheater
Reputation: 54

Joined: 01 Oct 2008
Posts: 941

PostPosted: Sun Aug 14, 2022 12:08 pm    Post subject: Reply with quote

If in same machine, 2 ce can share information via some ipc mechanism, for instance, beside manually handle a disk file, ce has Luapipe and sharedMemory.
For sharing a few simple values, sharedMemory may be better.
ce lua has 2 sharedMemory related functions
allocateSharedMemory(name, size)
allocateSharedMemoryLocal(name, size)
their difference are one allocate memory on attached target(game) process while other in ce's own memory. It need to access memory via respective variant call, eg. readInteger(sharedAddr) for attached process, readIntegerLocal(sharedAddr) for ce's own memory.
The return addresses of the 2 instance ce will be different, but change within the same named memory region (ie. ce1_addr+same_offset vs ce2_addr+same_offset) will be shared.

Using Luapipe may need more complex operation, but better for complex data interchange. Here a example between 2 ce <they no way be a good code, since it is my first time trial of the functions>:
server code
Code:

local function putstr(p,s)p.writeDword(#s)p.writeString(s)end
local function getstr(p,s)return p.readString(p.readDword())end

local ps = createPipe('HelloPipe')-- pipe server
if ps and ps.Valid then
  ps.acceptConnection()
  if ps.Connected then
    ps.lock()
    putstr(ps, 'hello client from server, pid:'..getCheatEngineProcessID(),true)
    print(getstr(ps)) -- get from client
    ps.unlock()
  end
  ps.Destroy()
end
print'done server'

client code
Code:

local function putstr(p,s)p.writeDword(#s)p.writeString(s)end
local function getstr(p,s)return p.readString(p.readDword())end

local pc = connectToPipe('HelloPipe') -- pipe client
if pc then
--  local len = pc.readDword()
  print('from server:', getstr(pc)) -- get from server
  putstr(pc, 'hello serser from client, pid:'..getCheatEngineProcessID(),true)
  pc.Destroy()
end
print'done client'

NOTE:
the ps.acceptConnection() seems hang the ce indefinitely till there is connection made.

_________________
- Retarded.
Back to top
View user's profile Send private message
Quarter187
Newbie cheater
Reputation: 0

Joined: 13 Aug 2022
Posts: 13

PostPosted: Sun Aug 14, 2022 12:33 pm    Post subject: Reply with quote

ParkourPenguin wrote:
Learn about networking APIs. LuaSocket might be of interest.

At a high level, the first step is to connect with the other PC. If both PCs are on the same LAN, this is easy; if they're not, the safest thing would be for both to connect to a central server (you'll need to rent one) that handles the data transfer. You could alternatively modify some settings on your router and have your computer acting as the server, but if you don't know what you're doing, this is a very easy way to allow anyone to hack your network.

I don't know why you want to do this, but it probably isn't worth the effort.


I am trying to do it through LAN and I have been obsessed with the idea of this task for almost two decades now. It is a simple concept and might sound silly to most. Where exactly do you think I should go to learn more about networking APIs and LuaSockets in order to accomplish this task? What would a lua script that connects with another PC look like? Where would it send the values and where would the other PC read them?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sun Aug 14, 2022 12:56 pm    Post subject: Reply with quote

Use a search engine. Every bit of information you could want is already out there for free.

I'd start by learning the basics of computer networking. Far too many tutorials exist on that topic.

Then start learning about computer networking in the context of programming. Most tutorials will only pertain to a particular language. Lua / LuaSoccket might not be the most popular, so maybe you could look at some other language (e.g. Rust) and apply the knowledge to LuaSocket.

An alternative to Lua would be code injection w/ {$ccode}
https://forum.cheatengine.org/viewtopic.php?t=618134

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

Joined: 13 Aug 2022
Posts: 13

PostPosted: Sun Aug 14, 2022 1:20 pm    Post subject: Reply with quote

I like the idea of code injection w/ {$ccode} wouldn't this however require that two different instances of the application and CE be running on the same device? How would I "code eject" in order to inject?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sun Aug 14, 2022 2:24 pm    Post subject: Reply with quote

I don't know what you're talking about. When I said {$ccode}, I meant programming the socket stuff in C instead of Lua / LuaSocket.
_________________
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
Quarter187
Newbie cheater
Reputation: 0

Joined: 13 Aug 2022
Posts: 13

PostPosted: Sun Aug 14, 2022 2:46 pm    Post subject: Reply with quote

ParkourPenguin wrote:
I don't know what you're talking about. When I said {$ccode}, I meant programming the socket stuff in C instead of Lua / LuaSocket.


What panraven was talking about. Let's go the route of using shared memory through ipc. I have two instances of the game and cheat engine running at once. How would I make a script in lua to allocate the shared memory between each other for a few simple addresses? Even if it's one sided instead of back and forth I would consider it progress.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sun Aug 14, 2022 3:27 pm    Post subject: Reply with quote

celua.txt:
Code:
allocateSharedMemory(name, size):
  Creates a shared memory object in the attached process of the given size if it doesn't exist yet. If size is not given and there is no shared region with this name then the default size of 4096 is used
I can't play around with this right now, but it seems simple enough for you to experiment with it.
_________________
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
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sun Aug 14, 2022 4:31 pm    Post subject: Reply with quote

Edit: this was made in response to a deleted post

Ok, maybe you should learn Lua first? There's more than enough Lua tutorials online too.

After you learn Lua, learn about the stuff that CE adds to Lua. There's some stuff on the CE wiki, documentation is in celua.txt, and the forums have plenty of examples you can search for. If you don't know how to use a search engine (e.g. "site:cheatengine.org" query), look up a tutorial for that too.

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

Joined: 13 Aug 2022
Posts: 13

PostPosted: Tue Aug 16, 2022 2:19 pm    Post subject: Reply with quote

My plan is now to write the values to a text file and then have the other instance read it and apply it to the proper address. On the write to text file side, this is what I came up with:

Code:
{$lua}
if syntaxcheck then return end
[ENABLE]
function writefile(path, content)
      local file = io.open(path,"w+b")
      if file then
        file:write(content)
        file:close()
        return true
      else
        return false
      end
end
Timer=createTimer(MainForm)
Timer.Interval=100
Timer.OnTimer= function(timer)
writefile('shared.txt',readInteger ("21CEAD45E80")..'\n')
end
[DISABLE]
Timer.Enabled=false
Timer.destroy()


Script looks fairly okay to me it simply doesn't work. Any ideas?

Update: Never mind, it actually does work! Now I will begin implementing the value on the other end.
Back to top
View user's profile Send private message
kristie745
How do I cheat?
Reputation: 0

Joined: 19 Aug 2022
Posts: 1
Location: NYC USA

PostPosted: Fri Aug 19, 2022 3:39 am    Post subject: Reply with quote

this is useful information
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 Discussions 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