首页
社区
课程
招聘
1
[原创]第五题 交响曲
发表于: 2018-12-9 21:21 3001

[原创]第五题 交响曲

2018-12-9 21:21
3001

将classes.dex用jadx打开:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
package cn.kwaiching.crackme;
 
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
 
public class CrackMe extends AppCompatActivity {
    int[] a = new int[]{1667109161088966};
    int[] b = new int[]{510815161581681691781710891851510989151878166};
    int[] c = new int[]{6718951691518895};
    int[] d = new int[]{7791287135145917571288619681610612967125987815916881912687515616157912107156514149};
    int e;
    int f;
    int g;
    int h;
    int i;
    int j;
    int k;
    String[] l = new String[73];
    String[] m = new String[]{"23to01""01to03""03to05""05to07""07to09""09to11""11to13""13to15""15to17""17to19""19to21""21to23"};
    TextView n;
 
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView((int) R.layout.activity_fate_me);
        b();
        this.n = (TextView) findViewById(R.id.fate);
        ((Button) findViewById(R.id.ok)).setOnClickListener(new OnClickListener() {
            public void onClick(View view) {
                try {
                    CrackMe.this.a();
                catch (Exception unused) {
                    CrackMe.this.n.setText(CrackMe.this.getString(R.string.notMe));
                }
            }
        });
    }
 
