Skip to content

Latest commit

 

History

38 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NOTES:

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:

MonoDomain class

Represents the root Mono runtime domain, accessible via the domain global.

Methods

Method Return Description
GetAssemblies() { MonoAssembly } Returns all loaded assemblies.
GetObjects() { MonoObject } Returns all instantiated objects.

Usage example:

for _, asm in domain:GetAssemblies() do
    print(asm)
end

for _, obj in domain:GetObjects() do
    print(obj)
end

MonoAssembly class

Represents a loaded MonoAssembly within the domain.

Properties

Property Type Description
Image MonoImage The assembly's image.
Name string The assembly's name.

MonoImage class

Represents a loaded MonoImage from an assembly.

Properties

Property Type Description
Name string The image's name.

Methods

Method Return Description
GetClasses() { MonoClass } Returns all classes in the image.
FindFirstClass(name: string) MonoClass | nil Finds a class by name (alias: FindFirstChild).

MonoClass class

Represents a loaded MonoClass from a MonoImage.

Properties

Property Type Description
Namespace string The class' namespace.
Name string The class' name.
Parent MonoClass | nil The class' parent.

Methods

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.

MonoMethod class

Represents a MonoMethod within a class.

Properties

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.

Methods

Method Return Description
(...: any) any Calls the method with the provided arguments.

Usage example:

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

MonoObject class

Represents an instantiated MonoObject.

Properties

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).

Methods

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).

MonoClassField class

Represents a field in a MonoClass.

Properties

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.

MonoProperty class

Represents a property in a MonoClass.

Properties

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.

MonoConnection class

Represents a connection to a UnityEvent.

Methods

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

About

A luau wrapper tool around Unity games which use the Mono runtime.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages