What you need to do is, first, boot from alternate media. A CDROM sounds like the likeliest possibility for you. Get to the PROM monitor (press Stop-A on the Sparc keyboard or send it a serial Break, if you've got a serial terminal attached). Boot from the cdrom by typing ``boot cdrom''. If you're using the Solaris CDs, type ``boot cdrom -s'', as that will put it into single-user mode, bypassing the installation. Once you've logged in, mount the old root filesystem (of course, you'll have to be using an OS that has support for Sun's UFS; I think that Linux has such support). Then edit the /etc/shadow file and remove root's password. Unmount the filesystem and reboot. Now you'll be able to log in as root without a password and do whatever you want.
By the way, you can
download Solaris for Sparc for free.