BootExec
Execute code sent over the link port on a TI-83 Plus with a malfunctioning OS. The flash can be left in an unlocked state, allowing the program sent to perform some repairs to the calculator that are otherwise preventing you from installing an OS normally.
Overflow by Brandon Wilson
This program is heavily based on Overflow by Brandon Wilson, so I would strongly recommend taking a look at that for further information.
The basic technique exploited here is that the TI-83 Plus boot code does not bounds-check the length of the link packet we're sending it, so by sending a very large packet we can overflow the intended buffer right up to user memory, send over a program we wish to execute, and then overwrite the Z80 stack with the address of our program so that when the link routines return it executes our program rather than returning to the boot code.
Overflow satisfies this process by filling up the memory as described above, then sending some correcting data so that the checksum for the oversized packet is equal to zero, and then sending a constant stream of zeroes until the transfer fails. The last two bytes of a transfer are the checksum, and by previously correcting the packet's checksum to zero this means that the packet will be seen as valid.
At this point the transmitting calculator detects the link error and tries to read back the acknowledgement from the receiving calculator, and all should be well.
Unfortunately, the TI-83 Plus seems to be more fussy about how it handles linking errors and once the attempt to send too many zero bytes has failed it just displays an error message and switches off, rather than letting us receive the acknowledgement before executing our payload.
Looking at the documentation for Overflow it seems to have been intended more for the TI-84 Plus series calculators, so it could be that they are more forgiving of the linking errors.
Trial-and-error with zero padding
If the problem is that we're sending too many zero bytes, one option is to count how many zero bytes we can send successfully. Once the attempt has failed, we can then make sure that on our next attempt we only send just the right number of zero bytes (based on our previous count) and no more, then check for the acknowledgement from the receiving calculator. To my delight this strategy works well, and is provided by the application's -zeropad option.
Unfortunately as over 30,000 zeroes need to be sent each time the exploit packet takes a long time to transmit and as we now need to do it twice this can really slow things down! Once a safe number is known this can be specified with -zeropad=<count> but it's still a time-consuming process.
Fixed-size packets for quicker transmission
The problem here is not knowing the size of the packet we're transmitting. The packet does start with a length parameter, however as the "number of bytes left to receive" counter is stored on the calculator's stack by the receiving routine we end up overwriting that with our exploit payload and the total number of bytes left to receive will end up depending on the particular stack level at the time.
In my testing the variable ends up being stored on the stack at the same address ($FFC1 for normal transfers, $FFBF for ones where the flash was previously unlocked). Knowing this means that as we trample over the stack deploying our exploit we can at least make sure that we leave that value in the state it should be for the current point in the packet transfer.
This is implemented in the program with the -fixed parameter, which executes much more quickly than the -zeropad one and only needs to run through once. It is however reliant on knowing exactly where on the stack the "number of bytes left to receive" variable is stored; if it's different from the two presets baked into the program it can be changed with -fixed=<hex addr>.
Warning
As this program provides the option to send a program that will run on the calculator with the flash unlocked it is possible for it to do even more damage to the calculator, e.g. by corrupting or erasing the boot code itself which will completely brick the calculator. Use it at your own risk.
Running the program
The program can either be run with:
bootexec [-flashunlock] -zeropad[=num] COM1 file.8xp
or
bootexec [-flashunlock] -fixed[=hex] COM1 file.8xp
...where COM1 is the serial port name where you have a "Black Link" (or compatible "$4" cable) plugged in and file.8xp is the payload program to run (this should be a standard "no shell" AsmPrgm and will be loaded and executed from $9D95).
The program will pause before sending anything, this gives you a chance to reset your calculator (hold Del when inserting a battery to force it to the OS installation screen) and plug it in, ready to receive your program.
The -flashunlock parameter is optional and if specified it will send another packet first that leaves the flash memory unlocked.
Silver Link cable
If you are using a USB "Silver Link" cable you can also use this with the program by using USB as the port name instead of COM1 for the serial port.
The program will try to use TI's driver if it is installed however it's not the most robust option. If you are having difficulty with the link cable try unplugging and reconnecting the Silver Link to reset it.
As an alternative you can temporarily replace the official driver supplied by TI with a generic WinUSB driver so that the program has access to the cable. You can do this with Zadig: tick Options: List All Devices, select "TI-GRAPH LINK USB" from the list of devices, and then replace the driver with WinUSB. To restore the original functionality of the Silver Link, use Device Manager to uninstall the "TI-GRAPH LINK USB" device under "Universal Serial Bus devices", ticking "Delete the driver software for this device" to remove the WinUSB driver. Unplugging the cable and reconnecting it should then revert to the TI driver that was previously installed.
Further information
See Brandon Wilson's Overflow program for more details about the payload programs and an example that will erase the certificate page. Note that the sample payload program included with Overflow is not designed for the TI-83 Plus and will erase page 7Eh, if you are running it on a TI-83 Plus you will need to modify the program to erase page 1Eh instead!
See the WikiTI certificate documentation for more information about the certificate page and which page needs to be erased for your specific calculator if that's where you think the issue lies.