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 


How does one use a multi-level pointer in a script?

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

Joined: 10 Oct 2015
Posts: 38

PostPosted: Tue Mar 21, 2017 10:48 am    Post subject: How does one use a multi-level pointer in a script? Reply with quote

How would it be possible to write to a location in memory with a multi-level pointer such as "ABCD.exe+01099E60+3754+1100+C5+3+CC0+4+740+3C8"

I'd like to be able to use this kind of method for a trainer instead of an AOB module scan or code injection in the AutoAssembler.

Thanks for the help
Back to top
View user's profile Send private message
Filipe_Br
Master Cheater
Reputation: 3

Joined: 07 Jan 2016
Posts: 272
Location: My house

PostPosted: Tue Mar 21, 2017 11:30 am    Post subject: Re: How does one use a multi-level pointer in a script? Reply with quote

Code:
[ENABLE]
label(address)
registersymbol(address)
alloc(mem, 1000)
createthread(mem)

mem:
  mov [address],64
  ret

[[[[[[[["ABCD.exe"+01099E60]+3754]+1100]+C5]+3]+CC0]+4]+740]+3C8:
address:
 
 
[DISABLE]
dealloc(mem)
unregistersymbol(address)

_________________
...
Back to top
View user's profile Send private message
CPUzX
Cheater
Reputation: 0

Joined: 10 Oct 2015
Posts: 38

PostPosted: Tue Mar 21, 2017 11:49 am    Post subject: Re: How does one use a multi-level pointer in a script? Reply with quote

Filipe_Br wrote:
Code:
[ENABLE]
label(address)
registersymbol(address)
alloc(mem, 1000)
createthread(mem)

mem:
  mov [address],64
  ret

[[[[[[[["ABCD.exe"+01099E60]+3754]+1100]+C5]+3]+CC0]+4]+740]+3C8:
address:
 
 
[DISABLE]
dealloc(mem)
unregistersymbol(address)


"error in line 11 - (the pointer address)
This instruction can't be compiled"

is it necessary to put "writeBytes" at the beginning of the pointer and what you want to edit at the end of the pointer, like this

Code:
writeBytes"ABCD.exe+01099E60]+3754]+1100]+C5]+3]+CC0]+4]+740]+3C8,FFF FF FF FF"


or like this:
Code:
[[[[[[[["ABCD.exe+01099E60]+3754]+1100]+C5]+3]+CC0]+4]+740]+3C8"
address:
FF FF FF FF FF FF


Thanks for the help
Back to top
View user's profile Send private message
Filipe_Br
Master Cheater
Reputation: 3

Joined: 07 Jan 2016
Posts: 272
Location: My house

PostPosted: Tue Mar 21, 2017 12:30 pm    Post subject: Re: How does one use a multi-level pointer in a script? Reply with quote

You asked for Auto Assembly script, and an error occurred because the address obviously does not exist, you would have to replace it with an address that works.
_________________
...
Back to top
View user's profile Send private message
CPUzX
Cheater
Reputation: 0

Joined: 10 Oct 2015
Posts: 38

PostPosted: Tue Mar 21, 2017 6:39 pm    Post subject: Re: How does one use a multi-level pointer in a script? Reply with quote

Filipe_Br wrote:
You asked for Auto Assembly script, and an error occurred because the address obviously does not exist, you would have to replace it with an address that works.


sorry for the mistake, but is it possible to reference a pointer address as the source instead of an AOB address?

The reason I ask is due to the fact this game changes the 16 byte row every time the game is reset, but the pointer remains each time the game is reset.

If I were to rephrase the question, may I ask how it's possible to assign a pointer as the address to the array of bytes destined to be modified (in a toggle box)?

The 16 byte row does change each time the game is reset, but the pointer is always intact. I'd like to be able to use a script to null the bytes to
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF as a pointer address, if possible
Back to top
View user's profile Send private message
Filipe_Br
Master Cheater
Reputation: 3

Joined: 07 Jan 2016
Posts: 272
Location: My house

PostPosted: Tue Mar 21, 2017 7:27 pm    Post subject: Re: How does one use a multi-level pointer in a script? Reply with quote

Explain better.
[/code]

_________________
...
Back to top
View user's profile Send private message
CPUzX
Cheater
Reputation: 0

Joined: 10 Oct 2015
Posts: 38

PostPosted: Tue Mar 21, 2017 9:31 pm    Post subject: Re: How does one use a multi-level pointer in a script? Reply with quote

Filipe_Br wrote:
Explain better.
[/code]


Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Wed Mar 22, 2017 12:05 am    Post subject: This post has 1 review(s) Reply with quote

Code:
[ENABLE]

alloc(newmem,32)
registersymbol(newmem)

newmem:
readmem([[[[[[[["DBXV2.exe"+01099E70]+3698]+1800]+C0]+8]+CC0]+8]+240]+2C8,16)

[[[[[[[["DBXV2.exe"+01099E70]+3698]+1800]+C0]+8]+CC0]+8]+240]+2C8:
db FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

[DISABLE]

dealloc(newmem)
[[[[[[[["DBXV2.exe"+01099E70]+3698]+1800]+C0]+8]+CC0]+8]+240]+2C8:
readmem(newmem,16)
Back to top
View user's profile Send private message
CPUzX
Cheater
Reputation: 0

Joined: 10 Oct 2015
Posts: 38

PostPosted: Wed Mar 22, 2017 12:39 am    Post subject: Reply with quote

++METHOS wrote:
Code:
[ENABLE]

alloc(newmem,32)
registersymbol(newmem)

newmem:
readmem([[[[[[[["DBXV2.exe"+01099E70]+3698]+1800]+C0]+8]+CC0]+8]+240]+2C8,16)

[[[[[[[["DBXV2.exe"+01099E70]+3698]+1800]+C0]+8]+CC0]+8]+240]+2C8:
db FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

[DISABLE]

dealloc(newmem)
[[[[[[[["DBXV2.exe"+01099E70]+3698]+1800]+C0]+8]+CC0]+8]+240]+2C8:
readmem(newmem,16)

Thanks,
IT WORKS.
This is awesome!
Much appreciated!
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Wed Mar 22, 2017 9:59 am    Post subject: Reply with quote

It is an AA script, not a Lua script...but the same can be done with Lua, probably.
Back to top
View user's profile Send private message
CPUzX
Cheater
Reputation: 0

Joined: 10 Oct 2015
Posts: 38

PostPosted: Wed Mar 22, 2017 9:52 pm    Post subject: Reply with quote

++METHOS wrote:
It is an AA script, not a Lua script...but the same can be done with Lua, probably.

Thanks for the clarification on that.
I didn't know there was a difference, but from now on I'll keep that in mind and use this knowledge to achieve other projects in the future.

It does seem easier to make an individual AA script for each mod and then afterwards incorporate them all into a trainer at the end (for an uninformed scrub like myself), so thanks!
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