ComputerCraft: Top Level Coroutine Override

A top-level coroutine override is a way of unlocking full access to a ComputerCraft computer via running a file outside of the main confines of the bios. There are 2 methods for a Top-Level Coroutine Override.

Method 1: NeverCast

ComputerCraft forum user NeverCast was one of the first to release a TLCO.

Their method is:

This method is very long, so see the PoC here.



Due to the cons, about a year later, a new TLCO was released, using a new method…

Method 2: ElvishJerriccco

ComputerCraft forum user ElvishJerriccco released a 6-line TLCO that simply used a different entrypoint. Instead of using os.shutdown as a code entrypoint to run the arbitrary file as top level, ElvishJerriccco used printError, a function called when either the shell or the rednet subroutine errored.

The shortest form of this method is as such:

local p = _G.printError
function _G.printError()
        _G.printError = p{}, "n")

By queueing a modem_message event with no parameters, the rednet subroutine is crashed. With that taken care of, printError is overwritten to run an arbitrary file. When the BIOS reaches the call to printError, the arbitrary file is ran.



go home