You are able to pass objects which inherit from something else and be fine. Example: you can call get_childCount from the "Transform" class on a "RectTransform" object, since "RectTransform" inherits from "Transform"; therefore, calling get_childCount(recttransform_obj) is fine.
Documentation regarding the usage in Luau:
Represents the root Mono runtime domain, accessible via the domain global.
Method
Return
Description
GetAssemblies()
{ MonoAssembly }
Returns all loaded assemblies.
GetObjects()
{ MonoObject }
Returns all instantiated objects .
for _ , asm in domain :GetAssemblies () do
print (asm )
end
for _ , obj in domain :GetObjects () do
print (obj )
end
Represents a loaded MonoAssembly within the domain.
Property
Type
Description
Image
MonoImage
The assembly's image.
Name
string
The assembly's name.
Represents a loaded MonoImage from an assembly.
Property
Type
Description
Name
string
The image's name.
Method
Return
Description
GetClasses()
{ MonoClass }
Returns all classes in the image.
FindFirstClass(name: string)
MonoClass | nil
Finds a class by name (alias: FindFirstChild).
Represents a loaded MonoClass from a MonoImage.
Property
Type
Description
Namespace
string
The class' namespace.
Name
string
The class' name.
Parent
MonoClass | nil
The class' parent.
Method
Return
Description
GetMethods(depth: number?)
{ MonoMethod }
Returns all methods of the class specified by the depth. Leave empty if you prefer the current.
GetAllMethods()
{ MonoMethod }
Returns all the methods from the hierarchy of this class, including itself.
GetFields(depth: number?)
{ MonoClassField }
Returns the static fields of the class specified by the depth. Leave empty if you prefer the current.
GetProperties(depth: number?)
{ MonoProperty }
Returns the static properties of the class specified by the depth. Leave empty if you prefer the current.
IsA(obj: MonoObject | MonoClass, namespace: string, class_name: string)
boolean
Returns whether the object is a descendant of the specified class and namespace.
GetTypeObject(obj: MonoClass)
MonoObject
Returns the class' System.Type object equivalent.
Represents a MonoMethod within a class.
Property
Type
Description
Name
string
The method's name.
Numparams
number
Number of parameters (self objects and generic parameters also count).
Paramtypes
{ string }
The parameter's types.
Generic
boolean
Whether the method is generic.
Static
boolean
Whether the method is static.
Class
MonoClass
The containing class.
Method
Return
Description
(...: any)
any
Calls the method with the provided arguments.
local class = domain :FindFirstAsm (" mscorlib" ).Image :FindFirstClass (" Version" )
local obj ;
for _ , method in class :GetMethods () do
if method .Name ~= " .ctor" or method .Numparams ~= 3 then continue end
obj = method (2 , 2 )
end
print (obj .Class .Name ) -- Output: Version
Represents an instantiated MonoObject .
Property
Type
Description
Class
MonoClass
The object's class.
Transform
MonoObject
The Transform component (if object is GameObject).
Children
{ MonoObject }
Child objects (if object is Transform).
Method
Return
Description
IsA(namespace: string, class_name: string)
boolean
Returns whether the object is a descendant of the specified class and namespace.
GetFields(depth: number?)
{ MonoClassField }
Returns the fields of the specified class of the object.
GetProperties(depth: number?)
{ MonoProperty }
Returns the properties of the specified class of the object.
Press()
nil
Presses the UI button .
Connect(callback: (...any) -> (...any) )
MonoConnection
Connects to a UnityEvent.
GetComponents()
{ MonoObject }
Returns all components of the object.
FindFirstChild(name: string)
MonoObject | nil
Finds a child Transform by name (if object is Transform).
Represents a field in a MonoClass.
Property
Type
Description
Value
any
The field's value (accessible only if :GetFields() was called from a MonoObject, or if the field is static ).
Type
string
The field's type.
Static
boolean
Whether the field is static.
Represents a property in a MonoClass.
Property
Type
Description
Value
any
The property's value (accessible only if :GetProperties() was called from a MonoObject, or if the property is static ).
Static
boolean
Whether the property is static.
Represents a connection to a UnityEvent.
Method
Return
Description
Disconnect()
nil
Disconnects the event.
Below is a video showing how you could use Monosploit in a game.
example_usage_video.mp4