a1yearx**ppro: 00000001001ae813 db "1year_x**p_pro", 0 ; DATA XREF=cfstring_1year_x**p_pro aFunctionpack1: 00000001001ae822 db "function_pack_1", 0 ; DATA XREF=cfstring_function_pack_1 aFunctionpack1c: 00000001001ae832 db "function_pack_1_cn", 0 ; DATA XREF=cfstring_function_pack_1_cn
frida-trace -m "*[XNPBuyViewController *]" X**p /* TID 0x103 */ 20718 ms -[XNPBuyViewController viewIdentifier] 20719 ms -[XNPBuyViewController viewIdentifier] 20736 ms -[XNPBuyViewController viewIdentifier] 20736 ms -[XNPBuyViewController toolbarItemImage] 20737 ms -[XNPBuyViewController toolbarItemLabel] ...... 20748 ms -[XNPBuyViewController setButtonPrivacy:0x139f336f0] 20748 ms -[XNPBuyViewController setButtonTerms:0x139f34800] 20748 ms -[XNPBuyViewController setBuyFeatureViewWrapperView:0x139f33230] 20748 ms -[XNPBuyViewController setManageSubscriptionButton:0x139f32b10] 20748 ms -[XNPBuyViewController setSubscriptionViewWrapperView:0x139f388d0] 20749 ms -[XNPBuyViewController viewDidLoad] 20749 ms | -[XNPBuyViewController setPackBackgroudViews:0x6000026230f0] 20749 ms | -[XNPBuyViewController setSubscriptionViewController:0x600001950500] 20749 ms | -[XNPBuyViewController subscriptionViewController] 20749 ms | -[XNPBuyViewController subscriptionViewWrapperView] 20749 ms | -[XNPBuyViewController subscriptionViewController] 20753 ms | +[XNPBuyViewController setupButton:0x13b012840] 20755 ms | -[XNPBuyViewController setupPackBackgroundView:0x13b011a40] 20755 ms | | -[XNPBuyViewController packBackgroudViews] 20755 ms | -[XNPBuyViewController setBuyFeatureViewController:0x600001d41080] 20755 ms | -[XNPBuyViewController buyFeatureViewController] 20755 ms | -[XNPBuyViewController buyFeatureViewWrapperView] 20755 ms | -[XNPBuyViewController buyFeatureViewController] 20757 ms | +[XNPBuyViewController setupButton:0x13b174d10] 20757 ms | -[XNPBuyViewController setupPackBackgroundView:0x13b168300] 20757 ms | | -[XNPBuyViewController packBackgroudViews] 20757 ms | -[XNPBuyViewController setupPackBackgroundView:0x13b170a60] 20757 ms | | -[XNPBuyViewController packBackgroudViews] 20757 ms | -[XNPBuyViewController manageSubscriptionButton] 20757 ms | -[XNPBuyViewController buttonPrivacy] 20757 ms | -[XNPBuyViewController buttonTerms] 20757 ms | -[XNPBuyViewController appearanceDidChangeNotificaion:0x0] 20757 ms | | -[XNPBuyViewController packBackgroudViews] 20757 ms | -[XNPBuyViewController setupUIByPurchase] 20757 ms | | -[XNPBuyViewController buyFeatureViewController] ......
_OBJC_CLASS_$_XNPSystemStatus: 0000000100260a48 extern function code ; in @rpath/X**pLibrary.framework/Versions/A/X**pLibrary, DATA XREF=sub_100007424+152, -[XNPMenuletMenu updateProItem]+24, -[XNPFileNameWindowController windowDidLoad]+704, -[XNPFileNameWindowController windowDidChangeOcclusionState:]+56, -[XNPFileNameWindowController okButtonClick:]+28, -[XNPBuyViewController setupUIByPurchase]+48, -[XNPBuyFeatureViewController setupUIByPurchase]+24, -[XNPBuyFeatureViewController pack1ButtonClick:]+32, -[XNPMainMenu updateProItem]+24, -[XNPDistributeNotificationManager sendPStatus]+24, -[XNPBuySubscriptionViewController yearlySubscribeButtonClick:]+32
接着便对 X**pLibrary 进行反汇编,以找到 XNPSystemStatus 类。
首先看 p 方法,其地址为 0x1**dc。
1 2 3
-[XNPSystemStatus p]: 000000000001**dc ldrb w0, [x0, #0x9] ; Objective C Implementation defined at 0xed1c4 (instance method), DATA XREF=0xed1c4 000000000001**e0 ret
onLeave(log, retval, state) { log( `-[XNPSystemStatus p] return: ` + retval + " onLeave at the beginning." ); retval.replace(0x1); log(`-[XNPSystemStatus p] return: ` + retval + " onLeave at the end."); }, });
破解了?但似乎不够完美。
既然劫持篡改了 p 方法的返回值能够达到年订阅的效果,那便继续寻找能够控制达到终生订阅的方法。从何找起?显然是遵循就近优先原则,从 XNPSystemStatus 类中找起,不难发现有一个与 p 很相似的 p1 方法,地址为 0x1**ec。
1 2 3
-[XNPSystemStatus p1]: 000000000001**ec ldrb w0, [x0, #0xa] ; Objective C Implementation defined at 0xed1dc (instance method), DATA XREF=0xed1dc 000000000001**f0 ret
cd 224/X**p.app/Contents/MacOS && ./insert_dylib @executable_path/frida.dylib ./X**p Binary is a fat binary with 2 archs. LC_CODE_SIGNATURE load command found. Remove it? [y/n] y LC_CODE_SIGNATURE load command found. Remove it? [y/n] y Added LC_LOAD_DYLIB to all archs in ./X**p_patched