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 


Comparing 2 addresses in assembly

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
kagato1980
Cheater
Reputation: 0

Joined: 30 Oct 2020
Posts: 30
Location: The netherlands

PostPosted: Tue Nov 03, 2020 8:18 am    Post subject: Comparing 2 addresses in assembly Reply with quote

I am trying to make an injection for ZSNES, where a lot of value modifications pass through this code:

Code:
mov [ecx+zsnesw.exe+32B468],al


Now I want to compare the address (not the value) to a baseaddress where 'health' is stored. But the compiler won't let me save the script:

Code:
cmp ecx + zsnesw.exe+32B468,0072E846


If I add brackets, it will try comparing the value instead of address I think..when I do that it doesn't work anyhow. Any ideas?

Edit: I fixed it, by just comparing the value of ecx, as that is the only variable in the address..the code:

Code:

code:
  cmp ecx,0x00033DE
  je return
  mov [ecx+zsnesw.exe+32B468],al
  jmp return


Whenever I get hit, instead of writing to health it just skips. And for the other addresses it keeps the original code Very Happy
Back to top
View user's profile Send private message
MMM-304
Expert Cheater
Reputation: 0

Joined: 17 Aug 2020
Posts: 170
Location: Milkey Way

PostPosted: Tue Nov 03, 2020 10:09 am    Post subject: Reply with quote

to compare address
Code:

push eax
lea eax,[ecx+zsnesw.exe+32B468]
cmp eax,0072E846
pop eax
Back to top
View user's profile Send private message
kagato1980
Cheater
Reputation: 0

Joined: 30 Oct 2020
Posts: 30
Location: The netherlands

PostPosted: Wed Nov 04, 2020 2:41 am    Post subject: Reply with quote

Cool,thanks!
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 Gamehacking 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