2

I've developed a simple IOS application which Just validate pin/code value and print "is validated" if true, and "is not validated" if false .

what i did then i choosed product->archive the app and got it as "myapp.app" and upload it into my IOS phone, after that I used GDB trying to crack the application as (PoC), but when i try to put breakpoint as the following:

#(gdb) break -[viewController isValidCode]

Function "-[viewController isValidCode]" not defined.

Make breakpoint pending on future shared library load? (y or [n])

What is the reason behind this error ? Is there any preferences that we need to specify before using the app - during the archive step in XCode.

Reading symbols for shared libraries . done

Reading symbols for shared libraries ........... done

Reading symbols for shared libraries + done

*0x3b442eb4 in mach_msg_trap ()*

1 Answers1

1

When you archive the product, it is built in the "Release" mode, where the debug symbols are stripped. lldb or gdb do not leverage the information in the __OBJC segment to try to get method names, they solely rely on the debug symbols. What you would need to do is to break at a specific address, ie in gdb: b *0x12345 where 0x12345 is the address of the implementation of -[viewController isValidCode]. To retrieve that address you can look at the assembly generated by xcode. Or more realistically, as you would do with an "unknown" binary; you could use tools such as otool or the class-dump utility (look into the -A and -H option)

Olotiar
  • 3,225
  • 1
  • 18
  • 37
  • Thanks, this is clear now, but if i do want to use the function name directly in the GDB what should the built mode be ? and where i can change that in the xcode ? – user2550252 Jul 07 '13 at 13:15
  • just figured out that i should use xcodebuild -configuration Debug in the command line :) – user2550252 Jul 07 '13 at 13:52
  • You can do that in the GUI too if you're interested: http://stackoverflow.com/questions/5298916/where-is-set-the-active-build-configuration-in-xcode-4 – Olotiar Jul 07 '13 at 18:08