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 


Help with Flags please

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

Joined: 29 May 2016
Posts: 300

PostPosted: Sat Sep 09, 2017 12:09 pm    Post subject: Help with Flags please Reply with quote

Hello, I'm trying to create a flag for 3 stuff, I'm having a bit of an issue since I usualyl don't mess with Flags taht often, but how exactly do I fix this:

Code:
{ Game   : TheForest.exe
  Version:
  Date   : 2017-09-09
  Author : Kalas

  This script does blah blah blah
}

[ENABLE]

aobscan(Get_WalkSpeed_AOB,1A F3 0F 10 86 E4 00 00 00)
alloc(newmem,$100,Get_WalkSpeed_AOB)
alloc(WalkFlag,08)
alloc(RunFlag,08)
alloc(JumpFlag,08)

label(code)
label(return)
label(IncWalkSpeed)
label(IncRunSpeed)
label(IncJumpPower)
label(WalkSpeedCMP)
label(RunSpeedCMP)
label(JumpPowerCMP)

registersymbol(WalkFlag)
registersymbol(RunFlag)
registersymbol(JumpFlag)

newmem:

WalkSpeedCMP:
  cmp dword ptr [WalkFlag],1
  je IncWalkSpeed

RunSpeedCMP:
  cmp dword ptr [RunFlag],1
  je IncRunSpeed

JumpPowerCMP:
  cmp dword ptr [JumpFlag],1
  je IncJumpPower

code:
  mov [rsi+000000E4],(float)6.5
  mov [rsi+000000E8],(float)13.5
  mov [rsi+000000118],(float)8
  movss xmm0,[rsi+000000E4]
  jmp return

IncWalkSpeed:
  mov [rsi+000000E4],(float)19.5
  movss xmm0,[rsi+000000E4]
  jmp RunSpeedCMP

IncRunSpeed:
  mov [rsi+000000E8],(float)40.5
  movss xmm0,[rsi+000000E4]
  jmp JumpPowerCMP

IncJumpPower:
  mov [rsi+000000118],(float)24
  movss xmm0,[rsi+000000E4]
  jmp code

WalkFlag:
  dd 0

Run Flag:
  dd 0

JumpFlag:
  dd 0

Get_WalkSpeed_AOB+01:
  jmp newmem
  nop
  nop
  nop
return:
registersymbol(Get_WalkSpeed_AOB)

[DISABLE]

Get_WalkSpeed_AOB+01:
  db F3 0F 10 86 E4 00 00 00

unregistersymbol(Get_WalkSpeed_AOB)
dealloc(newmem)


Trying also when I disable the flag It will set my values to default again so that's why I have those:


Code:
 mov [rsi+000000E4],(float)6.5
  mov [rsi+000000E8],(float)13.5
  mov [rsi+000000118],(float)8


Not sure how to make this damn script to work.
Back to top
View user's profile Send private message
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 302

PostPosted: Sat Sep 09, 2017 3:44 pm    Post subject: Reply with quote

I think that you use from "jmp return" in the your jumps(jmp) if you want the values restore:see this script that i write for samurai warriors 4:
Code:

