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 


(pointer level2 reference)autoassemble excution error

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

Joined: 14 Sep 2011
Posts: 87

PostPosted: Fri Aug 17, 2012 1:45 pm    Post subject: (pointer level2 reference)autoassemble excution error Reply with quote

this is the error line cmp [[esi+58]+4],076450d4

esi address = 05650704
esi+58 address = 0565075c has value as pointer P->0fcd9144
0fcd9148 has value as pointer P->076450d4




I want to compare a value of 0fcd9148 to 076450d4. What's the correct code for this one?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Fri Aug 17, 2012 2:20 pm    Post subject: Reply with quote

push eax
mov eax,[esi+58]
cmp [eax+4], 076450d4
pop eax
je dosomething

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

Joined: 14 Sep 2011
Posts: 87

PostPosted: Sat Aug 18, 2012 1:53 am    Post subject: Reply with quote

Thank you dark byte .

I founded another problem .

in the following code , why we need push ecx and pop ecx.
When I remove them , the execution is success , but it make game crash ..

When I added push ecx and pop ecx , the cheat success without any problem.
I don't see any use of ecx in the code anyway.


Code:

[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat

alloc(newmem,2048) //2kb should be enough
label(returnhere)
label(originalcode)
label(exit)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here
push eax
push ebx
push ecx  // without this the game crash
mov eax,[0096aa00]
mov ebx,[eax+24]
mov [ebx+14],1a
pop eax
pop ebx
pop ecx   // without this the game crash
originalcode:
ret 0008
nop
nop

exit:
jmp returnhere

"game.dat"+DE858:
jmp newmem
returnhere:
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Sat Aug 18, 2012 4:21 am    Post subject: Reply with quote

You are popping in the wrong order

push eax decreases esp and places the value of eax into [esp]
pop eax places the value of [esp] into eax and increases esp


so if you do, push eax, push ebx and then pop eax, you place the stored address of ebx into eax

so do
push eax
push ebx
...
pop ebx
pop eax

_________________
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
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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