Understanding that. . .
Start downloading one of these files:
iPhone 4 iPhone3,1_5.0.1_9A405_Custom_Restore-SAM-activate.ipsw
iPhone 3gs iPhone2,1_5.0.1_9A405_Custom_Restore-SAM-activate.ipsw
Download Redsn0w 0.9.10b3 for your computer.
Select Pwned DFU
follow instructions to enter DFU mode
when redsn0w is done, Start iTunes, and it will detect an iPhone in recovery mode (but the screen will be black)
allow it to check with apple's servers, however, you must hold down shift (or option on a mac) when clicking restore in iTunes.
this will allow you select the modified ipsw i created for you. this will restore your phone to a fresh unactivated but unlocked state.
I have bundled into the package such software. It will install automatically when the phone starts up for the first time. This will cause the phone to seem to run VERY slowly and possibly even completely unresponsive. Please be patient. After the phone finishes the install (about 10 minutes from the completion of the Restore), restart the phone. if the phone is not responsive. . . hold the top (sleep) and the bottom (home) buttons for 10 seconds.
When the phone comes back up, you will be guided through the setup process, and with internet, it should actually activate properly (a neat hack). Now you should be able to insert your sim and use your phone. Restore data from itunes. and enjoy.