# Download the latest version of iTunes and take a backup of all your data.
# On your jailbroken iPhone 3G/3GS, start “Cydia” and select “Manage” and then “Sources”.
# Select the “Edit” button at the top right of the screen.
# Now press “Add” and enter the Cydia/APT URL as “http://repo666.ultrasn0w.com” and click on “Add Sources”.
* Once you are done with adding the sources, press “Return to Cydia” button and Cydia will now automatically update your sources.
* Select
http://repo666.ultrasn0w.com/ from the list of user entered sources and search for ultrasn0w.
* Now press the “Install” button and then the “Confirm” button at the top right of the screen to install ultrasn0w.
* Ultrasn0w will automatically unlock your iPhone 3G/3Gs so that you can use it with any carrier.
* Restart our iPhone by holding down the power button for 3 seconds then moving the power slider that appears to the right. Press the power button again to turn on the phone.
* Once you rebooted your iPhone you can use it with any SIM card of your choice.
So using ultrasn0w you can easily unlock your iPhone 3GS/3G with iPhone OS 3.1.2 after it has been successfully jailbroken using Pwnage Tool 3.1.4.