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 


Defined bytes alter pointer?

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

Joined: 08 Jun 2020
Posts: 122
Location: Migrating

PostPosted: Fri Apr 30, 2021 6:48 am    Post subject: Defined bytes alter pointer? Reply with quote

This is probably really basic, but I've never found why this happens myself..

Working with a pointer to find a value ingame, which is fine.
Problem arises if I try to let the user choose how much of something to pick up.

I feel like it's just an issue with the way I allocate the memory specifically, but again really not sure.

Here's what I've got:

[code]
code:
mov [held_artifacts],rcx
mov eax,[pickup_m]
mov [rcx+10],eax
mov eax,[pickup_b]
mov [rcx+14],eax
mov eax,[pickup_a]
mov [rcx+18],eax
mov eax,[r8+08]
jmp return

held_artifacts:
dq

pickup_m:
dd 1

pickup_b:
dd 1

pickup_a:
dd 1
[/code]

Storing the address (rcx) for one of the trackers, then pushing the desired values to each relevant 4byte memory section.. but doing so offsets my defined pointers in the table.
When I point to held_artifacts+10/14/18, to find the relevant addresses, they're instead offset by 100000011/15/19.

Is it because I'm declaring dq before them..?
Everything is defined as a symbol/label if it matters
Back to top
View user's profile Send private message Visit poster's website  
TheyCallMeTim13
Wiki Contributor
Reputation: 51

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Fri Apr 30, 2021 7:01 am    Post subject: Reply with quote

My guess is that it's not declared right. Make sure you give it a default value.
Code:
held_artifacts:
dq 0

_________________
Back to top
View user's profile Send private message Visit poster's website  
Birdi
Expert Cheater
Reputation: 0

Joined: 08 Jun 2020
Posts: 122
Location: Migrating

PostPosted: Fri Apr 30, 2021 7:23 am    Post subject: Reply with quote

Yeah, that was the problem... can't believe it was so simple omg

Thanks!! I assumed by declaring the space for 8byte it would be satisfied as 00000000 without explicitly being told so. Oh well, easy fix
Back to top
View user's profile Send private message Visit poster's website  
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