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 


Replacing addresses question

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Bunny_Wabbit
Newbie cheater
Reputation: 0

Joined: 23 Sep 2017
Posts: 23
Location: United Kingdom

PostPosted: Fri May 07, 2021 6:12 am    Post subject: Replacing addresses question Reply with quote

Hey guys,

I've never really done Lua before but I don't think what I need to do is too complicated, so I'm just wondering how 'deep' I need to go into learning it for what I need to do. Basically I have teleportation hack for an emulated game in which I have to rely on an AOB scan to find all the addresses for the X coordinate, which all seem to at randomised addresses so I can't just offset all the addresses. I've set the value and AOB as the description to lead myself to it again as long as I stand in a certain place.

The problem is when it comes to the Y coordinate. Yes I could just copy and paste with an offset, which would find all the addresses, but I would lose my hotkeys, which as you can imagine all need different values for my teleportation hack. So I'm wondering how easy it would be transfer over just the addresses and offset them by four?

I'm currently doing a Java course on Udemy because I want to give myself enough knowledge to reverse engineer APKs, and I know pretty much any programming language will be able to do it by changing the XML in the saved files, but I feel like it would be more 'natural' to do it with Lua within Cheat Engine.

So I was hoping someone could help me, apparently I can't upload the table because it's more than eight bytes.
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Fri May 07, 2021 6:28 am    Post subject: This post has 1 review(s) Reply with quote

Most of the CE lua functions that take an address as a parameter will accept strings in a bracket notation (e.g. "[[game.exe+DEAD]+BEEF]+A0"). And the string can contain user symbols as well. So you could just concatenate the string with the offset. But there is also "getAddress" and "getAddressSafe" that take a string/address and return the address as a number. But you might need to use "readPointer" to properly build the pointer as a number.
https://wiki.cheatengine.org/index.php?title=Lua:getAddress
https://wiki.cheatengine.org/index.php?title=Lua:getAddressSafe
https://wiki.cheatengine.org/index.php?title=Lua:readPointer

_________________
Back to top
View user's profile Send private message Visit poster's website
Bunny_Wabbit
Newbie cheater
Reputation: 0

Joined: 23 Sep 2017
Posts: 23
Location: United Kingdom

PostPosted: Fri May 07, 2021 6:50 am    Post subject: Reply with quote

TheyCallMeTim13 wrote:
Most of the CE lua functions that take an address as a parameter will accept strings in a bracket notation (e.g. "[[game.exe+DEAD]+BEEF]+A0"). And the string can contain user symbols as well. So you could just concatenate the string with the offset. But there is also "getAddress" and "getAddressSafe" that take a string/address and return the address as a number. But you might need to use "readPointer" to properly build the pointer as a number.


Thanks for the links. I think it's proving impossible to find a pointer for this game, at least Pointer Scanner isn't working for it, neither is finding out what writes to addresses, so that's why I'm relying on AOB scans. There is one address I can't find through an AOB scan, not sure why, but that's okay because it's in the Y group so I can just offset its parallel value in the X group. Sorry if that doesn't make much sense, not sure how else to describe it, but thanks for pointing in me the right direction.

Now I just need to briefly learn how to use these commands in Cheat Engine.
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Fri May 07, 2021 4:41 pm    Post subject: This post has 1 review(s) Reply with quote

Bunny_Wabbit wrote:
...
Thanks for the links. I think it's proving impossible to find a pointer for this game, at least Pointer Scanner isn't working for it, neither is finding out what writes to addresses, so that's why I'm relying on AOB scans. There is one address I can't find through an AOB scan, not sure why, but that's okay because it's in the Y group so I can just offset its parallel value in the X group. Sorry if that doesn't make much sense, not sure how else to describe it, but thanks for pointing in me the right direction.

Now I just need to briefly learn how to use these commands in Cheat Engine.


If it helps here is a Lua module I use for a teleporter. It's a bit more than is needed but at least you can use FIND in a text editor to find the functions and see a usage example. And it's under an "MIT License", so you are free to use it, or any parts of it, if you want. But you'll likely want to look at the "writeToCoords" and "readFromCoords" functions.



I2CETeleporter.lua
 Description:

Download
 Filename:  I2CETeleporter.lua
 Filesize:  70.27 KB
 Downloaded:  109 Time(s)


_________________
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 Lua Scripting 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