Short of a bomb, nothing software wise would stop them, only delay. I know ASML/TSMC thinks it's their code that powers the machine, but once you see how it's put together the code can be broken down and rewritten. Doubting China at this point is a bad idea. EDIT: ASML more so then TSMC who is probably going on what ASML believes.
Actually, EUV lithography is extremely finicky and a "miraculous" technology in that it is a miracle it works at all. It relies on human expertise, SOA software and inputs (wafers, lenses, and tin droplet generators among other tech) that are decades beyond anything China can natively bring to the table. Don't forget China depends on the outside world more than the outside world depends on China.
So yes, technically anything software might do would only delay bringing the Fabs back online...
...but the delay would be a decade or two and, even if China survives its demographic crisis, by the time they get EUV working again it would be less useful than the 90nm+ chips that are the limit of China's native semiconductor tech without foreign supplies, personnel, and designs.
But as I said, TSMC is not the driving force for the invasion.
Neither is economics, demographics, or even geography.
In real world terms, Formosa is as critical to China's economy as Gibraltar to Spain or the Falklands to Argentina/UK in the 80's. (This last has changed a bit as the Falklands now have offshore oil but, more importantly, Argentina has *shale* which makes offshore oil barely relevant.)
Nations rarely go to war over rational matters.