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 


array of bytes length change

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

Joined: 13 May 2017
Posts: 1

PostPosted: Sat May 13, 2017 2:48 am    Post subject: array of bytes length change Reply with quote

hey there,
is it possible to somehow make the length of an array shown in the cheat table change to some symbol/address
for example instead of putting 10 in length, is it possible to put [symbol] somehow?
Thanks.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 74

Joined: 29 Oct 2010
Posts: 3601

PostPosted: Sat May 13, 2017 10:04 am    Post subject: Reply with quote

What are you hoping to accomplish with this? I assume that what you are really asking is if it is possible to have user input option for trainer users that will allow them to define the length of the array on-the-fly?
Back to top
View user's profile Send private message
Questions
How do I cheat?
Reputation: 0

Joined: 13 May 2017
Posts: 1

PostPosted: Sat May 13, 2017 10:29 am    Post subject: Reply with quote

++METHOS wrote:
What are you hoping to accomplish with this? I assume that what you are really asking is if it is possible to have user input option for trainer users that will allow them to define the length of the array on-the-fly?

actually not really,
it's just an array that keeps changing
i have a symbol for its size so i want my table to show the array at the exact size.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 74

Joined: 29 Oct 2010
Posts: 3601

PostPosted: Sat May 13, 2017 12:34 pm    Post subject: Reply with quote

But how can you know what size it will be if it is always changing? Unless you can incorporate some kind of check against certain bytes, I do not see how this will be possible.

That said, I am still not quite sure about the why of it all. You may be able to write something up using Lua. I would just use injection and write a script that uses readmem and just keep whatever additional bytes there are.
Back to top
View user's profile Send private message
FreeER
Expert Cheater
Reputation: 6

Joined: 09 Aug 2013
Posts: 116

PostPosted: Sat May 13, 2017 12:39 pm    Post subject: Reply with quote

++METHOS wrote:
But how can you know what size it will be if it is always changing?
Questions wrote:
i have a symbol for its size so i want my table to show the array at the exact size.


Seems fairly obvious to me that the size is stored in memory (perhaps before or after the array like some strings) and Questions has set a symbol at that address and is hoping for a way to get CE to dereference that memory and see what the length is (or it could have been registered in lua so the symbol is literally the length... can't be sure but I'd guess the first without further info).

I asked something similar with strings/text in the address list recently and didn't get any definitive answer...

edit: though now that I think about it you could probably use lua to create a timer and update the length... just seems like something that should exist already Smile
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 74

Joined: 29 Oct 2010
Posts: 3601

PostPosted: Sat May 13, 2017 6:36 pm    Post subject: Reply with quote

FreeER wrote:
Seems fairly obvious to me that the size is stored in memory
-Maybe it is, maybe it isn't. We do not even know what he is doing or what kind of data he is handling. It's easy to say that something is obvious, but actually providing a solution for it may not be. Anyway, you quoted only part of my comment without mentioning the part about including a check.

Anyway, the part about it being impossible was a poor choice of words. That is what happens when you respond to technical stuff just after waking up. Very Happy
Back to top
View user's profile Send private message
FreeER
Expert Cheater
Reputation: 6

Joined: 09 Aug 2013
Posts: 116

PostPosted: Sat May 13, 2017 7:12 pm    Post subject: Reply with quote

The part about the check was irrelevant to what I was commenting about so I didn't include it Smile

Based on everything provided the most logical conclusion is that it is in memory so unless it takes a lot of time for you to figure out the answer/solution based on that assumption it'd probably save time for everyone if you made that assumption and give that answer, and if it does take a lot of time then it'd still probably save time for you ask if that's the scenario they're asking about since they may not know how to phrase it on their own. If you're wrong then they'll correct you, but if you simply ignore it then you're wasting time trying to get them to figure out the magic words when you could provide them yourself...

a lua script like this should work if that's the case:

Code:
{$lua}
[ENABLE]
if syntaxcheck then return end
al = getAddressList()
stringRecord = al.getMemoryRecordByID(1) -- address as a string
aobRecord = al.getMemoryRecordByID(3) -- address as an aob
script = al.getMemoryRecordByID(2) -- this script to enable/disable updating

timer = createTimer()
timer.Interval = 1000 -- run every 1000 milliseconds / 1 second
timer.onTimer = function(timer)
  if not script.Active then  timer.destroy() end

  length = readInteger("length") -- "length" is a registered symbol in memory of the length

  stringRecord.String.Size = length -- .Type will be vtString
  aobRecord.Aob.Size = length -- .Type will be vtByteArray

  --print("Updated length to " .. tostring(length))
end
[DISABLE]


If the symbol held the actual length (eg. it was created with something like registerSymbol("length", 786)) then you'd use getAddress("length") instead of readInteger("length"). Tested with the text of the 6.6 tutorial at 0059D5CC / "Tutorial-i386.exe"+19D5CC (note: that's the address of length, text starts at +4) by manually changing the size.

++METHOS wrote:
That is what happens when you respond to technical stuff just after waking up. Very Happy
Or just before going to sleep as is often the case with me lol
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 74

Joined: 29 Oct 2010
Posts: 3601

PostPosted: Sun May 14, 2017 2:58 am    Post subject: Reply with quote

FreeER wrote:
++METHOS wrote:
That is what happens when you respond to technical stuff just after waking up. Very Happy
Or just before going to sleep as is often the case with me lol
-Which is where I am at now. Ugh...long day.
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 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