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 


DB/Script Issue

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

Joined: 29 May 2016
Posts: 311

PostPosted: Mon Oct 02, 2017 1:26 am    Post subject: DB/Script Issue Reply with quote

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

  This script does blah blah blah
}

[ENABLE]

aobscan(Stamina,F3 0F 10 86 2C 02 00 00 F3 0F 5A C0 F3 0F 10 0D 65)
alloc(newmem,$100,Stamina)

alloc(Player_UnlStamina, 01) // 22C
registersymbol(Player_UnlStamina)
Player_UnlStamina:
  db 0

alloc(Player_UnlHealth, 01) // 230
registersymbol(Player_UnlHealth)
Player_UnlHealth:
  db 0

alloc(Player_UnlEnergy, 01) // 238
registersymbol(Player_UnlEnergy)
Player_UnlEnergy:
  db 0

alloc(Player_UnlFullness, 01) // 264
registersymbol(Player_UnlFullness)
Player_UnlFullness:
  db 0

alloc(Player_UnlThirst, 01) // 268
registersymbol(Player_UnlThirst)
Player_UnlThirst:
  db 0

label(code)
label(return)
label(UnlStamina)
label(UnlHealth)
label(UnlEnergy)
label(UnlFullness)
label(UnlThirst)

newmem:
  cmp byte ptr [Player_UnlStamina], 01
  je UnlStamina
  cmp byte ptr [Player_UnlHealth], 01
  je UnlHealth
  cmp byte ptr [Player_UnlEnergy], 01
  je UnlEnergy
  cmp byte ptr [Player_UnlFullness], 01
  je UnlFullness
  cmp byte ptr [Player_UnlThirst], 01
  je UnlThirst
  jmp code

UnlStamina:
  mov [rsi+0000022C],(float)100
  //movss xmm0,[rsi+0000022C]
  jmp code

UnlHealth:
  mov [rsi+00000230],(float)100
  //movss xmm0,[rsi+00000230]
  jmp code

UnlEnergy:
  mov [rsi+00000238],(float)100
  //movss xmm0,[rsi+00000238]
  jmp code

UnlFullness:
  mov [rsi+00000264],(float)1
  //movss xmm0,[rsi+00000264]
  jmp code

UnlThirst:
  mov [rsi+00000268],(float)0
  //movss xmm0,[rsi+00000268]
  jmp code

code:
  movss xmm0,[rsi+0000022C]
  jmp return

Stamina:
  jmp newmem
  nop
  nop
  nop
return:
registersymbol(Stamina)

[DISABLE]

Stamina:
  db F3 0F 10 86 2C 02 00 00

unregistersymbol(Stamina)
unregistersymbol(Player_UnlStamina)
unregistersymbol(Player_UnlHealth)
unregistersymbol(Player_UnlHealth)
unregistersymbol(Player_UnlFullness)
unregistersymbol(Player_UnlThirst)
dealloc(newmem)
dealloc(Player_UnlStamina)
dealloc(Player_UnlHealth)
dealloc(Player_UnlHealth)
dealloc(Player_UnlFullness)
dealloc(Player_UnlThirst)


My issue here is that they won't check the other cmp's If I enable one of them.







I did try this method but I'm not sure If It's correct, like If It's going to constantly write 100 or whatever value I put in them If I enable not the specific one I want: (Like sort of won't turn It off)

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

  This script does blah blah blah
}

[ENABLE]

aobscan(Stamina,F3 0F 10 86 2C 02 00 00 F3 0F 5A C0 F3 0F 10 0D 65)
alloc(newmem,$100,Stamina)

alloc(Player_UnlStamina, 01) // 22C
registersymbol(Player_UnlStamina)
Player_UnlStamina:
  db 0

alloc(Player_UnlHealth, 01) // 230
registersymbol(Player_UnlHealth)
Player_UnlHealth:
  db 0

alloc(Player_UnlEnergy, 01) // 238
registersymbol(Player_UnlEnergy)
Player_UnlEnergy:
  db 0

