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 


How to limit the velocity acceleration value?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
sbryzl
Master Cheater
Reputation: 6

Joined: 25 Jul 2016
Posts: 252

PostPosted: Wed Aug 17, 2022 2:03 pm    Post subject: Reply with quote

Have you tried writing a value directly to the address?

Code:
mov dword ptr [rax+00000230],(float)9000
mov dword ptr [rax+00000238],(float)9000
Back to top
View user's profile Send private message
sbryzl
Master Cheater
Reputation: 6

Joined: 25 Jul 2016
Posts: 252

PostPosted: Thu Aug 18, 2022 7:42 am    Post subject: Reply with quote

Here is a method you could use to set a speed limit after the multiplier.
Code:
newmem:

cmp byte ptr [speed_input],1
je fast
jmp originalcode

fast:
fld dword [rax+00000230]
fmul dword [speed_modifier]

fld dword [speed_maxlimit]
fcomi ST(0),ST(1)
jl short floatflip
fxch
floatflip:
fstp dword [rax+00000230]
fstp st(0)

jne originalcode
fld dword [rax+00000238]
fmul dword [speed_modifier]

fld dword [speed_maxlimit]
fcomi ST(0),ST(1)
jl short floatflip
fxch
floatflip:
fstp dword [rax+00000238]
fstp st(0)

originalcode:
movups xmm1,[rax+00000230]
jmp return

align 4

speed_input:
db 0

speed_modifier:
dd (float)1.03

speed_maxlimit:
dd (float)9
Back to top
View user's profile Send private message
sbryzl
Master Cheater
Reputation: 6

Joined: 25 Jul 2016
Posts: 252

PostPosted: Thu Aug 18, 2022 8:41 am    Post subject: Reply with quote

The conditional jump may need to be different.
Instead of
jl short floatflip
try
jb short floatflip
or
jna short floatflip
Back to top
View user's profile Send private message
sbryzl
Master Cheater
Reputation: 6

Joined: 25 Jul 2016
Posts: 252

PostPosted: Thu Aug 18, 2022 9:22 am    Post subject: Reply with quote

The second jump to originalcode isn't necessary as it would already be handled initially. That may be your problem. Here it is commented out.
Code:

newmem:

cmp byte ptr [speed_input],1
jne originalcode
//je fast
//jmp originalcode

fast:
fld dword [rax+00000230]
fmul dword [speed_modifier]

fld dword [speed_maxlimit]
fcomi ST(0),ST(1)
jl short floatflip
fxch
floatflip:
fstp dword [rax+00000230]
fstp st(0)

//jne originalcode
fld dword [rax+00000238]
fmul dword [speed_modifier]

fld dword [speed_maxlimit]
fcomi ST(0),ST(1)
jl short floatflip
fxch
floatflip:
fstp dword [rax+00000238]
fstp st(0)

originalcode:
movups xmm1,[rax+00000230]
jmp return

align 4

speed_input:
db 0

speed_modifier:
dd (float)1.03

speed_maxlimit:
dd (float)9
Back to top
View user's profile Send private message
sbryzl
Master Cheater
Reputation: 6

Joined: 25 Jul 2016
Posts: 252

PostPosted: Thu Aug 18, 2022 1:47 pm    Post subject: Reply with quote

This should be all the necessary alterations cleaned up a bit. I don't know what the issue is since I can't see it myself. If you need the second jump for some reason you should redo the compare before it. If there is an issue with forward or sideways motion maybe one of the 2 components could be removed so it's not affected.


Code:
[ENABLE]
aobscanmodule(aob_speed,SnowRunner.exe,0F 10 88 30 02 00 00 0F 59 C9)
alloc(newmem,$1000,aob_speed)
label(return)
label(fast)
label(speed_input)
label(speed_modifier)
registersymbol(aob_speed)
registersymbol(speed_input)
registersymbol(speed_modifier)

newmem:
cmp byte ptr [speed_input],1
jne originalcode

fast:
fld dword [rax+00000230]
fmul dword [speed_modifier]
fld dword [speed_maxlimit]
fcomi ST(0),ST(1)
jna short @F
fxch
@@:
fstp dword [rax+00000230]
fstp st(0)

//cmp byte ptr [speed_input],1
//jne originalcode
fld dword [rax+00000238]
fmul dword [speed_modifier]
fld dword [speed_maxlimit]
fcomi ST(0),ST(1)
jna short @F
fxch
@@:
fstp dword [rax+00000238]
fstp st(0)

originalcode:
movups xmm1,[rax+00000230]
jmp return

align 4

speed_input:
db 0

speed_modifier:
dd (float)1.03

speed_maxlimit:
dd (float)9



aob_speed:
jmp newmem
nop 2
return:

[DISABLE]
aob_speed:
  db 0F 10 88 30 02 00 00
dealloc(newmem)
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 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