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 


Crash on this AA script

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

Joined: 05 Aug 2020
Posts: 84

PostPosted: Sat Mar 26, 2022 9:44 am    Post subject: Crash on this AA script Reply with quote

Below is my AA script for a game. Its crashing and I can't find the problem.
Help me find the problem.
Code:

[ENABLE]

alloc(newmem_forSwing,100)
alloc(newmemforspeed,100)
alloc(memforsafepass,50)
alloc(origX,4)
alloc(origY,4)
alloc(degree,4)
alloc(radmult,4)
alloc(angle,4)
registersymbol(degree)
registersymbol(angle)

angle:
dd (float)45.0


radmult:
dd (float)0.01745


newmem_forSwing:
mov [edx],eax
fmul dword ptr [esp+24]
cmp edx,00300000
jle "game.exe"+1442BF
cmp (byte)["game.exe"+3EDBFE],0
je "game.exe"+1442BF
push ecx
mov ecx,[edx]
mov [origX],ecx
pop ecx
jmp "game.exe"+1442BF


memforsafepass:
mov [edx+08],eax
mov [ebx+04],ecx
jmp "game.exe"+1442E4


newmemforspeed:
cmp edx,00300000
jle memforsafepass
cmp (byte)["game.exe"+3EDBFE],0
je memforsafepass
push edi
mov edi,[edx+08]
mov [origY],edi
pop edi
// here I am calculating the rotated coordinate for origX and origY using angle.
//I am basically calculating this equation : x=xcos - ysin and y=xsin+ycos where x is origX and y is origY and theta here is angle.
fld [angle]
fmul [radmult]
fstp [degree]
fld [degree]
fcos
fld [degree]
fsin
fld [origY]
fmul st(1)
fld [origX]
fmul st(3)
fsub st(1)
fstp [edx]
fstp st(0)
fld [origX]
fmul st(1)
fld [origY]
fmul st(3)
fadd st(1)
fstp [edx+08]
fstp st(0)
fstp st(0)
fstp st(0)
mov [ebx+04],ecx
mov ["game.exe"+3EDBFE],0
jmp "game.exe"+1442E4




"game.exe"+1442B9: //swing address
jmp newmem_forSwing
nop


"game.exe"+1442DE:
jmp newmemforspeed
nop




[DISABLE]
unregistersymbol(angle)
unregistersymbol(degree)
dealloc(angle)
dealloc(newmem_forSwing)
dealloc(newmemforspeed)
dealloc(memforsafepass)
dealloc(origX)
dealloc(origY)
dealloc(degree)
dealloc(radmult)

"game.exe"+1442B9:
mov [edx],eax
fmul dword ptr [esp+24]

"game.exe"+1442DE:
mov [edx+08],eax
mov [ebx+04],ecx
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sat Mar 26, 2022 4:21 pm    Post subject: Reply with quote

Moved; this isn't a tutorial.

As for finding the crash, inject your script and go to where the cave is created and set a breakpoint at the top of it. Then step through the code when it's called to see when the crash happens.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
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