First thing to do is check out the AT&T official unlock method, since, if you meet the criteria, they will give you a code for free:
https://www.att.com/deviceunlock/client/en_US/?
If that is out of the question for whatever reason, there are a bunch of unlocking tools that will work for pre-JB roms (when you see me type "JB" it means Jelly Bean). Unfortunately, I found that NOTHING worked for me once I installed a JB based rom and I had to go the official route (which was easy for me since I bought the phone 2 years ago and was still with AT&T). If you are working on a stock SG2 the following stuff should work fine, though.
Here are your options:
Chainfire's - This, in my opinion is the best, as it uses a brute-force method to give you the ACTUAL unlock code and, more importantly in your case, the Master/Unfreeze code. However, it is for the i9100 so the play store may not let you install it so you will have to download it from that post and install it manually. The nv_data.bin file is the same between the i777 and the i9100, so this should work, provided you are running a pre-JB rom.
helroz's - This is what i used originally, mainly because it was one of the first and once I unlocked, I never looked back to see that there were better methods out there. This works by
patching files on your phone, and as such is a little bit more "dangerous" if something goes wrong. This will almost definitely NOT work if you have a JB rom.
Spocky's - This is a little different, and I'm not exactly sure how it works. I know there is a cost for it, but it's in the app (the app itself is free). I would assume that it sends certain information to their server and brute-forces the codes for you, but I haven't used it so I really have no idea. I think they are pretty good about refunds if it doesn't work.
If none of this works, your only option may be AT&T, so if you aren't an AT&T customer, you may need to work something out with a friend who is, if they meet the criteria in my first link.
Hope something here helps.