Go to C:\Documents and Settings\<your user name>\Application Data\Mozilla\Firefox
Save off everything there and below that using something like winzip (or any utility that can save a folder and all files and folders below that directory) and save it somewhere off the computer. Do the OS restore, windows update, etc, then restore that folder before you install firefox. In a perfect world, firefox will just use the profile data you restored when you start it for the first time after the restore of the OS.
That might work. If it doesn't, then you can just rename the default.xxx sub-folder you saved into the new one it creates after exiting firefox, and that should work, assuming you're using Firefox's default profile.
There may be some things you have to fix up manually, but for the most part, that should do it. It works especially well, when you install things in the same location like the default location. You will have to reinstall any extensions and themes you use.
You can use the same process for t-bird as well. (substituting "Thunderbird" for "Mozilla\Firefox" in the pathname I listed, above.)
You can also read this:
http://kb.mozillazine.org/Roaming_profile
-David