alloc(Player_UnlFullness, 01) // 264
registersymbol(Player_UnlFullness)
Player_UnlFullness:
  db 0

alloc(Player_UnlThirst, 01) // 268
registersymbol(Player_UnlThirst)
Player_UnlThirst:
  db 0

label(code)
label(return)
label(UnlStamina)
label(UnlHealth)
label(UnlEnergy)
label(UnlFullness)
label(UnlThirst)

newmem:
  cmp byte ptr [Player_UnlStamina], 01
  je UnlStamina
  jmp code
  {cmp byte ptr [Player_UnlHealth], 01
  je UnlHealth
  cmp byte ptr [Player_UnlEnergy], 01
  je UnlEnergy
  cmp byte ptr [Player_UnlFullness], 01
  je UnlFullness
  cmp byte ptr [Player_UnlThirst], 01
  je UnlThirst
  jmp code}

UnlStamina:
  mov [rsi+0000022C],(float)100
  //movss xmm0,[rsi+0000022C]
  jmp @f

@@:
  cmp byte ptr [Player_UnlHealth], 01
  je UnlHealth
  jmp code

UnlHealth:
  mov [rsi+00000230],(float)100
  //movss xmm0,[rsi+00000230]
  jmp @f

@@:
  cmp byte ptr [Player_UnlEnergy], 01
  je UnlEnergy
  jmp code

UnlEnergy:
  mov [rsi+00000238],(float)100
  //movss xmm0,[rsi+00000238]
  jmp @f

@@:
  cmp byte ptr [Player_UnlFullness], 01
  je UnlFullness
  jmp code

UnlFullness:
  mov [rsi+00000264],(float)1
  //movss xmm0,[rsi+00000264]
  jmp @f

@@:
  cmp byte ptr [Player_UnlThirst], 01
  je UnlThirst
  jmp code

UnlThirst:
  mov [rsi+00000268],(float)0
  //movss xmm0,[rsi+00000268]
  jmp code

code:
  movss xmm0,[rsi+0000022C]
  jmp return

Stamina:
  jmp newmem
  nop
  nop
  nop
return:
registersymbol(Stamina)

[DISABLE]

Stamina:
  db F3 0F 10 86 2C 02 00 00

unregistersymbol(Stamina)
unregistersymbol(Player_UnlStamina)
unregistersymbol(Player_UnlHealth)
unregistersymbol(Player_UnlHealth)
unregistersymbol(Player_UnlFullness)
unregistersymbol(Player_UnlThirst)
dealloc(newmem)
dealloc(Player_UnlStamina)
dealloc(Player_UnlHealth)
dealloc(Player_UnlHealth)
dealloc(Player_UnlFullness)
dealloc(Player_UnlThirst)
Back to top
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1587

PostPosted: Mon Oct 02, 2017 2:09 am    Post subject: Reply with quote

can you tell me how would it work?
alloc(something,01)
you are allocating 1 byte!
use 4 bytes for 32bit games or 8 bytes for 64bit games, but 1 byte NO WAY.
in ur case allocate 8bytes cuz its 64bit.
Code:
[ENABLE]

aobscan(Stamina,F3 0F 10 86 2C 02 00 00 F3 0F 5A C0 F3 0F 10 0D 65)
alloc(newmem,$100,Stamina)

alloc(Player_UnlStamina, 01) // 22C
registersymbol(Player_UnlStamina)
Player_UnlStamina:
  db 0

alloc(Player_UnlHealth, 01) // 230
registersymbol(Player_UnlHealth)
Player_UnlHealth:
  db 0

alloc(Player_UnlEnergy, 01) // 238
registersymbol(Player_UnlEnergy)
Player_UnlEnergy:
  db 0

alloc(Player_UnlFullness, 01) // 264
registersymbol(Player_UnlFullness)
Player_UnlFullness:
  db 0

