View previous topic :: View next topic |
Author |
Message |
Skyrimfus Cheater Reputation: 1
Joined: 17 Mar 2016 Posts: 42
|
Posted: Mon Aug 09, 2021 9:17 am Post subject: get all user-defined comments |
|
|
is there a function that gets all user-defined comments?
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Mon Aug 09, 2021 10:51 am Post subject: |
|
|
Ctrl + Spacebar in the Lua Engine window.
|
|
Back to top |
|
|
Skyrimfus Cheater Reputation: 1
Joined: 17 Mar 2016 Posts: 42
|
Posted: Mon Aug 09, 2021 1:37 pm Post subject: |
|
|
LeFiXER wrote: | Ctrl + Spacebar in the Lua Engine window. |
that just shows all the functions and variables/objects. I am asking if there is a way to get all the comments that are shown in the disassembler(but only the comments that the user typed, either manually[CTRL+ENTER] or by using setComment())
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Mon Aug 09, 2021 2:12 pm Post subject: |
|
|
It wasn't entirely clear what you were asking but that makes more sense. Unfortunately, I can't say if it's possible or not because it is beyond the scope of my knowledge, sorry.
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 140
Joined: 06 Jul 2014 Posts: 4289
|
Posted: Mon Aug 09, 2021 3:03 pm Post subject: |
|
|
No easy way of doing that right now with Lua.
If you're fine with parsing xml, the disassembler comments are saved in the cheat table file.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8517 Location: 127.0.0.1
|
Posted: Mon Aug 09, 2021 3:48 pm Post subject: |
|
|
Definitely not an ideal situation to do it but these are available:
- getComment(address)
- getHeader(address)
You can walk every available address in the process and check for a comment. (This will be incredibly slow though.)
The Dissassembler class also exposes a table of information per data block that you can walk to pull the comments from, see here:
Code: |
Disassembler Class (Inheritance: Object)
createDisassembler() - Creates a disassembler object that can be used to disassemble an instruction and at the same time get more data
getDefaultDisassembler() - Returns the default disassembler object used by a lot of ce's disassembler routines
getVisibleDisassembler() - Returns the disassembler used by the disassemblerview. Special codes are: {H}=Hex value {R}=Register {S}=Symbol {N}=Nothing special {C######}=RGB color , {B######}=Background RGB color were ###### is 0xBBGGRR
registerGlobalDisassembleOverride(function(sender: Disassembler, address: integer, LastDisassembleData: Table): opcode, description): Same as Disassembler.OnDisassembleOverride, but does it for all disassemblers, including newly created ones. Tip: Check the sender to see if you should use syntax highlighting codes or not
This function returns an ID you can pass on to unregisterGlobalDisassembleOverride() 6.4+
unregisterGlobalDisassembleOverride(id)
properties
LastDisassembleData : Table
OnDisassembleOverride: function(sender: Disassembler, address: integer, LastDisassembleData: Table): opcode, description
OnPostDisassemble: function(sender: Disassembler, address: integer, LastDisassembleData: Table, result: string, description: string): result, description
syntaxhighlighting: boolean : This property is set if the syntax highlighting codes are accepted or not
Methods
disassemble(address): Disassembles the given instruction and returns the opcode. It also fills in a LastDisassembleData record
decodeLastParametersToString() : Returns the unedited "Comments" information. Does not display userdefined comments
getLastDisassembleData() : Returns the LastDisassembleData table.
The table is build-up as follow:
address: integer - The address that was disassembled
opcode: string - The opcode without parameters
parameters: string - The parameters
description: string - The description of this opcode
commentsoverride: string - If set, this will be the comments/LastParamatersToString result
bytes: table - A table containing the bytes this instruction consists of (1.. )
modrmValueType: DisAssemblerValueType - Defines the type of the modrmValue field (dvtNone=0, dvtAddress=1, dvtValue=2)
modrmValue: Integer - The value that the modrm specified. modrmValueType defines what kind of value
parameterValueType: DisAssemblerValueType
parameterValue: Integer - The value that the parameter part specified
isJump: boolean - Set to true if the disassembled instruction can change the EIP/RIP (not ret)
isCall: boolean - Set to true if it's a Call
isRet: boolean - Set to true if it's a Ret
isConditionalJump: boolean - Set to true if it's a conditional jump
|
For the time being, the XML parsing method ParkourPenguin recommended would be the fastest.
This is something you could request Dark Byte add a Lua call for though to return a table of addresses/comments in the future.
_________________
- Retired. |
|
Back to top |
|
|
Skyrimfus Cheater Reputation: 1
Joined: 17 Mar 2016 Posts: 42
|
Posted: Tue Aug 10, 2021 6:39 am Post subject: |
|
|
Ok, thanks. I recompiled the CE from source and added the function myself
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Tue Aug 10, 2021 6:46 am Post subject: |
|
|
Care to share?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Tue Aug 10, 2021 7:16 am Post subject: |
|
|
Code: |
function getDisassemblerComments()
local results={}
local ss=createStringStream()
saveTable(ss)
local xp=require("xmlSimple").newParser()
local parsed=xp:ParseXmlText(ss.DataString)
if parsed and parsed.CheatTable.DisassemblerComments then
for i=1,parsed.CheatTable.DisassemblerComments:numChildren() do
local ce=parsed.CheatTable.DisassemblerComments:children()[i]
local e={}
e.Address=getAddressSafe(ce.Address:value())
if ce.Comment then
e.Comment=ce.Comment:value()
end
if ce.Header then
e.Header=ce.Header:value()
end
table.insert(results,e)
end
else
results=nil
end
ss.destroy()
return results
end
|
this will return an indexed array containing Address and Comment and/or Header fields
_________________
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 |
|
|
Skyrimfus Cheater Reputation: 1
Joined: 17 Mar 2016 Posts: 42
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Thu Aug 12, 2021 7:21 am Post subject: |
|
|
Thanks! Have to love communal projects.
|
|
Back to top |
|
|
|