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 


Need example for "dbvm_watch_writes"

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
GH*master
Expert Cheater
Reputation: 8

Joined: 10 Jan 2008
Posts: 159

PostPosted: Wed Jan 15, 2020 5:47 am    Post subject: Need example for "dbvm_watch_writes" Reply with quote

Hello! Can you help me to make an example about dbvm_watch_writes for memory region?

This my script throw two errors.
1) Check Init DBVM (I can do it manually in a different way)
2) Call dbvm_watch_writes - throw error in Lua console

Code:

-- Tutorial-x86_64.exe+2B3A9 - 81 BB F0070000 E8030000 - cmp [rbx+000007F0],000003E8 { 1000 }

local addressStructure = 0x00322000
local sizeStrucure = 0x1000

if dbkInited == nil or not dbkInited then
  dbkInited = dbk_initialize()
  if not dbkInited then
     print("Can't load DBK")
     return
  end
end

string.format('Start watching address: = %016X  size: %X', addressStructure, sizeStrucure)

--local physicalAddress = dbk_getPhysicalAddress(addressStructure)
local CR3 = dbk_getCR3()
local physicalAddress = getPhysicalAddressCR3(CR3, addressStructure)
--To watch for structure
IDscanner = dbvm_watch_writes(physicalAddress, sizeStrucure)

function PrintResult(IDscanner)
   data = dbvm_watch_retrievelog(IDscanner)

   if data == nil then
     print('Inforamtion: Data nil')
    return
   end

   if #data <= 0 then
     print('Inforamtion: #data <= 0')
    return
   end

   --print(string.format('RIP = %016X',data.RIP))
   for i=1,#data do
     print(disassemble(data.RIP))
   end
   dbvm_watch_disable(IDscanner)
end

tmer = createTimer(nil, false)
tmer.OnTimer = function(timer)
  print "Stop Timer"
  PrintResult(IDscanner)
end
tmer.Interval = 20000
tmer.Enabled = true
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Wed Jan 15, 2020 6:12 am    Post subject: Reply with quote

what is the error you get ? (Access violation? If so, DBVM wasn't loaded)

anyhow, dbvm_initialize(true) will load DBVM if it's not yet loaded

dbk_getPhysicalAddress(addressStructure) should return the same result as the getPhysicalAddressCR3 method


is IDScanner a negative value on return ?

_________________
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
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