Birdi Expert Cheater
Reputation: 0
Joined: 08 Jun 2020 Posts: 122 Location: Migrating
|
Posted: Fri Apr 30, 2021 6:48 am Post subject: Defined bytes alter pointer? |
|
|
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 |
|
Birdi Expert Cheater
Reputation: 0
Joined: 08 Jun 2020 Posts: 122 Location: Migrating
|
Posted: Fri Apr 30, 2021 7:23 am Post subject: |
|
|
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 |
|