Difference between revisions of "Mono:Mono Lua"

From Cheat Engine
Jump to navigation Jump to search
m (Main Methods)
Line 114: Line 114:
:combination of '''mono_method_getHeader''' and '''mono_methodheader_getILCode'''
:combination of '''mono_method_getHeader''' and '''mono_methodheader_getILCode'''
;mono_iamge_rva_map(''imageId, offset'')
:?? not sure what this is ??
* https://github.com/mono/mono/tree/master/mono/dis
* mono_metadata_decode_row
==== Cheat Engine Hooks ====
==== Cheat Engine Hooks ====

Revision as of 06:43, 19 April 2015

The advanced MONO features of Cheat Engine are controlled by the "monoscript.lua" script in the autorun directory where cheat engine is installed. When you attach to a process, the script scans for "mono.dll". If it is found, the appropriate MonoDataDissector dll from the autorun directory is injected into the process which creates a named pipe waiting for a connection. The LUA code then connects to the pipe and messages are exchanged to perform the mono functions.

Main Methods

this is some
varType = monoTypeToVarType(monoType)
Returns the Cheat Engine type (vtString, vtByte, vtWorkd, vtDword, vtSingle, vtDouble, vtPointer) for the given mono type
result = LaunchMonoDataCollector()
injects the dll and returns 0 for failure, or monoBase returned from the CMD_INITMONO command on the pipe
returns classId, className of the class at the given address in memory
returns a table array of domainaddress for each domain in the game
returns ? (result of MONOCMD_SETCURRENTDOMAIN)
sets the domain the MonoDataCollector will use
returns table of assemblyId for each assembly in the current domain from the MonoDataCollector
returns the imageId for the passed assembly
returns the name of the assembly with the given imageId
returns a table of classId for classes in the given assembly image
returns the class name as a string
returns the namespace of the given class as a string
returns the classId of the parent class of the given class
mono_class_getStaticFieldAddress(domainId, classId)
returns the base address for a special area that stores static addresses for a given class. For example if you have a class that has 5 static fields, their offsets will be added to this base address to get the memory location
returns a table of field objects for fields in the given class
field - the field id
type - ?? the Cheat Engine type? (i.e. vtByte, vtWord, vtString, etc?)
monotype - ?? the mono type?
parent - ?? the class id?
offset - the offset in bytes from the structure base address
flags - ??
isStatic - true/false - if true, offset is into static address, use mono_class_getStaticFieldAddress
name - field name
typename - name of the type with namespace (i.e. "System.Int32")
returns a table of method objects for the methods in the given class
method - method id
name - string name of the method
returns a result object with the properties given the address of code in memory
method - the method id
code_start - address where method code begins
code_size - length of code in bytes
mono_image_findClass(imageId, namespace, className)
returns the classId of the given class name and namespace in an image
mono_findClass(namespace, className)
returns the classId of the given class name and namespace
mono_class_findMethod(classId, methodName)
returns the methodId of a certain method in a class
mono_findMethod(namespace, className, methodName)
returns the methodId of a certain method, calls mono_image_findClass and mono_class_findMethod
returns the name of a method given the id
returns a headerId??
returns result, parameternames, returntype
result - ?? string
parameterNames - table of strings representing parameter names
returnType - string?? - mono type string?
returns a string - ?? the IL code ??
returns the classId a method belongs in
JIT a method if it wasn't compiled yet (??return value address of assembly??)
(no return value) - only works on dynamic method, and only if profiler isn't being used
returns address, size
address - address of start of IL code?
size - size of IL code?
combination of mono_method_getHeader and mono_methodheader_getILCode
mono_iamge_rva_map(imageId, offset)
?? not sure what this is ??


Cheat Engine Hooks

mono_structureDissectOverrideCallback(structure, baseaddress)
Called by CE when a structure is being dissected to fill in the values if we know the structure
Returns true if the structure members were defined, nil if not
Calls mono_object_findRealStartOfObject(baseaddress), mono_class_enumFields(classaddress), monoTypeToVarType(monotype)
Returns classname,currentaddress (the real base address) or nil
Called by CE when creating a new structure in the structure dissector
returns pointer or nil
called by CE when it is trying to find the address to go with a symbol
calls mono_findMethod and mono_compile_method
returns string
called by CE in the disassembly window to show a symbol name for the address
calls mono_getJitInfo(address), mono_method_getClass(method), mono_class_GetName(class), mono_class_GetNamespace(class), mono_method_getName(method)