scearezt Cheater
Reputation: 0
Joined: 12 Feb 2011 Posts: 46
|
Posted: Sun Mar 02, 2014 11:33 am Post subject: [AutoAssembly] Calling Functions |
|
|
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!
|
|