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 


CMP + dword pointer + multiple offsets = error

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> Auto Assembler tutorials
View previous topic :: View next topic  
Author Message
Brian1ee7
How do I cheat?
Reputation: 0

Joined: 01 Jan 2019
Posts: 2

PostPosted: Tue Jan 01, 2019 5:39 am    Post subject: CMP + dword pointer + multiple offsets = error Reply with quote

Here is my assembly code:
Code:

[ENABLE]
alloc(newmem,2048,2934D451C32)
label(original)
label(damage)
label(returnhere)

newmem:
cmp dword ptr [[[rsi+18]+30]+1E0],1
jne damage
original:
mov rsi,[rbp-08]
jmp returnhere

damage:
mov [rsi+64],eax
jmp original

2934D451C32:
jmp newmem
nop
nop
returnhere:

[DISABLE]
dealloc(newmem)
2934D451C32:
mov [rsi+64],eax
mov rsi,[rbp-08]


The problem is here:
Code:
cmp dword ptr [[[rsi+18]+30]+1E0],1

Where rsi+18 is the pointer.

Example scenario:
rsi = 0x293BD8CFE70
rsi + 0x18 = 293BD8CFE88 0x29398A3A540
0x29398A3A540 + 0x30 = 0x29398A3A570 0x2938DDC5330
0x2938DDC5330 + 0x1E0 = 0x2938DDC5510 0x00000001

The last offset should be read as 4 byte in CMP. How do I do that? Thanks and Happy New Year! Smile
Back to top
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1586

PostPosted: Tue Jan 01, 2019 6:45 am    Post subject: Reply with quote

Code:

[ENABLE]
alloc(newmem,2048,2934D451C32)
label(original)
label(damage)
label(returnhere)

newmem:
push rsi
mov rsi,[rsi+18]
mov rsi,[rsi+30]
mov rsi,[rsi+1E0]
cmp rsi,1
pop rsi
jne damage
original:
mov rsi,[rbp-08]
jmp returnhere

damage:
mov [rsi+64],eax
jmp original

2934D451C32:
jmp newmem
nop
nop
returnhere:

[DISABLE]
dealloc(newmem)
2934D451C32:
mov [rsi+64],eax
mov rsi,[rbp-08]

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote:
i am a sweetheart.
Back to top
View user's profile Send private message Visit poster's website
Brian1ee7
How do I cheat?
Reputation: 0

Joined: 01 Jan 2019
Posts: 2

PostPosted: Thu Jan 03, 2019 2:06 am    Post subject: Reply with quote

OldCheatEngineUser wrote:
Code:

[ENABLE]
alloc(newmem,2048,2934D451C32)
label(original)
label(damage)
label(returnhere)

newmem:
push rsi
mov rsi,[rsi+18]
mov rsi,[rsi+30]
mov rsi,[rsi+1E0]
cmp rsi,1
pop rsi
jne damage
original:
mov rsi,[rbp-08]
jmp returnhere

damage:
mov [rsi+64],eax
jmp original

2934D451C32:
jmp newmem
nop
nop
returnhere:

[DISABLE]
dealloc(newmem)
2934D451C32:
mov [rsi+64],eax
mov rsi,[rbp-08]

Thanks OldCheatEngineUser! Do you also know how to add check for each pointer except the last offset if it's a valid pointer? because there are times when [rsi+30] value is not a valid pointer in my game. Thanks again!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> Auto Assembler tutorials 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