    private void a() {
        try {
            c();
            if (this.j == 0 || this.i == 0 || this.h == 0) {
                this.n.setText(getString(R.string.notMe));
                return;
            }
            d();
            a(((e() + f()) + g()) + h());
        catch (Exception unused) {
            this.n.setText(getString(R.string.notMe));
        }
    }
 
    private void b() {
        for (int i = 0; i <= 72; i++) {
            if (i != 34) {
                this.l[i] = getResources().getString(R.string.success00);
            else {
                this.l[i] = getResources().getString(R.string.success34);
            }
        }
    }
 
    private void c() {
        try {
            String obj = ((EditText) findViewById(R.id.code)).getText().toString();
            this.j = 0;
            this.i = 0;
            this.h = 0;
            this.j = Integer.parseInt(obj.length() > 4 ? obj.substring(04) : obj);
            if (this.j > 0 && this.j < 189) {
                this.j = 0;
            }
            if (this.j <= 1983 || this.j >= 2007) {
                this.j = 0;
            }
            this.i = Integer.parseInt(obj.length() > 6 ? obj.substring(46) : obj);
            if (this.i < 1 || this.i > 12) {
                this.i = 0;
            }
            if (obj.length() > 8) {
                obj = obj.substring(68);
            }
            this.h = Integer.parseInt(obj);
            if (this.h < 1 || this.h > 31) {
                this.h = 0;
            }
        catch (Exception unused) {
            this.n.setText(getString(R.string.notMe));
        }
    }
 
    private void d() {
        try {
            if (this.j == 1989 || this.j == 2004) {
                this.h = 31;
            }
            if (this.i == 1 || this.i == 4 || this.i == 5 || this.i == 7 || this.i == 10 || this.i == 11 || this.i == 12) {
                this.j = 1999;
            }
            if (this.j <= 1994 && (this.i == 2 || this.i == 6 || this.i == 8)) {
                this.i = 3;
            }
            if (this.j >= 1996 && (this.i == 2 || this.i == 6 || this.i == 8)) {
                this.i = 9;
            }
            if (this.j == 1995 && (this.h > this.i + 2 || this.i == this.h)) {
                this.i = 6;
            }
            this.g = this.j;
            this.f = this.i;
            this.e = this.h;
        catch (Exception unused) {
            this.n.setText(getString(R.string.notMe));
        }
    }
 
    private void a(int i) {
        if (i > 34 || i < 34) {
            this.n.setText(getString(R.string.notMe));
            return;
        }
        try {
            this.n.setText(String.format("%s%s"new Object[]{getString(R.string.me), this.l[i]}));
            ((Button) findViewById(R.id.ok)).setEnabled(false);
        catch (Exception unused) {
            this.n.setText(getString(R.string.notMe));
        }
    }
 
    private int e() {
        try {
            return this.d[(this.g - 1900) % 60];
        catch (Exception unused) {
            this.n.setText(getString(R.string.notMe));
            return 0;
        }
    }
 
    private int f() {
        try {
            return this.c[this.f - 1];
        catch (Exception unused) {
            this.n.setText(getString(R.string.notMe));
            return 0;
        }
    }
 
    private int g() {
        try {
            return this.b[this.e - 1];
        catch (Exception unused) {
            this.n.setText(getString(R.string.notMe));
            return 0;
        }
    }
 
    /* JADX WARNING: Removed duplicated region for block: B:17:0x0050 A:{Catch:{ Exception -> 0x005c }} */
    private int h() {
        /*
        r6 = this;
        r0 = 2131165227; // 0x7f07002b float:1.7944665E38 double:1.0529355243E-314;
        r1 = 2131427370; // 0x7f0b002a float:1.8476354E38 double:1.05306504E-314;
        r2 = 0;
        r0 = r6.findViewById(r0);  Catch:{ Exception -> 0x005c }
        r0 = (android.widget.EditText) r0;    Catch:{ Exception -> 0x005c }
        r0 = r0.getText();     Catch:{ Exception -> 0x005c }
        r0 = r0.toString();    Catch:{ Exception -> 0x005c }
        r3 = 8;
        r4 = r0.length();  Catch:{ Exception -> 0x005c }
        r0 = r0.substring(r3, r4);    Catch:{ Exception -> 0x005c }
        r3 = r6.f;     Catch:{ Exception -> 0x005c }
        r4 = 0;
    L_0x0022:
        r5 = r6.m;     Catch:{ Exception -> 0x005c }
        r5 = r5.length;    Catch:{ Exception -> 0x005c }
        if (r4 >= r5) goto L_0x004d;
    L_0x0027:
        r5 = r6.m;     Catch:{ Exception -> 0x005c }
        r5 = r5[r4];   Catch:{ Exception -> 0x005c }
        r5 = r0.equals(r5);    Catch:{ Exception -> 0x005c }
        if (r5 == 0) goto L_0x004a;
    L_0x0031:
        r5 = 2;
        if (r3 != r5) goto L_0x0042;
    L_0x0034:
        r3 = r6.m;     Catch:{ Exception -> 0x005c }
        r5 = 6;
        r3 = r3[r5];   Catch:{ Exception -> 0x005c }
        r0 = r0.equals(r3);    Catch:{ Exception -> 0x005c }
        if (r0 == 0) goto L_0x0042;
    L_0x003f:
        r0 = 63;
        return r0;
    L_0x0042:
        r0 = r6.a;     Catch:{ Exception -> 0x005c }
        r0 = r0[r4];   Catch:{ Exception -> 0x005c }
        r6.k = r0;     Catch:{ Exception -> 0x005c }
        r0 = 1;
        goto L_0x004e;
    L_0x004a:
        r4 = r4 + 1;
        goto L_0x0022;
    L_0x004d:
        r0 = 0;
    L_0x004e:
        if (r0 != 0) goto L_0x0059;
    L_0x0050:
        r0 = r6.n;     Catch:{ Exception -> 0x005c }
        r3 = r6.getString(r1);     Catch:{ Exception -> 0x005c }
        r0.setText(r3);  Catch:{ Exception -> 0x005c }
    L_0x0059:
        r0 = r6.k;     Catch:{ Exception -> 0x005c }
        return r0;
    L_0x005c:
        r0 = r6.n;
        r1 = r6.getString(r1);
        r0.setText(r1);
        return r2;
        */
        throw new UnsupportedOperationException("Method not decompiled: cn.kwaiching.crackme.CrackMe.h():int");
    }
}

基本上相当于直接得到源码了(只有h()函数没完全解析,不过不影响理解)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
package cn.kwaiching.crackme;
 
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
 
public class CrackMe extends AppCompatActivity {
    int[] a = new int[]{1667109161088966};
    int[] b = new int[]{510815161581681691781710891851510989151878166};
    int[] c = new int[]{6718951691518895};
    int[] d = new int[]{7791287135145917571288619681610612967125987815916881912687515616157912107156514149};
    int e;
    int f;
    int g;
    int h;
    int i;
    int j;
    int k;
    String[] l = new String[73];
    String[] m = new String[]{"23to01""01to03""03to05""05to07""07to09""09to11""11to13""13to15""15to17""17to19""19to21""21to23"};
    TextView n;
 
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView((int) R.layout.activity_fate_me);
        b();
        this.n = (TextView) findViewById(R.id.fate);
        ((Button) findViewById(R.id.ok)).setOnClickListener(new OnClickListener() {
            public void onClick(View view) {
                try {
                    CrackMe.this.a();
                catch (Exception unused) {
                    CrackMe.this.n.setText(CrackMe.this.getString(R.string.notMe));
                }
            }
        });
    }
 
    private void a() {
        try {
            c();
            if (this.j == 0 || this.i == 0 || this.h == 0) {
                this.n.setText(getString(R.string.notMe));
                return;
            }
            d();
            a(((e() + f()) + g()) + h());
        catch (Exception unused) {
            this.n.setText(getString(R.string.notMe));
        }
    }
 
    private void b() {
        for (int i = 0; i <= 72; i++) {
            if (i != 34) {
                this.l[i] = getResources().getString(R.string.success00);
            else {
                this.l[i] = getResources().getString(R.string.success34);
            }
        }
    }
 
    private void c() {
        try {
            String obj = ((EditText) findViewById(R.id.code)).getText().toString();
            this.j = 0;
            this.i = 0;
            this.h = 0;
            this.j = Integer.parseInt(obj.length() > 4 ? obj.substring(04) : obj);
            if (this.j > 0 && this.j < 189) {
                this.j = 0;
            }
            if (this.j <= 1983 || this.j >= 2007) {
                this.j = 0;
            }
            this.i = Integer.parseInt(obj.length() > 6 ? obj.substring(46) : obj);
            if (this.i < 1 || this.i > 12) {
                this.i = 0;
            }
            if (obj.length() > 8) {
                obj = obj.substring(68);
            }
            this.h = Integer.parseInt(obj);
            if (this.h < 1 || this.h > 31) {
                this.h = 0;
            }
        catch (Exception unused) {
            this.n.setText(getString(R.string.notMe));
        }
    }
 
    private void d() {
        try {
            if (this.j == 1989 || this.j == 2004) {
                this.h = 31;
            }
            if (this.i == 1 || this.i == 4 || this.i == 5 || this.i == 7 || this.i == 10 || this.i == 11 || this.i == 12) {
                this.j = 1999;
            }
            if (this.j <= 1994 && (this.i == 2 || this.i == 6 || this.i == 8)) {
                this.i = 3;
            }
            if (this.j >= 1996 && (this.i == 2 || this.i == 6 || this.i == 8)) {
                this.i = 9;
            }
            if (this.j == 1995 && (this.h > this.i + 2 || this.i == this.h)) {
                this.i = 6;
            }
            this.g = this.j;
            this.f = this.i;
            this.e = this.h;
        catch (Exception unused) {
            this.n.setText(getString(R.string.notMe));
        }
    }
 
    private void a(int i) {
        if (i > 34 || i < 34) {
            this.n.setText(getString(R.string.notMe));
            return;
        }
        try {
            this.n.setText(String.format("%s%s"new Object[]{getString(R.string.me), this.l[i]}));
            ((Button) findViewById(R.id.ok)).setEnabled(false);
        catch (Exception unused) {
            this.n.setText(getString(R.string.notMe));
        }
    }
 
    private int e() {
        try {
            return this.d[(this.g - 1900) % 60];
        catch (Exception unused) {
            this.n.setText(getString(R.string.notMe));
            return 0;
        }
    }
 
    private int f() {
        try {
            return this.c[this.f - 1];
        catch (Exception unused) {
            this.n.setText(getString(R.string.notMe));
            return 0;
        }
    }
 
    private int g() {
        try {
            return this.b[this.e - 1];
        catch (Exception unused) {
            this.n.setText(getString(R.string.notMe));
            return 0;
        }
    }
 
    /* JADX WARNING: Removed duplicated region for block: B:17:0x0050 A:{Catch:{ Exception -> 0x005c }} */
    private int h() {
        /*
        r6 = this;
        r0 = 2131165227; // 0x7f07002b float:1.7944665E38 double:1.0529355243E-314;
        r1 = 2131427370; // 0x7f0b002a float:1.8476354E38 double:1.05306504E-314;
        r2 = 0;
        r0 = r6.findViewById(r0);  Catch:{ Exception -> 0x005c }
        r0 = (android.widget.EditText) r0;    Catch:{ Exception -> 0x005c }
        r0 = r0.getText();     Catch:{ Exception -> 0x005c }
        r0 = r0.toString();    Catch:{ Exception -> 0x005c }
        r3 = 8;
        r4 = r0.length();  Catch:{ Exception -> 0x005c }
        r0 = r0.substring(r3, r4);    Catch:{ Exception -> 0x005c }
        r3 = r6.f;     Catch:{ Exception -> 0x005c }
        r4 = 0;
    L_0x0022:
        r5 = r6.m;     Catch:{ Exception -> 0x005c }
        r5 = r5.length;    Catch:{ Exception -> 0x005c }
        if (r4 >= r5) goto L_0x004d;
    L_0x0027:
        r5 = r6.m;     Catch:{ Exception -> 0x005c }
        r5 = r5[r4];   Catch:{ Exception -> 0x005c }
        r5 = r0.equals(r5);    Catch:{ Exception -> 0x005c }
        if (r5 == 0) goto L_0x004a;
    L_0x0031:
        r5 = 2;
        if (r3 != r5) goto L_0x0042;
    L_0x0034:
        r3 = r6.m;     Catch:{ Exception -> 0x005c }
        r5 = 6;
        r3 = r3[r5];   Catch:{ Exception -> 0x005c }
        r0 = r0.equals(r3);    Catch:{ Exception -> 0x005c }
        if (r0 == 0) goto L_0x0042;
    L_0x003f:
        r0 = 63;
        return r0;
    L_0x0042:
        r0 = r6.a;     Catch:{ Exception -> 0x005c }
        r0 = r0[r4];   Catch:{ Exception -> 0x005c }
        r6.k = r0;     Catch:{ Exception -> 0x005c }
        r0 = 1;
        goto L_0x004e;
    L_0x004a:
        r4 = r4 + 1;
        goto L_0x0022;
    L_0x004d:
        r0 = 0;
    L_0x004e:
        if (r0 != 0) goto L_0x0059;
    L_0x0050:
        r0 = r6.n;     Catch:{ Exception -> 0x005c }
        r3 = r6.getString(r1);     Catch:{ Exception -> 0x005c }
        r0.setText(r3);  Catch:{ Exception -> 0x005c }
    L_0x0059:
        r0 = r6.k;     Catch:{ Exception -> 0x005c }
        return r0;
    L_0x005c:
        r0 = r6.n;
        r1 = r6.getString(r1);
        r0.setText(r1);
        return r2;
        */
        throw new UnsupportedOperationException("Method not decompiled: cn.kwaiching.crackme.CrackMe.h():int");
    }
}

基本上相当于直接得到源码了(只有h()函数没完全解析,不过不影响理解)
基本上相当于直接得到源码了(只有h()函数没完全解析,不过不影响理解)
通过c()函数不难看出注册码前八位是一个1984到2006年的日期,然后使用d()函数用一些规则对这个日期进行一些处理,因此实际能取到的日期很有限
再看h()函数可知注册码后半部分为m数组中的一个字符串,最终注册码为:year+month+day+string  四部分组成
判断注册码正确的条件为:将year%60、month-1、day-1、string在m中的位置分别作为索引从数组d、c、b、a取四个值相加为34
因此简单遍历下所有日期即可得到注册码:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
public class solve {
     
    static int[] a = new int[]{1667109161088966};
    static int[] b = new int[]{510815161581681691781710891851510989151878166};
    static int[] c = new int[]{6718951691518895};
    static int[] d = new int[]{7791287135145917571288619681610612967125987815916881912687515616157912107156514149};
    static String[] m = new String[]{"23to01""01to03""03to05""05to07""07to09""09to11""11to13""13to15""15to17""17to19""19to21""21to23"};
 
    static int day;
    static int month;
    static int year;
    static int str;
 
    public static void main(String[] args) {
        // TODO Auto-generated method stub
 
        System.out.println("start");
        for(int i1 = 1984;i1 <= 2006;i1++)
        {
            if(i1 == 1989 || i1 == 2004)
                continue;
            for(int i2 = 1;i2 <= 12;i2++)
            {
                for(int i3 = 1;i3 <= 30;i3++)
                {
                    for(int i4 = 1;i4 <= 12;i4++)
                    {
                        year = i1;month = i2; day = i3;str = i4;
                        check();
                        if((d[(year-1900)%60] + c[month-1] + b[day-1] + a[str-1]) == 34)
                        {
                            System.out.println("sn:"+i1+i2+i3+m[i4-1]);
                        }
                    }
 
                }
                 
            }
        }
        System.out.println("end"); 
         
    }
     
     
    private static void check()
    {
        if (month == 1 || month == 4 || month == 5 || month == 7 || month == 10 || month == 11 || month == 12) {
            year = 1999;
        }
        if (year <= 1994 && (month == 2 || month == 6 || month == 8)) {
            month = 3;
        }
        if (year >= 1996 && (month == 2 || month == 6 || month == 8)) {
            month = 9;
        }
        if (year == 1995 && (day > month + 2 || month == day)) {
            month = 6;
        }
 
    }
 
}
输出结果:

[注意]看雪招聘,专注安全领域的专业人才平台!

收藏
免费 1
支持
分享
赞赏记录
参与人
雪币
留言
时间
PLEBFE
为你点赞~
2023-2-1 01:03
最新回复 (0)
游客
登录 | 注册 方可回帖
返回

账号登录
验证码登录

忘记密码?
没有账号?立即免费注册