Introduction: How to Jailbreak and Unlock an Iphone 3G Running IOS 4.0

   WARNING I AM NOT RESPONSIBLE FOR YOUR EQUIPMENT AND WHAT YOU CHOOSE TO DO WITH IT.  PROCEED AT YOUR OWN RISK.   THIS WILL VOID ANY WARRANTY YOU HAVE WITH APPLE!!!  THERE IS ALSO A RISK INVOLVED HERE OF BRICKING YOUR IPHONE! 
     This instructable will be a step by step guide to Jailbreaking and Unlocking your iphone 3G running on the 4.0 software baseline 05.13.04. I used my white 16gb 3G, and unlocked it to T-Mobile.

**UPDATE**
I began to notice that my 3G was performing slower and when I investigated the matter it seems a common issue.  It would seem that the iso 4.0 is a little heavy for the iphone 3G, but not for everyone.  Some slow, some not.  I imagine that the 3GS would perform better with this. I went ahead and downgraded to 3.1.2.  This was moderately difficult to figure out, but I managed it and did a jailbreak and unlock and I am back to normal speed.  If there is interest I will add an instructable on downgrading from 4.0

Step 1: Downloading What You Need

There are a couple of things you will need to download first.
1. A copy of the 4.0 software.
   -You can find it here, http://www.iphoneheat.com/2010/06/download-ios-4/
   -This will be downloaded and saved to your desktop or like folder. You have this on your
iphone already, If not then just update your iphone using iTunes before you proceed.
   -BE SURE TO DOWNLOAD THE CORRECT ONE.  We are downloading for the 3G (see image 1)

2. You will also need to download redsn0w.
   - You can find it here, http://wikee.iphwn.org/howto:rs9
   -The download is at the bottom of the page. (see image 2)


Step 2: Starting the Jailbreak

- Start by opening redsn0w and clicking the browse button. (see image 1)
- Select the firmware you downloaded (see image 2)
- Once the firmware is processed click next

Step 3: The Jailbreak

- On the next screen in redsn0w you must select INSTALL CYDIA.
- I selected the others in image 1 as well.
- Click next and closely follow the instructions given there.
    - This would be plugging your iphone into the usb port on your computer, then turning it off entirely.  Not just locking the screen! Turn it off entirely! (see image 2)
- Have your iphone in hand and ready to follow the instructions as seen in images 3-5.
- Follow any additional instructions that redsn0w gives you.
- When your iphone reboots you will see that there is an icon for Cydia.
- Click on the Cydia app and allow for it to reorganize.
- At this point your iphone has been jailbroken.  The remaining instructions will cover unlocking your iphone for other gsm networks.

Step 4: Unlocking the Iphone

- Make sure you are connected to wifi then go into the Cydia app on your iphone. (image 1)
- Select user or graphical
- Select the manage tab at the bottom of the screen. (image 2)
- Select Sources. (image 3)
- Select Edit at the top right, then add at the top left. (image 4)
- Add this source,  http://repo666.ultrasn0w.com/ (image 5)
    - The 0 in snow is a numerical zero not the letter.
- Once it is updated click return to cydia
- Then select done in the top right.
- Click on the source we just added. 
- Then select the ultrasn0w package and install it by clicking install then confirm in the top 
       right corner. (image 5)
- Once it is installed select "reboot device"
- Insert your sim card and allow for the iphone to start up. (this will look a little different)
- Once it is on go into the settings and turn on airplane mode then turn it off. (this will help it select the network more quickly).
- Your iphone is now unlocked!

Let me know if you have questions or suggestions.  I love to collaborate!