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 


[AutoAssembly] Calling Functions

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

Joined: 12 Feb 2011
Posts: 46

PostPosted: Sun Mar 02, 2014 11:33 am    Post subject: [AutoAssembly] Calling Functions Reply with quote

I want to call a function in AutoAssembly with specific parameters (got them with debugging). But everytime I call it, the application crashes. Here is the code:
Code:

newmem:
cmp [00D19ED8],30
jne originalcode
push eax
push ebx
push ecx
push edx
push esp
push ebp
push edi
mov [edi],00000000
mov [ebp],00000000
mov [eax],00000000
mov [ebx],00F04D20
mov [ecx],00F0DBE8
mov [edx],01936FEE
mov [esp],0018FE50
call "app.exe"+B3CD0
pop edi
pop ebp
pop esp
pop edx
pop ecx
pop ebx
pop eax


So first of all I check the application's timer, when it hits 30, I run the code once. I store the registers, and after the call I restore them.

It calls this code:
Code:

push esi
mov esi,ecx
cmp dword ptr [esi],00
je "app.exe"+B3CDD
call "app.exe"+B3CF0
mov [esi+00000924],00000000
pop esi
ret


The "app.exe"+B3CF0 is a waaaaay longer function which is actually doesn't matter, because that function is what I want to actually call, but I found out that I must call the previous function to check some addresses.

Any idea why does it crash? I am using the same register values as it does when it's being called, and it still crashes.

EDIT:
I set up a breakpoint at the end of the function, and it seems that the function runs without any problem, the problem starts when it returns. (ret)

Thanks for advance!
Back to top
View user's profile Send private message
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