|If the computer freezes while listing devices in Safe Mode, you likely have no other option than to reinstall Windows.|
I recently fixed a computer with this problem and it turned out the hard drive had bad sectors, so keep that in mind as well. When I inserted the Windows XP disc and started formatting, it got to 3% and then got stuck. If you end up with the same issue with bad sectors but Windows can install, it will simply mark those as unusable and you should have no issues.
However if the bad sectors are in the boot section of the hard disk drive and you are unable to format/install Windows, you will probably need to buy a new hard drive.
iMac G5 1.8GHz "Hero" PowerPC
2 x 1GB DDR PC3200 SDRAM
160GB WDC WD1600JD-40GBB2
Mac OS X Leopard Version 10.5.8