A reverse engineering tool to restore stripped symbol table for iOS app.
A reverse engineering tool to restore stripped symbol table for iOS app.
Example: restore symbol for Alipay
git clone --recursive https://github.com/tobefuturer/restore-symbol.git
cd restore-symbol && make
./restore-symbol
./restore-symbol /pathto/origin_mach_o_file -o /pathto/mach_o_with_symbol
codesign -f -s "iPhone Developer: XXXXXXX" --signing-time none --entitlement ./xxxx.app.xcent ./xxxx.app
ios-deploy
, or other way you like. If you use ios-deploy
, you can execute this command.
brew install ios-deploy
ios-deploy -d -b xxxx.app
b -[class method]
to set breakpoint.search_oc_block/ida_search_block.py
) .
./restore-symbol /pathto/origin_mach_o_file -o /pathto/mach_o_with_symbol -j /pathto/block_symbol.json
Usage: restore-symbol -o <output-file> [-j <json-symbol-file>] <mach-o-file>
where options are:
-o <output-file> New mach-o-file path
--disable-oc-detect Disable auto detect and add oc method into symbol table,
only add symbol in json file
--replace-restrict New mach-o-file will replace the LC_SEGMENT(__RESTRICT,__restrict)
with LC_SEGMENT(__restrict,__restrict) to close dylib inject protection
-j <json-symbol-file> Json file containing extra symbol info, the key is "name","address"
like this:
[
{
"name": "main",
"address": "0xXXXXXX"
},
{
"name": "-[XXXX XXXXX]",
"address": "0xXXXXXX"
},
....
]