How can I find out what carrier an iPhone 3gs is locked to? I'm trying to activate an old 3gs but am unsure of what carrier it is on. I don't really want to go testing all the sim cards I can find to see if I luck out. 

Does anyone know of a way to find out? 

I was wondering if I could write an app for it and use the Core Telephony Framework to find the carrier but am not sure if that only show the carrier that is being used by the sim not what it is locked to.
There is a small app which can show you the carrier with which your iPhone is associated. 



The app itself is not free but the sole function of displaying the iphone information you require is free.