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 


Change description/value of a node in structure dissect

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

Joined: 17 Aug 2020
Posts: 166
Location: Milkey Way

PostPosted: Sat Aug 14, 2021 3:18 am    Post subject: Change description/value of a node in structure dissect Reply with quote

How can I change the description/value of selected item/node in tvStructureView of Structure Dissect Form using lua?

I cannot access its Caption/Text like i could do if it were TListView type rather than TTreeView.
Back to top
View user's profile Send private message
Skyrimfus
Cheater
Reputation: 1

Joined: 17 Mar 2016
Posts: 42

PostPosted: Sat Aug 14, 2021 4:55 am    Post subject: Reply with quote

Code:

form.mainStruct.Element[0].Name = "Description"
form.mainStruct.Element[0].VarType = vtByte
Back to top
View user's profile Send private message
MMM-304
Expert Cheater
Reputation: 0

Joined: 17 Aug 2020
Posts: 166
Location: Milkey Way

PostPosted: Sat Aug 14, 2021 6:32 am    Post subject: Reply with quote

I meant selected entry that is most probably gonna be in pointers as child elements. (in higher levels)

and also i want to change values not vartype
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25288
Location: The netherlands

PostPosted: Sat Aug 14, 2021 6:53 am    Post subject: Reply with quote

Code:

form=enumStructureForms()[1] --or whatever you use
entry=form.tvStructureView.Selected
struct=integerToUserData(entry.Parent.Data)
structelement=struct.Element[entry.Index]
structelement.Name="This element"

--get address
offsetlist={}

while entry.Parent do
  table.insert(offsetlist,1,structelement.Offset)
  entry=entry.Parent
  if entry.Parent then
    struct=integerToUserData(entry.Parent.Data)
    structelement=struct.Element[entry.Index]
  end
end

for i=0,form.ColumnCount-1 do
  if form.Column[i].Focused then
    local address=form.Column[i].Address+offsetlist[1]
    for j=2,#offsetlist do
      address=readPointer(address)+offsetlist[j]
    end
    printf("Address=%x",address)
    return
  end

  print("No focused column found")
end

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
MMM-304
Expert Cheater
Reputation: 0

Joined: 17 Aug 2020
Posts: 166
Location: Milkey Way

PostPosted: Sat Aug 14, 2021 8:10 am    Post subject: Reply with quote

Thanks a lot. Wasnt aware of this part:

Code:
struct=integerToUserData(entry.Parent.Data)
structelement=struct.Element[entry.Index]


would be so good if just .Selected gives you the data.
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