How do I fix these broken cables/pins?
You could replace the connector but that's unneeded. Youd have to get crimps for the wire and then unlatch the existing crimps and plug the new crimp in.

Just Remove the small connector cn2 (desolder) and just solder the wires to the board.

The bigger connector is more problematic as the leads are short. You could solder an extension that red wire and then solder the other end to the underside of the board, or trace it out and find another solder point. Make sure you use heatshrink to prevent a short.