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 


Create custom address/value the user can chose.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
DodgeWolfy
Newbie cheater
Reputation: 0

Joined: 13 May 2017
Posts: 19

PostPosted: Wed Dec 06, 2017 10:33 am    Post subject: Create custom address/value the user can chose. Reply with quote

I'll do my best to explain what i want to do, i want the user of the cheat table to be able to write a value of his choice into a field, let's say the value has an address of 0_Timer and then 0_Timer is used like an address in an AOB injection that writes to a timer, as some challenges require to do something under a certain time, others require to do over a certain time.

So basically, add an address that is not a normal one (eg. 02ABD600) but it has a name like "0_Timer" or whatever, and the AOB script reads from it. So the code would look something like this..

Code:

  fstp dword ptr [esi+000000F4]
  mov [esi+000000F4],0_Timer
  jmp return


Thanks in advance!

PS.
Sorry for the botched explanation and/or if i am coming out ignorant for, not googling it, in my defense i am not 100% sure how it's called hence why i can't exactly google it. Smile

PPS. If it helps any the timer / value should be a float.

EDIT:
I figured it out, this is what i used, not sure how well i did it but it works Smile

Code:

[ENABLE]
alloc(z_TimerAddress,$2)
registersymbol(z_TimerSeconds)
label(z_TimerSeconds)
z_TimerAddress:
z_TimerSeconds:
dd 0

[DISABLE]
dealloc(z_TimerAddress)
unregistersymbol(z_TimerSeconds)


Got it to work, However for some reason, when i do
Code:
  mov [esi+000000F4],z_TimerSeconds

it just sets the timer to 0, no matter the value in the actual address Question
Back to top
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1586

PostPosted: Wed Dec 06, 2017 1:24 pm    Post subject: Reply with quote

Code:
[enable]
alloc(0_Timer,04)
registersymbol(0_Timer)

... // add 0_Timer as an address manually

0_Timer:
dd 00

[disable]
unregistersymbol(0_Timer)
dealloc(0_Timer)

_________________
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 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