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 


Emulator addressing question (PJ64)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Banjo Patterson
Cheater
Reputation: 1

Joined: 15 May 2018
Posts: 36

PostPosted: Sat Nov 24, 2018 2:27 am    Post subject: Emulator addressing question (PJ64) Reply with quote

Hey guys,

I'm wondering if anyone could clarify this one for me. I'm currently playing around with PJ64 and super smash bros (U), tracking the instructions that set a player's health after taking damage. The instruction is highlighted in blue, EAX is the new health, EDX+ESI is therefore the player's health address. (Pic attached).

In my example, P2's health is at address 4D8B5714. What confuses me, is EDX+ESI = 14D8B5714, which is way out of any loaded memory region, being 1 billion addresses too far. It seems the player’s health address in this instance is derived from that far address 14D8B5714 - ESI (CD640000) = 4D8B5714.

I'm hoping somebody here could shed some light on why this may be. Being an emulator it probably adds a level of mixup to the disassembly/registers, but I'm curious anyhow.

Cheers guys.

EDIT:

Actually I think I may have worked it out. Seeing as EDX is a higher address than the address of the player's health, it may be some funky assembly trick to get EDX+ESI to equal the actual address, as you can't address by EDX-ESI. Maybe the emulator just adds EDX+ESI then subs a billion addresses.

Still curious though I could be completely wrong.



SSB.PNG
 Description:
 Filesize:  24.73 KB
 Viewed:  1371 Time(s)

SSB.PNG


Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4719

PostPosted: Sat Nov 24, 2018 9:23 am    Post subject: Reply with quote

https://en.wikipedia.org/wiki/Integer_overflow

In x86, the effective address that results from an address computation is reduced modulo 2^32. In other words, everything beyond the first 4 bytes gets truncated. 14D8B5714 simply becomes 4D8B5714- that extra 1 at the front just gets carried away and never actually exists from the perspective of software.

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