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 


Adding addresses and autoassign them to a record

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

Joined: 21 Mar 2015
Posts: 4

PostPosted: Sat Mar 21, 2015 6:23 pm    Post subject: Adding addresses and autoassign them to a record Reply with quote

Hello forum

[Skip this if excuses for my incompetence dont interest you]
I am currently having a problem that really stops me from finishing my table. I tried checking the forums or tutorials for lua-scripting (I got to admit I don't know anything about lua at all, a total beginner). Either nobody else was stopped by this kind of problem or i just dont know how to search for these.

[Here the real problem starts]
So I've got the problem that i want to write a script where I add one address myself at the start and the rest is gonna be calculated and autoassigned to its own record.

For example:

I have the Values

[Strength] with the address [04E64108]
[Insanity] with the address [04E6410C]
[HP] with the address [04E640EC]
[Hunger] with the address [04E64118]

the next time i start up the game the values reassign to

[Strength] with the address [14A18108]
[Insanity] with the address [14A1810C]
[HP] with the address [14A180EC]
[Hunger] with the address [14A18118]

I tried it multiple times and the last 3 digits of the hex-address stay the same with all the values i found so far. My plan now was to find one address and type in the first 5 digits (followed by three zeros) and just add the hex-address last the digits to make up the final addresses and assign them to the corresponding lines.

E.G.:
I find out the next time i start the game Strength has the address [28CB4108], so i type [28CB4000] and i automaticly get the list with
[Strength] with the address [28CB4108]
[Insanity] with the address [28CB410C]
[HP] with the address [28CB40EC]
[Hunger] with the address [28CB4118]

(I already checked pointers but it seems to be assigned totally random maybe because it is a .swf-file, so i guessed this would be the easiest way to do it)


Could anybody give me hits how to do it, or quickly whip up an example script how to do it? Maybe its really easy and i am just dumb. Smile

Thanks for reading so far and maybe somebody is able to help me out.
Back to top
View user's profile Send private message
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Sat Mar 21, 2015 6:41 pm    Post subject: Reply with quote

Are you familiar with code injections? This way you could always get the structure's base and just need to add the offset to get the desired value ...
Back to top
View user's profile Send private message
abfall94
How do I cheat?
Reputation: 0

Joined: 21 Mar 2015
Posts: 4

PostPosted: Sat Mar 21, 2015 6:49 pm    Post subject: Reply with quote

nope i stopped at code injection in the tutorial because it took me so long >.<
but well i guess i have to look it up. Thanks for the tipp.


if anybody still want to write me an example i have nothing against it Wink
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sat Mar 21, 2015 7:12 pm    Post subject: Reply with quote

You should still look up the scripting tutorials so that it can find the address automatically. Smile


example.CT
 Description:

Download
 Filename:  example.CT
 Filesize:  2.44 KB
 Downloaded:  535 Time(s)

Back to top
View user's profile Send private message
abfall94
How do I cheat?
Reputation: 0

Joined: 21 Mar 2015
Posts: 4

PostPosted: Sat Mar 21, 2015 7:31 pm    Post subject: Reply with quote

Thanks so far, guess it really is just back to tutorials for me. Smile

One question the the example.ct though. Doesn't this just allocate memory space for a variable? Or does this do something else too and i just don't understand that part correctly?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sat Mar 21, 2015 7:37 pm    Post subject: Reply with quote

Correct, the only thing the script does is create a small memory address to store your pointer value.
The addresses in the table are simply setup as pointers with the offsets you mentioned.
Once you plug in the base address, the pointer offsets should give you the values you wanted.
Back to top
View user's profile Send private message
abfall94
How do I cheat?
Reputation: 0

Joined: 21 Mar 2015
Posts: 4

PostPosted: Sat Mar 21, 2015 7:46 pm    Post subject: Reply with quote

ah sudden realisation moment Very Happy

thats how you do it, pretty simple

thank you very much guys
Back to top
View user's profile Send private message
danrevella
Master Cheater
Reputation: 2

Joined: 11 Jun 2008
Posts: 290

PostPosted: Wed Apr 08, 2015 12:26 pm    Post subject: Reply with quote

Please excuse....
In your example:
Code:

[ENABLE]
alloc(myvar,4)
registersymbol(myvar)
[DISABLE]
dealloc(myvar)
unregistersymbol(myvar)

Suppose I wanna modify this script so that the symbol myvar assume the value of: 0x41d090, or the equivalent: "test.exe"+0x2120
Ideal: myvar=0x41d090 (obvious not working!!)
Please also consider I may NOT change the code of the program, otherways it crash doing to anti-cheat protection.

How may I realize this in the script?

Many Thanks!!!
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Wed Apr 08, 2015 5:55 pm    Post subject: Reply with quote

Code:
[ENABLE]
alloc(myvar,4)
myvar:
readmem(test.exe+0x2120,4)
registersymbol(myvar)
[DISABLE]
dealloc(myvar)
unregistersymbol(myvar)
Back to top
View user's profile Send private message
danrevella
Master Cheater
Reputation: 2

Joined: 11 Jun 2008
Posts: 290

PostPosted: Thu Apr 09, 2015 3:13 am    Post subject: Reply with quote

Many Thanks!!
Sometimes I'm a lot confuse:
f.e is it a LUa or AA command?
BTW now it works very well... Very Happy
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