You should be able to use cpp code with xcode with very little effort. I think there is this old unlock tool Anysim, also partly written in cpp. It was made with tool chain, but it works with xcode/gcc the same way there. Maybe sam can tell you more, afaik, he was involved in coding it.