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 


Script to offset pointer memory by 0x20000000 ???

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

Joined: 07 Jul 2021
Posts: 3

PostPosted: Wed Jul 07, 2021 9:00 pm    Post subject: Script to offset pointer memory by 0x20000000 ??? Reply with quote

I'm curious if there is a script to offset base memory when following a pointer.

For instance I have a code for PCSX2. This particular game makes use of pointers for some classes. The PlayerObject will have a pointer , the player object contains stuff such as Player Coordinates , health , ammo , stuff relating to the weapons recoil and aim assist function and much more...

I am wondering how I would go about automating the process of copying the PlayerObject Value and pasting it as a new address and adding 0x20000000 to it. This gets really cumbersome as I then also need to add all the offsets again as well.

EXAMPLE:
Code:

PlayerPointer Address (STATIC) : 2035A320
1. Player Pointer value => 010233D0
2. Copy Value , Add new address , Paste value as new address replacing 0x010233D0 with 0x210233D0
3. Player Object = 210233D0
4. add offsets using 210233D0 as base address
5. Die

1. Player Pointer Value => 01C8CE00
2. Repeat steps 2 - 5


Id post pictures but it won't let me , so i hope my explanation is good.

I have ways of going about this with C# and C++ but I'm unsure of how I could implement this into a script of sorts with cheat engine

Thanks for reading Smile


Last edited by xCENTx on Wed Jul 07, 2021 10:54 pm; edited 1 time in total
Back to top
View user's profile Send private message
Frouk
Master Cheater
Reputation: 5

Joined: 22 Jun 2021
Posts: 489
Location: mov dword ptr [Ukraine]

PostPosted: Wed Jul 07, 2021 10:20 pm    Post subject: Reply with quote

wdym? like every time you die player address is changing?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Wed Jul 07, 2021 11:24 pm    Post subject: Reply with quote

yes, look at https://github.com/cheat-engine/cheat-engine/blob/master/Cheat%20Engine/bin/autorun/emurpm.lua
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
xCENTx
How do I cheat?
Reputation: 0

Joined: 07 Jul 2021
Posts: 3

PostPosted: Thu Jul 08, 2021 1:05 pm    Post subject: Reply with quote

Dark Byte wrote:
yes, look at ---


When I add both files to my cheat engine directory , cheat engine doesn't open. If I just place the script in the autorun directory , cheat engine will run and show the option for emulator memory and the dropdown option for setting base address. However It will fail to load rpmemu.frm. I'm surely doing something wrong on my end. I'm not very familiar with pascal and Lua tbh.

I am running Cheat Engine 7.2. I suppose before doing a full reinstall , I wanted to double check make sure there just wasn't something I was missing.

Also , thank you very much for the quick response. also glad to see there is support for such a feature , Good work

edit: I've adjusted the possible file paths in the lua script , now im getting a new error about XML declaration not being allowed

edit2: I got it to load and work ... i think? Im not getting errors and the drop down is letting me select base memory. Although this isnt really solving my pointer issue.

Pointer: 2035A320 -> 0136A3D0
0x7B4 : 0136A3D0+7B4 = 0136AB84

I was hoping for something like this
Pointer: 2035A320 -> 2136A3D0
0x7B4 : 2136A3D0+7B4 = 2136AB84
Back to top
View user's profile Send private message
Frouk
Master Cheater
Reputation: 5

Joined: 22 Jun 2021
Posts: 489
Location: mov dword ptr [Ukraine]

PostPosted: Thu Jul 08, 2021 3:10 pm    Post subject: Reply with quote

In some games you can find pointer without any offsets
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Fri Jul 09, 2021 12:46 am    Post subject: Reply with quote

your pointer should have been changed to 35a320

so
Pointer: 35A320 -> 136A3D0
0x7B4 : 136A3D0+7B4 = 0136AB84

all memory is 0 based, so the 20000000 part should be removed


alternatively, without emurpm:
use offset 0x200007B4

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
xCENTx
How do I cheat?
Reputation: 0

Joined: 07 Jul 2021
Posts: 3

PostPosted: Fri Jul 09, 2021 12:29 pm    Post subject: Reply with quote

Dark Byte wrote:

alternatively, without emurpm:
use offset 0x200007B4



This seems so obvious. I am sorry for wasting your time on such a simple question. wow , this works flawlessly for me. Impeccable. Thank you very much <3

Now I believe I should be able to assign (PlayerPointer) as a script. Being Base address + 20000000. This way i dont need to manually input the player pointer + 20000000 each time i wish to call the player pointer in my table. But that is something I'm sure i will figure out in due time , this IS AMAZING.

Again , Thank you very much for helping me work through this trivial problem of mine. Not that i didnt have a way of manually going about it , this saves me SO much time during debugging my trainers
Back to top
View user's profile Send private message
Frouk
Master Cheater
Reputation: 5

Joined: 22 Jun 2021
Posts: 489
Location: mov dword ptr [Ukraine]

PostPosted: Sat Jul 10, 2021 3:00 am    Post subject: Reply with quote

Is your game have static pointer?
Some games have static pointer to player
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 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