Unlocking is not the problem !! But JAILBREAKING it !! See if you have upgraded you iPhone accidently to iOS4 without using CUSTOM FIRMWARe then you are stuck until new SPIRIT is OUT !!
Or try to downgrade it if you have save your SHSH to cydia and has OLD bootRom using this LINK : http://forum.gsmhosting.com/vbb/f456/full-guide-downgrade-ios-4-iphone-3gs-3g-ipod-touch-3-1-3-3-1-2-video-1032843/
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
i was getting this far i dont have my shsh.. but what i noticed was if you leave your host file as normal until you hit shift and and restore then edit the host files save it then try the downgrade it goes a bit further.
i get error 1600 but i thnk thats because i was trying to use kings shsh from another thread.
perhaps that method will help you get a bit further
BR