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 


How to print register value when the instruction is accessed

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

Joined: 28 Aug 2021
Posts: 2

PostPosted: Sun Aug 29, 2021 5:06 am    Post subject: How to print register value when the instruction is accessed Reply with quote

How to print register value whenever the instruction is being accessed

*Attached picture*
So in this memory location at this instruction R11 register holds an address that holds a string value,
I want to print that string value into lua console whenever that instruction is being accessed.
I have just started learning lua so simple answers will be appreciated, thanks.



AfmF9D.PNG
 Description:
 Filesize:  19.66 KB
 Viewed:  2513 Time(s)

AfmF9D.PNG


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: Sun Aug 29, 2021 6:31 am    Post subject: Reply with quote

2 approaches for this

1: code injection
do a normal code injection and in the newmem part have something like:
Code:

{$luacode svalue=R11}
print(readString(svalue))
{$asm}


2: breakpoints
Code:

debug_setBreakpoint(0x7ff62590b205,function()
  print(readString(R11))
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
Rofevil
How do I cheat?
Reputation: 0

Joined: 28 Aug 2021
Posts: 2

PostPosted: Sun Aug 29, 2021 7:14 am    Post subject: Reply with quote

Thanks, second approach worked
_________________
undefined
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