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)
Function not defined in GDB IOS
-
02-06-2022 - |
Question
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 ()*
Solution