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 


Trainer issue

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

Joined: 29 May 2016
Posts: 311

PostPosted: Fri Apr 27, 2018 10:36 pm    Post subject: Trainer issue Reply with quote

Code:
{ Game   : TheForest.exe
  Version:
  Date   : 2018-04-28
  Author : Kalas

  This script does blah blah blah
}

[ENABLE]

aobscan(aobStamina,F3 0F 10 86 3C 02 00 00 F3 0F 5A C0 F3 0F 10 0D 74)
alloc(newmem,$100,aobStamina)

label(code)
label(return)
label(ptrBasePlayerStats)
label(setBodyTemp)
label(setHeartRate)
label(setStamina)
label(setHealth)
label(setEnergy)
label(setBatteryCharge)
label(setFullness)
label(setThirst)

newmem:
  cmp [setBodyTemp], 0
  je @f
  mov [rsi+230], (float)37

@@:
  cmp [setHeartRate], 0
  je @f
  mov [rsi+234], #70

@@:
  cmp [setStamina], 0
  je @f
  mov [rsi+23C], (float)100

@@:
  cmp [setHealth], 0
  je @f
  mov [rsi+240], (float)100
  mov [rsi+244], (float)100

@@:
  cmp [setEnergy], 0
  je @f
  mov [rsi+248], (float)100

@@:
  cmp [setBatteryCharge], 0
  je @f
  mov [rsi+258], (float)100

@@:
  cmp [setFullness], 0
  je @f
  mov [rsi+274], (float)1

@@:
  cmp [setThirst], 0
  je @f
  mov [rsi+278], (float)0

code:
  mov [ptrBasePlayerStats], rsi

  movss xmm0,[rsi+0000023C]
  jmp return

ptrBasePlayerStats:
  dq 0

setBodyTemp:
  dd 0

setHeartRate:
  dd 0

setStamina:
  dd 0

setHealth:
  dd 0

setEnergy:
  dd 0

setBatteryCharge:
  dd 0

setFullness:
  dd 0

setThirst:
  dd 0

aobStamina:
  jmp newmem
  nop
  nop
  nop
return:
registersymbol(aobStamina)
registersymbol(ptrBasePlayerStats)
registersymbol(setBodyTemp)
registersymbol(setHeartRate)
registersymbol(setStamina)
registersymbol(setHealth)
registersymbol(setEnergy)
registersymbol(setBatteryCharge)
registersymbol(setFullness)
registersymbol(setThirst)

[DISABLE]

aobStamina:
  db F3 0F 10 86 3C 02 00 00

unregistersymbol(aobStamina)
unregistersymbol(ptrBasePlayerStats)
unregistersymbol(setBodyTemp)
unregistersymbol(setHeartRate)
unregistersymbol(setStamina)
unregistersymbol(setHealth)
unregistersymbol(setEnergy)
unregistersymbol(setBatteryCharge)
unregistersymbol(setFullness)
unregistersymbol(setThirst)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: 52471438

""+5247140D: 41 FF D3                       -  call r11
""+52471410: 48 83 C4 20                    -  add rsp,20
""+52471414: EB 22                          -  jmp PlayerStats:Update+a48
""+52471416: 48 8B 86 30 01 00 00           -  mov rax,[rsi+00000130]
""+5247141D: 48 8B C8                       -  mov rcx,rax
""+52471420: 48 83 EC 20                    -  sub rsp,20
""+52471424: 83 38 00                       -  cmp dword ptr [rax],00
""+52471427: 49 BB 30 54 47 52 00 00 00 00  -  mov r11,PlayerTuts:CloseLowEnergyTutorial
""+52471431: 41 FF D3                       -  call r11
""+52471434: 48 83 C4 20                    -  add rsp,20
// ---------- INJECTING HERE ----------
""+52471438: F3 0F 10 86 3C 02 00 00        -  movss xmm0,[rsi+0000023C]
// ---------- DONE INJECTING  ----------
""+52471440: F3 0F 5A C0                    -  cvtss2sd xmm0,xmm0
""+52471444: F3 0F 10 0D 74 39 00 00        -  movss xmm1,[PlayerStats:Update+43d0]
""+5247144C: F3 0F 5A C9                    -  cvtss2sd xmm1,xmm1
""+52471450: 66 0F 2F C8                    -  comisd xmm1,xmm0
""+52471454: 0F 82 36 00 00 00              -  jb PlayerStats:Update+aa0
""+5247145A: 0F B6 86 9D 02 00 00           -  movzx eax,byte ptr [rsi+0000029D]
""+52471461: 85 C0                          -  test eax,eax
""+52471463: 75 2B                          -  jne PlayerStats:Update+aa0
""+52471465: 48 8B CE                       -  mov rcx,rsi
""+52471468: BA 80 2E 96 9A                 -  mov edx,9A962E80
}


I'm setting the cheats on by using these scripts outside the main one:

Code:
[ENABLE]
setBodyTemp:
  dd 1

[DISABLE]
setBodyTemp:
  dd 0



My issue is that while making a Trainer via CE Generator the activation mark "red" while the cheat is on won't come down, as if the cheat won't deactivate, I've set the Hotkey as toggle script instead of doing set value to 1 etc...

Is there a workaround?
Back to top
View user's profile Send private message
kantoboy69
Advanced Cheater
Reputation: 2

Joined: 31 Mar 2010
Posts: 71
Location: Manila

PostPosted: Sun Apr 29, 2018 6:26 am    Post subject: Reply with quote

I think I have a similar issue when testing newly created script. Somehow CE 6.7 is kinda sensitive on script formatting.

Quote:

aobStamina:
jmp newmem
nop
nop
nop
return:
registersymbol(aobStamina)
registersymbol(ptrBasePlayerStats)


try carriage return on "return:". Then save. Close CE then Run, Load, and test if it would toggle.

Code:
aobStamina:
  jmp newmem
  nop
  nop
  nop
return:

registersymbol(aobStamina)
registersymbol(ptrBasePlayerStats)

_________________
Cheater always prosper Hitler
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 Lua Scripting 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