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 


getting value from script to table

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
arsenic2k
How do I cheat?
Reputation: 0

Joined: 18 Oct 2022
Posts: 1

PostPosted: Tue Oct 18, 2022 1:53 pm    Post subject: getting value from script to table Reply with quote

solved: I was typing [fuel] instead of fuel... so now is working

Hi there I have question regarding lua.

what I want is to get the value from [fuel] add to the table list so can be customizable, by default is 30 but if want another default value without editing the script, my idea was to add the [fuel] address to the table and edit the value, but I got it wrong...

I have this code

Code:

[ENABLE]

aobscanmodule(infFuel,F1Manager22.exe,F3 0F 11 91 54 04 00 00) // should be unique
alloc(newmem,$1000,infFuel)

label(code)
label(return)

alloc(fuel,4)
fuel:
  dd (float)30

newmem:
  cmp [rcx+00000884],(float)-1
  je code
  movss xmm2,[fuel]
  movss [rcx+00000454],xmm2
  jmp return

code:
  movss [rcx+00000454],xmm2
  jmp return

infFuel:
  jmp newmem
  nop 3
return:
registersymbol(infFuel)
registersymbol(fuel)

[DISABLE]

infFuel:
  db F3 0F 11 91 54 04 00 00

unregistersymbol(infFuel)
unregistersymbol(fuel)
dealloc(newmem)
dealloc(fuel)

{
// ORIGINAL CODE - INJECTION POINT: F1Manager22.exe+1163DC3

F1Manager22.exe+1163DAA: C3                       - ret
F1Manager22.exe+1163DAB: CC                       - int 3
F1Manager22.exe+1163DAC: CC                       - int 3
F1Manager22.exe+1163DAD: CC                       - int 3
F1Manager22.exe+1163DAE: CC                       - int 3
F1Manager22.exe+1163DAF: CC                       - int 3
F1Manager22.exe+1163DB0: F3 0F 10 91 54 04 00 00  - movss xmm2,[rcx+00000454]
F1Manager22.exe+1163DB8: 0F 57 C0                 - xorps xmm0,xmm0
F1Manager22.exe+1163DBB: F3 0F 5C D1              - subss xmm2,xmm1
F1Manager22.exe+1163DBF: F3 0F 5F D0              - maxss xmm2,xmm0
// ---------- INJECTING HERE ----------
F1Manager22.exe+1163DC3: F3 0F 11 91 54 04 00 00  - movss [rcx+00000454],xmm2
// ---------- DONE INJECTING  ----------
F1Manager22.exe+1163DCB: F3 0F 11 91 C0 06 00 00  - movss [rcx+000006C0],xmm2
F1Manager22.exe+1163DD3: C3                       - ret
F1Manager22.exe+1163DD4: CC                       - int 3
F1Manager22.exe+1163DD5: CC                       - int 3
F1Manager22.exe+1163DD6: CC                       - int 3
F1Manager22.exe+1163DD7: CC                       - int 3
F1Manager22.exe+1163DD8: CC                       - int 3
F1Manager22.exe+1163DD9: CC                       - int 3
F1Manager22.exe+1163DDA: CC                       - int 3
F1Manager22.exe+1163DDB: CC                       - int 3
}
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1055
Location: 0x90

PostPosted: Tue Oct 18, 2022 10:04 pm    Post subject: Reply with quote

You were close. Add an address to the table manually with the address 'fuel' (not [fuel]). Once the script is active you can then change the value.
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