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 


Mono-aware disassembly?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
jgoemat
Expert Cheater
Reputation: 18

Joined: 25 Sep 2011
Posts: 195

PostPosted: Sat Apr 14, 2018 11:04 pm    Post subject: Mono-aware disassembly? Reply with quote

I was thinking it would be nice to have the disassembler put field names in comments if mono is enabled. I tried to hook in with onPostDisassemble

Code:
dd = getVisibleDisassembler()
print("Syntax highlighting? "..tostring(dd.syntaxhighlighting))

function onPostDisasemble(sender, address, LastDisassembleData, result, description)
-- sender: Disassembler
-- address: integer
-- LastDisassembleData: Table
-- result: string
-- description: string
-- returns result, description
  print("Disasemble post at "..string.format("%X", address))
  return result, description
end

dd.OnPostDisassemble = onPostDisassemble
dd_data = dd.getLastDisassembleData()
print("Last Disassembled Address: "..string.format("%X", dd_data.address))
return dd_data


But I never see it print anything and the last disassembled address does change if I scroll a bit in the disassembly window. I've tried to use registerGlobalDisassembleOverride and it does get called, but it keeps getting called over and over for the same visible bytes and the disassembly windows just show "00" for bytes. Same for getVisibleDisassembler().OnDisassembleOverride:

Code:
getVisibleDisassembler().OnDisassembleOverride = function(sender, address, data)
  print(string.format("Disassembling %X", address))
  return "opcode", "description"
end



I'm assuming that is the right way to return "opcode, description" and that those would just appear in the opcode and comments columns in the disassembly window... How am I using these wrong?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 352

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

PostPosted: Sun Apr 15, 2018 12:44 am    Post subject: Reply with quote

onPostDisassemble needs to return opcode and description, and the LastDisassembleData field is also used

check out http://forum.cheatengine.org/viewtopic.php?t=604314

it doesn't let you change the comments part though, but perhaps you can use the disassemblerlines OnExtraLineRender override to write some info.

Or I guess you could place the extra data after the LastDisassembleData.parameters info

(I'll add a comments override for next version)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
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