I want to jailbreak my new iPhone 3GS, but I need to find out what firmware it has before downloading the jailbreak software. I can't get past the emergency call only page, and I can't read it with iTunes because I am using an illegal carrier, so not valid Sim as far as Apple is concerned.
Recent versions of redsn0w auto-detect the version of iOS running on the connected device, so you can usually just jailbreak it without having to manually figure out the iOS version first. You can always get the latest version of redsn0w from the Dev Team Blog: http://blog.iphone-dev.org/tagged/redsn0w
Jailbreaking with redsn0w also "hacktivates" (unofficially activates) unactivated iPhones (although not the iPhone 4S yet), which is convenient for these kinds of situations. Some things don't work on hacktivated iPhones (push notifications, iMessage, FaceTime), and the battery may drain more than usual, but it's fine for a temporary solution when no official SIM cards are available.
If you know someone else who has an activated SIM on the correct carrier (AT&T if you're in the US), you can put that into your phone and then plug it in to iTunes to do a soft activation on the phone. This will get you past the emergency call screen.
When you plug it into iTunes, you'll need to be connected to the Internet. iTunes will "phone home" really quick and then you should see it ask for registration, etc. in iTunes. You'll get a popup on the phone that it's been activated and then you can go to Settings > General and check the version or check it through iTunes.
After you've activated the phone, you can remove the borrowed SIM without deactivating it again. The phone will just show "No Service" at the top.