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 


Highlight a specific register

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting -> Lua Extensions
View previous topic :: View next topic  
Author Message
STN
I post too much
Reputation: 33

Joined: 09 Nov 2005
Posts: 2517

PostPosted: Fri Apr 28, 2017 7:45 pm    Post subject: Highlight a specific register Reply with quote

Thank you Dark Byte Cool

Just bring up lua engine and paste this in, replace rax/eax with register you wish to highlight.
Code:
function f(sender, address, LastDisassembleData, result, description)
  LastDisassembleData.opcode=string.upper(LastDisassembleData.opcode)
  LastDisassembleData.parameters=string.upper(LastDisassembleData.parameters)
  LastDisassembleData.parameters=string.gsub(LastDisassembleData.parameters,'RAX',string.format('{C%.06x}RAX{N}',math.floor(math.random()*0xffffff)))
  LastDisassembleData.parameters=string.gsub(LastDisassembleData.parameters,'EAX',string.format('{C%.07x}EAX{N}',math.floor(math.random()*0xffffff)))

  return result,description
end

getVisibleDisassembler().OnPostDisassemble=f


I am going to start learning lua and make a menu as an exercise, should be fun.

If you don't know what this is, this image explains it. Ollydbg has this feature where you could focus on one register for quicker reading of the code, now it is in CE too except much better Very Happy


_________________
Cheat Requests/Tables- Fearless Cheat Engine
http://fearlessrevolution.com
Back to top
View user's profile Send private message
FreeER
Master Cheater
Reputation: 10

Joined: 09 Aug 2013
Posts: 306

PostPosted: Sun Aug 06, 2017 6:19 am    Post subject: Reply with quote

Here's my implementation of this: https://www.dropbox.com/s/g4js2feemqssaim/DisassemblerHighlight.lua?dl=0

It adds a menu option to all memory viewer windows, the highlight is currently global not local to each window.

If you want a static color instead of random ones then inside the .lua file you'll see this line
Code:
--local staticColor = 0xAE33AE


simply uncomment it and set it to whatever color value you like (packed RGB color in little endian format so BGR, and before anyone complains that's how CE has the values, not how I necessarily chose to do it and I just didn't do anything to make it match previously set expectations of how color should work).

edit: September 1, 2017 - update for memory record paste bug.


Last edited by FreeER on Thu Sep 14, 2017 10:47 am; edited 1 time in total
Back to top
View user's profile Send private message
FreeER
Master Cheater
Reputation: 10

Joined: 09 Aug 2013
Posts: 306

PostPosted: Thu Sep 14, 2017 10:47 am    Post subject: Reply with quote

fixed a bug in my script that didn't use lowercase and changed lua pattern check from characters to alphanumeric. So previously using "1C" to highlight a specific offset/value would cause an error, now it won't. Dropbox so same url, just redownload.
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 -> Lua Extensions 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