I once bricked a router while reflashing it. Using an FT232 adapter you can open the router’s case and hook up to the RS232 pads on the board — connecting GND, TX and RX to the computer lets you issue commands directly and even drop into a system shell.
Use PuTTY to connect to the FT232’s COM port. As for the pinout on the router board, you can look it up in the DD-WRT or OpenWRT wiki; reference material is available for almost every router.
For example: https://wiki.openwrt.org/toh/d-link/dir-300revb
Once connected the following menu appears — you have to be quick — choosing “2” lets you connect to a TFTP server on your computer to fetch the firmware and reflash it.
Please choose the operation:
1: Load system code to SDRAM via TFTP.
2: Load system code then write to Flash via TFTP.
3: Boot system code via Flash (default).
4: Entr boot command line interface.
7: Load Boot Loader code then write to Flash via Serial.
9: Load Boot Loader code then write to Flash via TFTP.
Set a static IP on the computer, connect it to the router with an Ethernet cable, then enter the computer’s IP and the firmware filename.