alloc(Player_UnlThirst, 01) // 268
registersymbol(Player_UnlThirst)
Player_UnlThirst:
  db 0

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote:
i am a sweetheart.
Back to top
View user's profile Send private message Visit poster's website
KalasDev
Master Cheater
Reputation: 1

Joined: 29 May 2016
Posts: 311

PostPosted: Mon Oct 02, 2017 2:41 am    Post subject: Reply with quote

Tested this one and It seems to work:

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

  This script does blah blah blah
}

[ENABLE]

aobscan(Stamina,F3 0F 10 86 2C 02 00 00 F3 0F 5A C0 F3 0F 10 0D 65)
alloc(newmem,$100,Stamina)

alloc(Player_UnlStamina, 01) // 22C
registersymbol(Player_UnlStamina)
Player_UnlStamina:
  db 0

alloc(Player_UnlHealth, 01) // 230
registersymbol(Player_UnlHealth)
Player_UnlHealth:
  db 0

alloc(Player_UnlEnergy, 01) // 238
registersymbol(Player_UnlEnergy)
Player_UnlEnergy:
  db 0

alloc(Player_UnlFullness, 01) // 264
registersymbol(Player_UnlFullness)
Player_UnlFullness:
  db 0

alloc(Player_UnlThirst, 01) // 268
registersymbol(Player_UnlThirst)
Player_UnlThirst:
  db 0

label(code)
label(return)
label(UnlStamina)
label(UnlHealth)
label(UnlEnergy)
label(UnlFullness)
label(UnlThirst)

newmem:
  cmp byte ptr [Player_UnlStamina], 01
  je UnlStamina
  jmp code

UnlStamina:
  mov [rsi+0000022C],(float)100
  //movss xmm0,[rsi+0000022C]
  jmp @f

@@:
  cmp byte ptr [Player_UnlHealth], 01
  je UnlHealth
  jmp code

UnlHealth:
  mov [rsi+00000230],(float)100
  //movss xmm0,[rsi+00000230]
  jmp @f

@@:
  cmp byte ptr [Player_UnlEnergy], 01
  je UnlEnergy
  jmp code

UnlEnergy:
  mov [rsi+00000238],(float)100
  //movss xmm0,[rsi+00000238]
  jmp @f

@@:
  cmp byte ptr [Player_UnlFullness], 01
  je UnlFullness
  jmp code

UnlFullness:
  mov [rsi+00000264],(float)1
  //movss xmm0,[rsi+00000264]
  jmp @f

@@:
  cmp byte ptr [Player_UnlThirst], 01
  je UnlThirst
  jmp code

UnlThirst:
  mov [rsi+00000268],(float)0
  //movss xmm0,[rsi+00000268]
  jmp code

code:
  movss xmm0,[rsi+0000022C]
  jmp return

Stamina:
  jmp newmem
  nop
  nop
  nop
return:
registersymbol(Stamina)

[DISABLE]

Stamina:
  db F3 0F 10 86 2C 02 00 00

unregistersymbol(Stamina)
unregistersymbol(Player_UnlStamina)
unregistersymbol(Player_UnlHealth)
unregistersymbol(Player_UnlHealth)
unregistersymbol(Player_UnlFullness)
unregistersymbol(Player_UnlThirst)
dealloc(newmem)
dealloc(Player_UnlStamina)
dealloc(Player_UnlHealth)
dealloc(Player_UnlHealth)
dealloc(Player_UnlFullness)
dealloc(Player_UnlThirst)


I know 4 Byte and 8 Byte for 32 x 64, but I just thought since It's a db I should allocate 1 byte that's it, I don't know I'll keep in mind what you said.
Back to top
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1587

PostPosted: Mon Oct 02, 2017 3:38 am    Post subject: Reply with quote

true about what you said for allocating memory for 1 byte, i do it sometimes for 2 byte values.

but for some reasons and sometimes it give me unwanted result, so im almost like you in this case idk why when i allocate 2 byte of memory for 2 byte value dont work and some cases work.

oh also i didnt read the whole script since its large a bit and idk what are trying to do.

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote:
i am a sweetheart.
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 -> 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