 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
mdockz Cheater
Reputation: 0
Joined: 24 Feb 2013 Posts: 41
|
Posted: Sun Jun 01, 2014 4:17 am Post subject: Quick simple ASM question. |
|
|
Hey this is just a quick question I hope it doesnt sound too crazy, but basically...
I have information that i want to change, in the process. each bit of information is a dword, so 4 bytes? this makes sense to me because each piece of information is 4 bytes offset.
eax+04
eax+08
eax+0c
.. so on so forth..
now my dilema is i need the information before eax+04..
I know that there are two more offsets before the eax+04 that i need. how would i calculate the offset backwards from eax+04?
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25796 Location: The netherlands
|
Posted: Sun Jun 01, 2014 4:39 am Post subject: |
|
|
Eax+0, eax+fffffffc
Or sub eax,4 and go from there
But be sure there is data before it at all times (there might be a reason why eax is at that spot)
_________________
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 |
|
 |
mdockz Cheater
Reputation: 0
Joined: 24 Feb 2013 Posts: 41
|
Posted: Sun Jun 01, 2014 4:52 am Post subject: |
|
|
Thanks for the quick response.
so how would i write that into a a mov?
mov [eax+fffffffc],00000000
what about the sub method you put?
also how could i check the data there?
cmp mov [eax+fffffffc],256 ?
.. provided that i knew the data there was supposed to be 256.
|
|
Back to top |
|
 |
Polynomial Grandmaster Cheater
Reputation: 5
Joined: 17 Feb 2008 Posts: 524 Location: Inside the Intel CET shadow stack
|
Posted: Sun Jun 01, 2014 6:34 am Post subject: |
|
|
You need to use a register to store the value. You can also manipulate eax to change where it points.
For example, you could do `sub eax, 10` to decrease eax by 0x10, then do `cmp [eax], 256`. After that you could use `cmp [eax+4], 256` and `cmp [eax+8], 256`, etc. to check the values after it.
Basically, assembly supports basic addition within pointers, but not subtraction in any trivial sense. To subtract, you have to use the hexadecimal representation of a negative signed integer, e.g. 0xFFFFFFFC for -4, because you're adding -4 rather than subtracting 4.
I don't know what your full situation is, but I'm guessing you've got a pointer into a list of some kind, but you don't know where in the list you are. In such a case, I'd do something like this:
Code: |
push eax ; stores current pointer
push ecx ; counter
push ebx ; stores base address
xor ecx, ecx ; zero counter
; first we're gonna search for the bottom of the list
; I'm assuming you've got a list of pointers and a value of 0 marks the base
searchBottomLoop:
sub ecx, 4 ; decrement the counter
cmp [eax+ecx], 0 ; have we hit a 0 entry (base of list)
jnz searchBottomLoop
; land here when we've found the 0 entry
mov ebx, eax ; store eax into base
add ebx ecx ; and offset by eax to get base
; now search for the list count
; again I'm assuming a value of 0 marks the end of the list
xor ecx, ecx
searchTopLoop:
add ecx, 1
cmp [ebx+ecx*4], 0 ; base + counter*4
jnz searchTopLoop
dec ecx ; compensate for null entry
; ecx now contains the list count
; now you know that the list starts at ebx and has ecx entries
; do whatever you want with that information here
; restore regs
pop ebx
pop ecx
pop eax
|
_________________
It's not fun unless every exploit mitigation is enabled.
Please do not reply to my posts with LLM-generated slop; I consider it to be an insult to my time. |
|
Back to top |
|
 |
mdockz Cheater
Reputation: 0
Joined: 24 Feb 2013 Posts: 41
|
Posted: Sun Jun 01, 2014 1:15 pm Post subject: |
|
|
thanks yuo guys helped alot .. much appreciated
|
|
Back to top |
|
 |
|
|
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
|
|