340 Not firing on all cylinders

Wow,
I just seen the pic's of the wiring.
I would check evey connection, and move the ecm from one of the hottest's places in the engine compartment.