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 


Can't compare playerbase address with rdi

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

Joined: 23 Nov 2012
Posts: 8

PostPosted: Sun Aug 23, 2020 1:59 pm    Post subject: Can't compare playerbase address with rdi Reply with quote

Hi, here is a picture to explain what I tried to do at first. My goal is to compare my health address to rdi which holds the health address what is currently taking damage. I'm doing this to filter my health out and set everything else to 0, effectively giving me godmode. I've made this work on several games but the current one I'm working on is giving me trouble.

I ended up moving rdi to rax and using that as a cmp (and yes, I remembered to pushf and push rax then pop rax and popf), and it made enemies spawn but stand still and not be able to take damage. even after disabling the script, the behavior persists and shooting one of these frozen enemies instantly crashes the game.

Does someone know something about rdi that I don't? Thanks for your help in advance



error.png
 Description:
can't compile cmp rdi,_pb
(_pb is my health base address)
 Filesize:  31.66 KB
 Viewed:  888 Time(s)

error.png


Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 55

Joined: 01 Oct 2008
Posts: 942

PostPosted: Sun Aug 23, 2020 4:00 pm    Post subject: Reply with quote

The symbol _pb is not defined within the script,
if it also not defined outside the script,
the assembler instruction will not compile as _pb is not known.

Also if _pb as an number has more that 32bit,
it will neither compiled as only a few x86-64 instruction can
has immediate number value more than 32bit. (It could compile if
the number used as an memory pointer and within 2g distance
from current address, RIP addressing, eg. cmp rdi,[_pb] )
May use a cpu register to hold the _pb value and do the compare,ie.
Code:

...
push  rax
  mov   rax,_pb
  cmp   rdi,rax
pop    rax
jne    zing
...

_________________
- Retarded.
Back to top
View user's profile Send private message
Blunderbread
How do I cheat?
Reputation: 0

Joined: 23 Nov 2012
Posts: 8

PostPosted: Sun Aug 23, 2020 4:24 pm    Post subject: Reply with quote

Thank you for the insight. I pushed _pb into rax and now the game seems to behave as it did before where enemies spawn in and freeze in place while not taking damage. When I disable this script, shooting one of the enemies crashes the game.

This may have more to do with me finding a good target, with rdi persisting even though other enemies are taking damage. I'll look more into it later; I just think it's weird how disabling the script allows the strange behavior to persist and crash the game
Back to top
View user's profile Send private message
Blunderbread
How do I cheat?
Reputation: 0

Joined: 23 Nov 2012
Posts: 8

PostPosted: Wed Aug 26, 2020 1:37 pm    Post subject: Reply with quote

Update for anyone who was curious: There was definitely an issue with RDI in the particular circumstance that I was trying.

The initial issue was fixed when converting the playerbase (denoted as _pb) from 64 bit to 32 bit by using mov rax, _pb.

The subsequent issues appeared because RDI does not uniquely reference the playerbase when the player was taking damage. I ended up taking a stab at the 'godMode' variable that the developers ever so kindly left in the game; by using the assembly to write a 1 to the godMode flag prior to initializing controls on the game and turning it off, I made myself invincible but also made the first 2 or 3 enemies that spawn at the same time as the player invincible. It wasn't a big deal after clearing the first round since not all enemies needed to be cleared. Additionally, setting [rdi] to 0 instead of xmm5 killed existing enemies instantly but also prevented new ones from spawning (and giving money/experience), and interestingly prevented me from picking up items.

The game is RoR2 which has fairly recently come out of early access on steam; great game btw. I won't say the game name directly because I don't want the developers to stumble upon it directly and patch it all, but you can google RoR2 and know what I mean.
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