Before the release of official PwnageTool 4.0, only way to jailbreak iPhone 3GS iOS 4.0 is by using PwnageTool bundles created by MSFT.guy. These bundles actually act as a workaround to allow PwnageTool 3.1.5. Now iPhone Dev Team has officially released PwnageTool 4.0, it is recommended to use this official latest release of PwnageTool to jailbreak your iPhone 3GS.
Before you may start jailbreaking iPhone 3GS with PwnageTool 4.0, please read the official note from iPhone Dev Team below:
If your have iPhone 3GS with OLD BOOTROM, and you haven't used Spirit tool to jailbreak your iPhone earlier, then proceed to our step-by-step guide to jailbreak iPhone 3GS iOS 4.0 with PwnageTool 4.0 here.
Once jailbreaked, you can use Ultrasn0w 0.93 to unlock your iPhone 3GS. You can find detailed step-by-step instructions here.
Download Links
Download PwnageTool 4.0 | Alternate Mirror
Download iOS 4 for iPhone 4/3GS/3G, iPod Touch 2G/3G – Final Version
Download iTunes 9.2 Final for Windows and Mac
Update 1: Guide to Jailbreak iPhone 3G iOS 4.0 with PwnageTool 4.0
Update 2: Sn0wbreeze v1.7 - Jailbreak iOS 4 on iPhone 3GS (New Bootrom) / iPod Touch 2G (MC Models) & iPod Touch 3G