Unfortunately, this will require a trip to your dealership. GM radios have the VIN code programmed into them, and when either a new is installed or one from another GM is installed, your vehicle's VIN code has to be programmed into it with a GM factory scanner with proper GM software. Not even us independents have this capability.
The code numbers only work when you have your original radio and the battery was disconnected. Then you can simply punch in the code numbers, but for radio out of another gm vehicle it MUST be programmed with GM scanner. See Below from FACTORY SERVICE MANUAL:
The "Theftlock" theft deterrent system is a feature on all base and uplevel radios. There is no need to program a security code into the radio as in past model years. The theft deterrent system now utilizes class 2 serial data to determine if the radio is in the appropriate vehicle. Each time the radio receives the "run" power mode message, it compares the VIN information it has stored to the VIN information received from the dash integration module (DIM) on the class 2 serial data circuit. If a mis-match occurs, the radio display will indicate to the user the radio is locked. Once this takes place, a DTC will set, the radio will not respond to any button presses and become inoperative. The two scenarios able to cause this condition are:
The only way to unlock the radio is by using a scan tool. Always refer to the table in this section to diagnose the "Theftlock" DTC for further information.
I realize that this wont make you happy as we all prefer to not have to visit the dealership, but to tell you anything else simply would be a lie.
The average charge where I am at is 1/2 hour for the dealer to do the programming
You asked how to get your radio unlocked, and I provided you with the ONLY method for your vehicle as there are no workarounds for this unless you want to fry your radio and onboard computer. Unless you have a further question on this, you need to click the ACCEPT button pay for services rendered per the customer agreement you agreed to honor as this is a PAYSITE and I am not paid for my time, knowledge or experience until you fulfill your obligation and click the accept button.