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 


Using pointer in assembler

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

Joined: 26 Apr 2016
Posts: 51

PostPosted: Wed Nov 16, 2016 6:10 am    Post subject: Using pointer in assembler Reply with quote

Hello everyone,

yes, I know, I'm such a noob, but I've ran into a little problem while toying around with another game. The game stores the player number using a dynamic pointer.

The pointer is mentioned in the register [edi+0C]. By dissecting the data of the pointer adress, I found out that the player number is stored at the pointer adress+4 (it is a regular 4 byte value).

But uh how do I use this in my assembler script? How do I tell cheat engine to check for the value held at the dynamic pointer+04?

So again as a short summary:
Register edi+0C holds the pointer value
Pointer value+4 holds the player number
I want to run a check if the player number is 1 (it is a single player game, but the computer controls different "factions").

I've tried a lot but yet to no avail; I gues I'm using the wrong syntax... Can anyone help this lil Noob?
Thanks!

_________________
Yeah, I do tables for some pretty obscure or old stuff.
If you've got problems or questions with a cheat, be sure to read the info script if supplied.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Wed Nov 16, 2016 6:44 am    Post subject: Reply with quote

Code:

push eax //save eax
mov eax,[edi+0c]
cmp byte ptr [eax+4],1
pop eax //restore eax (this won't change the compare result)
jne nottheplayer

//do stuff like setting health to 100%

nottheplayer:
//do something like setting health to 1 or 0



_________________
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
CyberD3m0n
Advanced Cheater
Reputation: 1

Joined: 26 Apr 2016
Posts: 51

PostPosted: Wed Nov 16, 2016 8:04 am    Post subject: Reply with quote

Dark Byte wrote:
Code:

push eax //save eax
mov eax,[edi+0c]
cmp byte ptr [eax+4],1
pop eax //restore eax (this won't change the compare result)
jne nottheplayer

//do stuff like setting health to 100%

nottheplayer:
//do something like setting health to 1 or 0




Thank you very much, I'll try this. Looking good!

Edit: Yes, it worked perfectly. Once again, DarkByte is a god among man.

_________________
Yeah, I do tables for some pretty obscure or old stuff.
If you've got problems or questions with a cheat, be sure to read the info script if supplied.
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