Hactivating an Apple iPhone can be a tricky business specially when your iPhone 3G/3GS is having the "iPad 6.15" baseband for retaining software unlock. After, repeated failed attempts to have an Apple iPhone 3GS running iOS 4.0 with baseband 6.15 hactivate using custom IPSW and redsn0w the following worked for me.
- Make sure all the precautions listed here - http://www.megaleecher.net/iTunes_Restore_Error_1600 are taken care of.
- Create an custom IPSW using Sn0wbreeze and make sure the option for Hactivation is selected, I opted for iOS 4.2.1.
- Make sure your device is in PWNED DFU state and Shift+Restore the IPSW from iTunes.
- Let iTunes do its job.
- Once finished and phone rebooted, iTunes will let you use your device as it is now Activated.
- We can now proceed with installation of ultrasn0w unlock via Cydia.