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 Bookmarks using Lua

 
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: 170
Location: Milkey Way

PostPosted: Tue Sep 01, 2020 9:45 am    Post subject: Change Bookmarks using Lua Reply with quote

I need help with this!

When we set a bookmark in Dissassembler Form, it cahnges the caption which can be accessed as:

Code:
a = getMemoryViewForm().MenuItem23
for i=0,a.Count-1 do
    b = a.Item[i].Caption
    c = b:find(':')
    if c then
       d = b:sub(c+2,b:len())
       print(d)
    end
end


but if we try to change the bookmark Caption like this:

Code:
a = getMemoryViewForm().MenuItem23
b = a.Item[0].Caption
print(b)
a.Item[0].Caption = 'Bookmark 0: Tutorial-x86_64.exe+2BAA'

It does not effect the actual bookmark location. in fact in MenuItem24 which is Goto bookmarks the Caption remains the same (old one)

It means that the real bookmark location is not dependent on the Caption.

What I want to ask is how can I get the real BM location and change it using Lua instead of Set/Unset Bookmark
Back to top
View user's profile Send private message
MMM-304
Expert Cheater
Reputation: 0

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

PostPosted: Wed Sep 02, 2020 11:31 am    Post subject: Reply with quote

@Dark Byte Please help
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 472

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

PostPosted: Wed Sep 02, 2020 2:00 pm    Post subject: Reply with quote

it's not exported
but you can use this code to set bookmark 0 (same for the other ones)
Code:

local mv=getMemoryViewForm()
local oldaddress=mv.DisassemblerView.SelectedAddress
local oldtop=mv.DisassemblerView.TopAddress
mv.DisassemblerView.SelectedAddress=0x12345678
getMemoryViewForm().miSetBookmark0.DoClick()
mv.DisassemblerView.TopAddress=oldtop
mv.DisassemblerView.SelectedAddress=oldaddress


to get the address, try parsing the caption

_________________
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: 170
Location: Milkey Way

PostPosted: Wed Sep 02, 2020 8:22 pm    Post subject: Reply with quote

but its not using module addresses its just using normal addresses. How can I make

Code:
mv.DisassemblerView.SelectedAddress=0x12345678

to
Code:
mv.DisassemblerView.SelectedAddress='module+offset'
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 472

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

PostPosted: Wed Sep 02, 2020 11:28 pm    Post subject: Reply with quote

use getAddress
_________________
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: 170
Location: Milkey Way

PostPosted: Thu Sep 03, 2020 1:51 am    Post subject: Reply with quote

u mean like this
Code:
local mv=getMemoryViewForm()
local oldaddress=mv.DisassemblerView.SelectedAddress2
local oldtop=mv.DisassemblerView.TopAddress
a = getAddress(oldaddress)
print(oldaddress)
print(a)


didnt work.it prints the same (without module+offset)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 472

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

PostPosted: Thu Sep 03, 2020 2:00 am    Post subject: Reply with quote

if you want to print out the address in string format use getNameFromAddress
_________________
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: 170
Location: Milkey Way

PostPosted: Thu Sep 03, 2020 4:12 am    Post subject: Reply with quote

Thank u Dark Byte. ill work with this and hopefully there will be no problem
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