[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(en_speed,256)
label(returnhere)
label(DownSpeed)
label(exit)
label(SP_on)
label(UpSpeed)
registersymbol(SP_on)

en_speed:
cmp [SP_on],1
je UpSpeed


DownSpeed:
mov [ebx+000000C0],(float)1
fmul dword ptr [ebx+000000C0]
jmp returnhere

UpSpeed:
mov [ebx+000000C0],(float)3
fmul dword ptr [ebx+000000C0]
jmp returnhere


SP_on:
dd 0


exit:
jmp returnhere

"SW4II.exe"+44370:
jmp en_speed
nop
returnhere:

 
 
[DISABLE]
unregistersymbol(SP_on)
dealloc(en_speed)
"SW4II.exe"+44370:
fmul dword ptr [ebx+000000C0]
//Alt: db D8 8B C0 00 00 00


In this script i use only "jmp returnhere" for UpSpeed and DownSpeed.see carefully this script maybe your problem solved.If you have questions , ask until help you.
Back to top
View user's profile Send private message
KalasWD
Master Cheater
Reputation: 0

Joined: 29 May 2016
Posts: 300

PostPosted: Sun Sep 10, 2017 1:20 am    Post subject: Reply with quote

Well If I do jmp return It won't read the next cmp, If I do that It will just read the first one not the rest.
Back to top
View user's profile Send private message
KalasWD
Master Cheater
Reputation: 0

Joined: 29 May 2016
Posts: 300

PostPosted: Sun Sep 10, 2017 1:53 am    Post subject: Reply with quote

OK look:

Code:
movss xmm0,[rsi+000000E4]
  jmp return


I added few offsets cause I want to create flags for them as well which are:

Code:
mov [rsi+000000E4],(float)6.5
  mov [rsi+000000E8],(float)13.5
  mov [rsi+000000118],(float)8

I added those line to reset them to default If I turn off my flags, but my issue Is that I can't manage to create the flags to work, so I did:

Code:
IncWalkSpeed:
  mov [rsi+000000E4],(float)19.5
  movss xmm0,[rsi+000000E4]
  jmp RunSpeedCMP

IncRunSpeed:
  mov [rsi+000000E8],(float)40.5
  movss xmm0,[rsi+000000E4]
  jmp JumpPowerCMP

IncJumpPower:
  mov [rsi+000000118],(float)24
  movss xmm0,[rsi+000000E4]
  jmp code

WalkFlag:
  dd 0

Run Flag:
  dd 0

JumpFlag:
  dd 0


This is wher I'm stuck:


Code:
WalkSpeedCMP:
  cmp dword ptr [WalkFlag],1
  je IncWalkSpeed

RunSpeedCMP:
  cmp dword ptr [RunFlag],1
  je IncRunSpeed

JumpPowerCMP:
  cmp dword ptr [JumpFlag],1
  je IncJumpPower
Back to top
View user's profile Send private message
KalasWD
Master Cheater
Reputation: 0

Joined: 29 May 2016
Posts: 300

PostPosted: Sun Sep 10, 2017 2:09 am    Post subject: Reply with quote

Oh that looks good, thanks Very Happy
Back to top
View user's profile Send private message
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 302

PostPosted: Sun Sep 10, 2017 2:14 am    Post subject: Reply with quote

your mean is that your flags not working?
test this i edit your script.
if you want that the flag back to 0 do this
Code:
{ Game   : TheForest.exe
  Version:
  Date   : 2017-09-09
  Author : Kalas

  This script does blah blah blah
}

[ENABLE]

aobscan(Get_WalkSpeed_AOB,1A F3 0F 10 86 E4 00 00 00)
alloc(newmem,$100,Get_WalkSpeed_AOB)
alloc(WalkFlag,4)
alloc(RunFlag,4)
alloc(JumpFlag,4)
allocl(Restore,4)

label(code)
label(originalcode)
label(return)
label(IncWalkSpeed)
label(IncRunSpeed)
label(IncJumpPower)

registersymbol(WalkFlag)
registersymbol(RunFlag)
registersymbol(JumpFlag)
registersymbol(Restore)

newmem:

cmp dword ptr [WalkFlag],1
  je IncWalkSpeed
cmp dword ptr [RunFlag],1
  je IncRunSpeed
cmp dword ptr [JumpFlag],1
  je IncJumpPower
cmp dword ptr [restore],1
  je code
 jmp originalcode


IncWalkSpeed:
mov dword ptr [WalkFlag],0
  mov [rsi+000000E4],(float)19.5
  movss xmm0,[rsi+000000E4]
  jmp originalcode

IncRunSpeed:
mov dword ptr [RunFlag],0
  mov [rsi+000000E8],(float)40.5
  movss xmm0,[rsi+000000E4]
  jmp originalcode

IncJumpPower:
mov dword ptr [JumpFlag],0
  mov [rsi+000000118],(float)24
  movss xmm0,[rsi+000000E4]
  jmp originalcode


code:
mov byte ptr [restore],0
  mov [rsi+000000E4],(float)6.5
  mov [rsi+000000E8],(float)13.5
  mov [rsi+000000118],(float)8
 jmp originalcode


originalcode:
//write the originalcode here that i think: movss xmm0,[rsi+000000E4]

WalkFlag:
  dd 0
Run Flag:
  dd 0
JumpFlag:
  dd 0
Restore:
  dd 0

Get_WalkSpeed_AOB+01:
  jmp newmem
  nop
  nop
  nop
return:
registersymbol(Get_WalkSpeed_AOB)

[DISABLE]

Get_WalkSpeed_AOB+01:
  db F3 0F 10 86 E4 00 00 00

unregistersymbol(Get_WalkSpeed_AOB)
unregistersymbol(WalkFlag)
unregistersymbol(RunFlag)
unregistersymbol(JumpFlag)
unregistersymbol(Restore)
dealloc(newmem)
dealloc(WalkFlag)
dealloc(RunFlag)
dealloc(JumpFlag)
deallocl(Restore)

If you want testing this too.
I'm very glad that help to you. Wink Very Happy


Last edited by sjl002 on Sun Sep 10, 2017 2:58 am; edited 1 time in total
Back to top
View user's profile Send private message
KalasWD
Master Cheater
Reputation: 0

Joined: 29 May 2016
Posts: 300

PostPosted: Sun Sep 10, 2017 2:36 am    Post subject: Reply with quote

Oh also looks interesting, thanks Very Happy
Back to top
View user's profile Send private message
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 302

PostPosted: Sun Sep 10, 2017 2:49 am    Post subject: Reply with quote

you are welcome my friend. Razz
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