Resource Injection

This page will cover resource injection. Resource injection allows you to execute in the context of a legitimate resource, allowing you to access their global functions and data, this includes things like their TriggerServerEvent function, allowing you to potentially bypass event tokenization, depending on the anti-cheat. The resource name can be found by navigating to our Resources tab, or you can always choose "any".

APIs

These are the APIs exposed to the user.

MachoInjectResource([string] resource, [string] code) -> void

This will inject your code into the resource requested, keep in mind you will not have any of your existing data, functions, etc. You will not be able to access Macho's exposed APIs, as you will no longer be running in our isolated environment. If you are unsure how to use this API, you should generally use MachoInjectResource2 with type 3 to avoid detections.

Example:
MachoInjectResource("any", [[ print("Hello World!") ]])

MachoIsolatedInject([string] code) -> void

This will execute code from a given string in our isolated environment. You can use this to MachoWebRequest and execute it.

MachoResourceInjectable([string] resource) -> bool

Returns true or false, depending on whether the resource exists, and can be injected into.

MachoResourceStop([string] resource) -> void

This will macho-stop a resource as you can do in the menu. This is intentionally documented poorly.

MachoResourceStart([string] resource) -> void

This will start a macho-stopped resource.

Thread Injection

These provide more advanced options for resource injection, and are generally recommended over our legacy MachoInjectResource

MachoInjectResource2(type, resource, code) -> void

This is similar to our original API but provides different types of injection versus the regular thread creation injection. If you are not sure which to use, you should generally opt for type 3.

  • Type 0: Run as a new thread with the injected Macho table.
  • Type 1: Run as a new thread.
  • Type 2: Run as an existing thread with the injected Macho table.
  • Type 3: Run as an existing thread.

MachoInjectThread(type, resource, file, code) -> void

This allows you to run as an existing thread, but you can decide exactly which thread to inject into. `file` is a sub-string search on the existing resource's threads for their thread name (shown as Thread Name in our Resources view). This will allow you to access thread locals and other variables in an existing threads context. `type` should always be zero.