How can I remove the SIM lock from my Samsung Galaxy S Blaze 4G T-Mobile? I got an Galaxy S Blaze 4G as a gift from USA. The phone is locked and did not accept any SIM card in my country (just for T-mobile). Instead it ask for a unlock code.

Ts there any software way to unlock the phone (maybe with help of root)?
T-Mobile Support page contains a thread that covers your issue:

SIM Unlock your phone

Last updated on: Jul 3, 2013 2:43 PM


  If you purchased an eligible device, the device has been programmed with a SIM Subsidy lock that will prevent the device from operating with other compatible wireless telephone carrier’s services.
  
  If you wish to use the device with the service of another wireless telephone carrier, you must enter a numeric SIM Subsidy unlock code to unlock the device.
  
  Understanding SIM Unlock Requirements
  
  As an active or former T-Mobile customer, you may request a phone unlock. T-Mobile will unlock your phone (as long it is not reported as lost, stolen, or blocked) if:
  
  
  You have purchased your device from T-Mobile or an authorized T-Mobile dealer and activated it on T-Mobile service;
  You have Postpaid service, have not requested an unlock code in the last 90 days;
  You paid for your device in full;
  Your account is in good standing;
  You have a minimum of 40 consecutive days of active Postpaid service since purchase (or for Prepaid service, have used your device within the past 60 days );
  You are under a 24-month service contract, you have made monthly payments for at least 18 consecutive months on your plan or have paid a migration fee for the device;  certain exceptions may apply please call Customer Care for details;
  You are on a Prepaid plan, you have had more than $50 in total refills on the device;
  You are a former customer, your account balance is zero and you did not port out a line associated with the device during the buyer’s remorse period;
  You provide proof of purchase if T-Mobile is unable to verify purchase.
  
  
  Note: Exceptions to some or all requirements may apply in certain circumstances, including for Military Personnel and Business and Government Accounts.


If you qualify for the above list, give them a call and they will help you out!



Success Case:

A user from XDA Developers forum answered to a problem similar to your own, you can read about it here:


  I just unlocked mine a few days ago. If you meet the requirements you should be fine, http://support.t-mobile.com/docs/DOC-1588
  
  I bought my phone from ebay from a guy in Florida (I'm in NY), I had it on my account for a few months. So I had no reciept or anything, or history of the phone. When I called they asked for my phone number, account passcode, the phones model name and IMEI. Then I gave them my email, and recieved the code via email in about 24hrs. So it was pretty painless and free.




Alternatives:

There's a XDA Developers Thread with lots of users claiming to have successfully unlocked their devices either by changing their IMEI or by means of truth manipulation:


Answer #4:


  Yup. I got mine unlocked through T-Mobile for free. Just tell them that your going to travel during soon or something and they'll give you a pin in about 15 days.

Answer #10:


  FWIW I've successfully sim unlocked my T-Mobile Galaxy Blaze at the cost of  ERASING THE IMEI!


The step by step is found here:


  Turn off the phone. Insert a SIM from another provider into your phone.
  
  Click "DISMISS" on the Enter Unlock Code screen after the phone starts up.
  
  Wait a minute for the phone to power on and settle down.
  
  Go to the dialer screen. Enter *#197328640#
  
  The screen will change to the hidden menu as soon as you hit the last # key in the dailer
  
  press 1 DEBUG SCREEN
  Press 8 PHONE CONTROL
  Press 5 SIMULATION
  Press 6 NETWORK LOCK
  Press 3 PERSO SHA256 OFF
  Wait exactly 30 seconds
  press the menu key on the phone and select back option. This will take you back to NETWORK LOCK screen.
  Press 4 NW LOCK NV DATA INITIALLIZ
  Wait exactly one minute and reboot the phone.
  Your phone should be unlocked.
  I tried this on T-989 UVLE1 original ROM with root ON.
  I haven't tested it on any other version or ROMs or any other phones.  
  
  Disclaimer: I am not responsible for anything you do with your phone.



Read the entire thread here.