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 register at this location (DBVM) & Lua

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

Joined: 03 Sep 2019
Posts: 8

PostPosted: Thu Jun 05, 2025 10:52 pm    Post subject: Change register at this location (DBVM) & Lua Reply with quote

hi, can anyone help me with changing register like RAX and CF flag like in the picture using Lua? i used to do it manually

open memory viewer->go to address->right click->Change register at this location->check the "Use DBVM Cloaked BP's" and change the register of RAX(or others) and set flag CF(PF or others)->click ok button.

and the address will highlight with green like breakpoint is set and the bytes changes to green.

i open the CE help-> Lua documentation and found few line of code i think like

dbvm_cloak_activate(physicalbase, virtualbase OPTIONAL):

dbvm_cloak_deactivate(physicalbase):

dbvm_cloak_readOriginal(physicalbase):

dbvm_cloak_writeOriginal(physicalbase, bytetable[4096]):

dbvm_changeregonbp(physicaladdress, changereginfo, virtualaddress OPTIONAL): boolean
sets a breakpoint at the given position. When a breakpoint hits the registers will be changed according to the changereginfo table
changereginfo table: (set the field to nil, or don't define it, if you don't want to change it)
newCF: integer/boolean (false=0, true=1)
newPF: integer/boolean (false=0, true=1)
newAF: integer/boolean (false=0, true=1)
newZF: integer/boolean (false=0, true=1)
newSF: integer/boolean (false=0, true=1)
newOF: integer/boolean (false=0, true=1)
newRAX: integer
newRBX: integer
newRCX: integer
newRDX: integer
newRSI: integer
newRDI: integer
newRBP: integer
newRSP: integer
newRIP: integer
newR8: integer
newR9: integer
newR10: integer
newR11: integer
newR12: integer
newR13: integer
newR14: integer
newR15: integer

dbvm_removechangeregonbp(physicaladdress) : Disables the changeregonbp breakpoint


i dont know how to apply it or use it.
whre can i find this physicalbase and physicaladdress
can anyone help me code this so i can active and deactivate by the cheat table please.



modrege.png
 Description:
 Filesize:  14.37 KB
 Viewed:  1427 Time(s)

modrege.png



onbp.PNG
 Description:
 Filesize:  70 KB
 Viewed:  1427 Time(s)

onbp.PNG


Back to top
View user's profile Send private message Send e-mail
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Fri Jun 06, 2025 1:33 pm    Post subject: Reply with quote

go to the address in the hexview part and it'll show you the physical address (or use dbk_getPhysicalAddress(address))


then
dbvm_changeregonbp(physicalAddress, {newRCX=300, newCF=1})

or if you want to show the region is cloaked:
dbvm_changeregonbp(physicalAddress, {newRCX=300, newCF=1}, virtualAddress)

virtualAddress would be something like the address of notepad.exe+7

_________________
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
Brookthesoul
How do I cheat?
Reputation: 0

Joined: 03 Sep 2019
Posts: 8

PostPosted: Fri Jun 06, 2025 8:37 pm    Post subject: Reply with quote

Dark Byte wrote:
go to the address in the hexview part and it'll show you the physical address (or use dbk_getPhysicalAddress(address))


then
dbvm_changeregonbp(physicalAddress, {newRCX=300, newCF=1})

or if you want to show the region is cloaked:
dbvm_changeregonbp(physicalAddress, {newRCX=300, newCF=1}, virtualAddress)

virtualAddress would be something like the address of notepad.exe+7


so i try do the script in auto assemble but i got an error. am i doing it wrong?

Code:

[ENABLE]
{$lua}
dbvm_changeregonbp(1BD59B007, {newRCX=300, }, NOTEPAD.EXE+7)

[DISABLE]
dbvm_removechangeregonbp(1BD59B007, {newRCX=300, }, NOTEPAD.EXE+7)



BA1.PNG
 Description:
 Filesize:  15.85 KB
 Viewed:  1236 Time(s)

BA1.PNG



error1.PNG
 Description:
 Filesize:  5.68 KB
 Viewed:  1236 Time(s)

error1.PNG


Back to top
View user's profile Send private message Send e-mail
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Sun Jun 08, 2025 3:19 am    Post subject: Reply with quote

hexadecimal numbers start with 0x

also you need to use getAddress to get the address of notepad.exe+7

_________________
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
Brookthesoul
How do I cheat?
Reputation: 0

Joined: 03 Sep 2019
Posts: 8

PostPosted: Sun Jun 08, 2025 6:14 am    Post subject: Reply with quote

Dark Byte wrote:
hexadecimal numbers start with 0x

also you need to use getAddress to get the address of notepad.exe+7



This is what i found when i search for lua getAddress.

Code:
function getAddress(AddressString, local OPTIONAL) : integer


Is this how you code it? i try it but it give me an error so can you show me how should i use the code please?

Code:

[ENABLE]
{$lua}
getAddress(NOTEPAD.EXE+7)
dbvm_changeregonbp(0xD77D0A7, {newRCX=300})
 
{$asm}
[DISABLE]
{$lua}
dbvm_removechangeregonbp(0xD77D0A7, {newRCX=300})



ok i try do some serach and i found string need to put between ("text") and it didn't give any error but how do get that address?

sorry, i edit this a few times. now i found how to make the value appeared by using the print(string.format()) and i manage to get the value by defining it

Code:
 
[ENABLE]
{$lua}
dbvm_changeregonbp(0x225956007, {newRCX=300}, 0x7FF66A7B0007)
{$asm}
//a=dbk_getPhysicalAddress("NOTEPAD.EXE+7") code for finding physical Address
//b=getAddress("NOTEPAD.EXE+7") code for finding Address
//print(string.format(a, b)) code to show the address in hex
[DISABLE]
{$lua}
dbvm_removechangeregonbp(0x225956007, {newRCX=300}, 0x7FF66A7B0007)


Thank you for your guidance and time, and sorry for my slow brain. but if the code above isn't good i am humbly asking for your guidance again. thanks again.

edit again:

I just discovered that you don't need to use the print code. just use the variable that already define Embarassed i'm so dumb.

Code:

dbvm_changeregonbp(a, {newRCX=300}, b)
Back to top
View user's profile Send private message Send e-mail
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