You can easily Jailbreak/Unlock iPhone 3GS 3.1 Firmware on Windows. Just follow the simple steps outlined below.

1. Download the splitted files of custom iPhone 3GS 3.1 Firmware from the links below and combine them using HJSplit.

Part 1 | Part 2 | Part 3 | Part 4

2. Launch iTunes 9.

3. Via data cable, connect your iPhone with your computer.

4. From the device menu on the left side, select your iPhone.

5. Click “Restore” and keep pressing Shift key simultaneously (means click restore while holding Shift key) and select the custom IPSW file that we downloaded in step 1 above.

6. Now wait and let the installation process to be completed.

7. You have successfully Jailbreak your iPhone 3GS to 3.1 Firmware. Now you can unlock it via this guide to use your iPhone 3GS with any sim.

Source : Sizlopedia