Moon

前言

代码执行分析

%hook MoonAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    // 打印某个类的所有方法的,查看所有方法的执行顺序

    [KNHook hookClass:@"aluTaobaoLoginViewController"];

    return %orig;
}
%end
Nov 10 10:15:16 iPhone Moon[2381] <Warning>: KNHooklog :-(void)beforeLoginWithContext:(have 1 value)
    return:(null)
    value1:aluLoginInfo--><aluLoginInfo: self.loginId=张坤楠88, self.password=scZ2UI0/PTkbJit2N1/ZaxaQUTwIxeToJeHISeJrUp8fGY/LqlBOrTKAdgXq8Ui6uQyQxRmjinQR6V80zZIwfDSUAk=, self.ccId=(null), self.checkCode=(null), self.loginType=taobao>
    object:<aluTaobaoLoginViewController: 0x16936600>
     ##########################################
Nov 10 10:53:41 iPhone Moon[2616] <Warning>: KNHooklog :-(void)loginWithContext:(have 1 value)
    return:(null)
    value1:aluLoginContext--><aluLoginContext: 0x17994060>
    object:<aluTaobaoLoginViewController: 0x16c67800>
Nov 10 10:53:41 iPhone Moon[2616] <Warning>: KNHooklog :-(id)loginBox(have 0 value)
    return:(null)
    object:<aluTaobaoLoginViewController: 0x16c67800>
     ##########################################
Nov 10 10:53:40 iPhone Moon[2616] <Warning>: KNHooklog :-(void)onLogin(have 0 value)
    return:(null)
    object:<aluTaobaoLoginViewController: 0x16c67800>
     ##########################################
Nov 10 10:53:40 iPhone Moon[2616] <Warning>: KNHooklog :-(id)loginBtn(have 0 value)
    return:(null)
    object:<aluTaobaoLoginViewController: 0x16c67800>
     ##########################################
Nov 10 10:53:40 iPhone Moon[2616] <Warning>: KNHooklog :-(void)aluLoginBox:inputAvailable:(have 2 value)
    return:(null)
    value1:aluLoginBox--><aluLoginBox: 0x17895d00; frame = (0 15; 320 88); clipsToBounds = YES; layer = <CALayer: 0x16794030>>
    value2:__NSCFNumber-->1
    object:<aluTaobaoLoginViewController: 0x16c67800>
     ##########################################
Nov 10 10:53:40 iPhone Moon[2616] <Warning>: KNHooklog :-(void)aluLoginPwdBox:(have 1 value)
    return:(null)
    value1:aluLoginBox--><aluLoginBox: 0x17895d00; frame = (0 15; 320 88); clipsToBounds = YES; layer = <CALayer: 0x16794030>>
    object:<aluTaobaoLoginViewController: 0x16c67800>
     ##########################################
Nov 10 10:53:41 iPhone Moon[2616] <Warning>: KNHooklog :-(void)onLoginFailed:(have 1 value)
    return:(null)
    value1:aluLoginContext--><aluLoginContext: 0x17994060>
    object:<aluTaobaoLoginViewController: 0x16c678

关键代码

char -[aluLoginViewController preCheck](void * self, void * _cmd) {
    r7 = (sp - 0x14) + 0xc;
    sp = sp - 0x2c;
    r11 = self;
    r7 = r7;
    r6 = [[r11 rdsBox] retain];
    if (([r6 isHidden] & 0xff) == 0x0) goto loc_18700c;

loc_186ff6:
    [r6 release];
    goto loc_187066;

loc_187066:
    r5 = [[r11 loginBox] retain];
    r0 = [r5 getPassword];
    aluInputBox *_passwordInputBox;
@property(nonatomic) __weak aluTextField *textField; // @synthesize textField=_textField;

@property(retain, nonatomic) NSString *textFieldPlaceHolder; // @synthesize textFieldPlaceHolder=_textFieldPlaceHolder;
@class UIFont;

@interface aluTextField : UITextField
{
    UIFont *_placeHolderFont;
}

@property(retain, nonatomic) UIFont *placeHolderFont; // @synthesize placeHolderFont=_placeHolderFont;
- (void).cxx_destruct;
- (void)drawPlaceholderInRect:(struct CGRect)arg1;
- (struct CGRect)editingRectForBounds:(struct CGRect)arg1;
- (struct CGRect)textRectForBounds:(struct CGRect)arg1;
- (struct CGRect)placeholderRectForBounds:(struct CGRect)arg1;
- (struct UIEdgeInsets)textInsets;
- (void)setFont:(id)arg1;
- (id)initWithFrame:(struct CGRect)arg1;

@end

    原文作者:kunnan
    原文地址: https://segmentfault.com/a/1190000011940406
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