1* Download iPhone 3G 4.0 Firmware / iPhone 3GS 4.0 Firmware.
2* Download iTunes 9.2
3* Download Sn0wbreeze 1.6.1 for Windows
4* Put everything in one folder and name is “ios4.0”
5* Now Start sn0wbreeze 1.6.1 and click “blue arrow” and select “simple mode” and continue.
If you select expert mode you will be able to get thru many options include ability to install custom boot/recovery logo etc.
6* Now browse and select iOS 4.0 ipsw file downloaded in step 1 for your respective device
7* Sn0wbreeze 1.6.1 will process 4.0 ipsw and will verify select ipsw file
8* Now click on Blue arrow icon and wait for Sn0wbreeze 1.6.1 to complete processing
9* Click yes/ no if you want to activate iPhone
10* Let Sn0wbreeze 1.6.1 to complete rest of its process
11* Sn0wbreeze 1.6.1 will show the message once it has done, now select whether your iPhone 3G is jailbroken or not
12* Now connect your iphone and enter in Recovery mode after that launch itunes and hold down while clicking the restore button on iTunes
13* Now let iTunes complete installing iOS 4.0 custom firmware on your iPhone 3G/3GS.
Once your iPhone restarts, the jailbreak process will complete, now enjoy your jailbroken iPhone 3G/3GS 4.0.
Unlock iOS 4.0
Follow our guide to Unlock iOS 4.0 on iPhone 3G/3GS with Ultrasn0w 0.93