首页
社区
课程
招聘
1
[原创]看雪CTF.TSRC 2018 团队赛 第五题 交响曲 wp
发表于: 2018-12-9 15:40 2904

[原创]看雪CTF.TSRC 2018 团队赛 第五题 交响曲 wp

2018-12-9 15:40
2904

JEB 撸出源码:

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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
public class CrackMe extends AppCompatActivity {
    int[] a;
    int[] b;
    int[] c;
    int[] d;
    int e_day;
    int f_month;
    int g_year;
    int h;
    int i;
    int j;
    int k;
    String[] l;
    String[] m;
    TextView n;
 
    public CrackMe() {
        super();
        this.a = new int[]{1667109161088966};
        this.b = new int[]{510815161581681691781710891851510989151878166};
        this.c = new int[]{6718951691518895};
        this.d = new int[]{7791287135145917571288619681610612967125987815916881912687515616157912107156514149};
        this.l = new String[73];
        this.m = new String[]{"23to01""01to03""03to05""05to07""07to09""09to11""11to13""13to15""15to17""17to19""19to21""21to23"};
    }
 
    private void a() {
        int v0 = 2131427370;
        try {
            this.c();
            if(this.j != 0 && this.i != 0 && this.h != 0) {
                this.d();
                this.a(this.e() + this.f() + this.g() + this.h());
                return;
            }
 
            this.n.setText(this.getString(v0));
        }
        catch(Exception ) {
            this.n.setText(this.getString(v0));
        }
    }
 
    private void a(int arg8) {
        int v0 = 2131427370;
        int v1 = 34;
        if(arg8 <= v1) {
            if(arg8 < v1) {
            }
            else {
                try {
                    this.n.setText(String.format("%s%s"this.getString(2131427369), this.l[arg8]));
                    this.findViewById(2131165273).setEnabled(false);
                    return;
                label_23:
                    this.n.setText(this.getString(v0));
                }
                catch(Exception ) {
                    this.n.setText(this.getString(v0));
                }
 
                return;
            }
        }
 
        goto label_23;
    }
 
    static void a(CrackMe arg0) {
        arg0.a();
    }
 
    private void b() {
        int v0;
        for(v0 = 0; v0 <= 72; ++v0) {
            this.l[v0] = v0 != 34 this.getResources().getString(2131427374) : this.getResources().getString(2131427375);
        }
    }
 
    private void c() {
        int v0 = 2131165227;
        try {
            String v0_1 = this.findViewById(v0).getText().toString();
            this.j = 0;
            this.i = 0;
            this.h = 0;
            int v3 = 4;
            String v2 = v0_1.length() > v3 ? v0_1.substring(0, v3) : v0_1;
            this.j = Integer.parseInt(v2);
            if(this.j > 0 && this.j < 189) {
                this.j = 0;
            }
 
            if(this.j <= 1983 || this.j >= 2007) {
                this.j = 0;
            }
 
            int v4 = 6;
            v2 = v0_1.length() > v4 ? v0_1.substring(v3, v4) : v0_1;
            this.i = Integer.parseInt(v2);
            if(this.i < 1 || this.i > 12) {
                this.i = 0;
            }
 
            int v5 = 8;
            if(v0_1.length() > v5) {
                v0_1 = v0_1.substring(v4, v5);
            }
 
            this.h = Integer.parseInt(v0_1);
            if(this.h >= 1 && this.h <= 31) {
                return;
            }
 
            this.h = 0;
        }
        catch(Exception ) {
            this.n.setText(this.getString(2131427370));
        }
    }
 
    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;
            }
 
            int v2 = 8;
            int v3 = 6;
            int v4 = 2;
            if(this.j <= 1994 && (this.i == v4 || this.i == v3 || this.i == v2)) {
                this.i = 3;
            }
 
            if(this.j >= 1996 && (this.i == v4 || this.i == v3 || this.i == v2)) {
                this.i = 9;
            }
 
            if(this.j == 1995 && (this.h > this.i + v4 || this.i == this.h)) {
                this.i = v3;
            }
 
            this.g_year = this.j;
            this.f_month = this.i;
            this.e_day = this.h;
        }
        catch(Exception ) {
            this.n.setText(this.getString(2131427370));
        }
    }
 
    private int e() {
        try {
            return this.d[(this.g_year - 1900) % 60];
        }
        catch(Exception ) {
            this.n.setText(this.getString(2131427370));
            return 0;
        }
    }
 
    private int f() {
        try {
            return this.c[this.f_month - 1];
        }
        catch(Exception ) {
            this.n.setText(this.getString(2131427370));
            return 0;
        }
    }
 
    private int g() {
        try {
            return this.b[this.e_day - 1];
        }
        catch(Exception ) {
            this.n.setText(this.getString(2131427370));
            return 0;
        }
    }
 
    private int h() {
        int v0 = 2131165227;
        int v1 = 2131427370;
        try {
            String v0_1 = this.findViewById(v0).getText().toString();
            v0_1 = v0_1.substring(8, v0_1.length());
            int v3 = this.f_month;
            int v4 = 0;
            while(true) {
                if(v4 >= this.m.length) {
                    break;
                }
                else if(v0_1.equals(this.m[v4])) {
                    if(v3 == 2 && (v0_1.equals(this.m[6]))) {
                        return 63;
                    }
 
                    this.k = this.a[v4];
                    v0 = 1;
                }
                else {
                    ++v4;
                    continue;
                }
 
                goto label_35;
            }
 
            v0 = 0;
        label_35:
            if(v0 == 0) {
                this.n.setText(this.getString(v1));
            }
 
            return this.k;
        }
        catch(Exception ) {
            this.n.setText(this.getString(v1));
            return 0;
        }
    }
 
    protected void onCreate(Bundle arg2) {
        super.onCreate(arg2);
        this.setContentView(2131296284);
        this.b();
        this.n = this.findViewById(2131165242);
        this.findViewById(2131165273).setOnClickListener(new View$OnClickListener() {
            public void onClick(View arg3) {
                try {
                    CrackMe.a(this.a);
                }
                catch(Exception ) {
                    this.a.n.setText(this.a.getString(2131427370));
                }
            }
        });
    }
}

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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
public class CrackMe extends AppCompatActivity {
    int[] a;
    int[] b;
    int[] c;
    int[] d;
    int e_day;
    int f_month;
    int g_year;
    int h;
    int i;
    int j;
    int k;
    String[] l;
    String[] m;
    TextView n;
 
    public CrackMe() {
        super();
        this.a = new int[]{1667109161088966};
        this.b = new int[]{510815161581681691781710891851510989151878166};
        this.c = new int[]{6718951691518895};
        this.d = new int[]{7791287135145917571288619681610612967125987815916881912687515616157912107156514149};
        this.l = new String[73];
        this.m = new String[]{"23to01""01to03""03to05""05to07""07to09""09to11""11to13""13to15""15to17""17to19""19to21""21to23"};
    }
 
    private void a() {
        int v0 = 2131427370;
        try {
            this.c();
            if(this.j != 0 && this.i != 0 && this.h != 0) {
                this.d();
                this.a(this.e() + this.f() + this.g() + this.h());
                return;
            }
 
            this.n.setText(this.getString(v0));
        }
        catch(Exception ) {
            this.n.setText(this.getString(v0));
        }
    }
 
    private void a(int arg8) {
        int v0 = 2131427370;
        int v1 = 34;
        if(arg8 <= v1) {
            if(arg8 < v1) {
            }
            else {
                try {
                    this.n.setText(String.format("%s%s"this.getString(2131427369), this.l[arg8]));
                    this.findViewById(2131165273).setEnabled(false);
                    return;
                label_23:
                    this.n.setText(this.getString(v0));
                }
                catch(Exception ) {
                    this.n.setText(this.getString(v0));
                }
 
                return;
            }
        }
 
        goto label_23;
    }
 
    static void a(CrackMe arg0) {
        arg0.a();
    }
 
    private void b() {
        int v0;
        for(v0 = 0; v0 <= 72; ++v0) {
            this.l[v0] = v0 != 34 this.getResources().getString(2131427374) : this.getResources().getString(2131427375);
        }
    }
 
    private void c() {
        int v0 = 2131165227;
        try {
            String v0_1 = this.findViewById(v0).getText().toString();
            this.j = 0;
            this.i = 0;
            this.h = 0;
            int v3 = 4;
            String v2 = v0_1.length() > v3 ? v0_1.substring(0, v3) : v0_1;
            this.j = Integer.parseInt(v2);
            if(this.j > 0 && this.j < 189) {
                this.j = 0;
            }
 
            if(this.j <= 1983 || this.j >= 2007) {
                this.j = 0;
            }
 
            int v4 = 6;
            v2 = v0_1.length() > v4 ? v0_1.substring(v3, v4) : v0_1;
            this.i = Integer.parseInt(v2);
            if(this.i < 1 || this.i > 12) {
                this.i = 0;
            }
 
            int v5 = 8;
            if(v0_1.length() > v5) {
                v0_1 = v0_1.substring(v4, v5);
            }
 
            this.h = Integer.parseInt(v0_1);
            if(this.h >= 1 && this.h <= 31) {
                return;
            }
 
            this.h = 0;
        }
        catch(Exception ) {
            this.n.setText(this.getString(2131427370));
        }
    }
 
    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;
            }
 
            int v2 = 8;
            int v3 = 6;
            int v4 = 2;
            if(this.j <= 1994 && (this.i == v4 || this.i == v3 || this.i == v2)) {
                this.i = 3;
            }
 
            if(this.j >= 1996 && (this.i == v4 || this.i == v3 || this.i == v2)) {
                this.i = 9;
            }
 
            if(this.j == 1995 && (this.h > this.i + v4 || this.i == this.h)) {
                this.i = v3;
            }
 
            this.g_year = this.j;
            this.f_month = this.i;
            this.e_day = this.h;
        }
        catch(Exception ) {
            this.n.setText(this.getString(2131427370));
        }
    }
 
    private int e() {
        try {
            return this.d[(this.g_year - 1900) % 60];
        }
        catch(Exception ) {
            this.n.setText(this.getString(2131427370));
            return 0;
        }
    }
 
    private int f() {
        try {
            return this.c[this.f_month - 1];
        }
        catch(Exception ) {
            this.n.setText(this.getString(2131427370));
            return 0;
        }
    }
 
    private int g() {
        try {
            return this.b[this.e_day - 1];
        }
        catch(Exception ) {
            this.n.setText(this.getString(2131427370));
            return 0;
        }
    }
 
    private int h() {
        int v0 = 2131165227;
        int v1 = 2131427370;
        try {
            String v0_1 = this.findViewById(v0).getText().toString();
            v0_1 = v0_1.substring(8, v0_1.length());
            int v3 = this.f_month;
            int v4 = 0;
            while(true) {
                if(v4 >= this.m.length) {
                    break;
                }
                else if(v0_1.equals(this.m[v4])) {
                    if(v3 == 2 && (v0_1.equals(this.m[6]))) {
                        return 63;
                    }
 
                    this.k = this.a[v4];
                    v0 = 1;
                }
                else {
                    ++v4;
                    continue;
                }
 
                goto label_35;
            }
 
            v0 = 0;
        label_35:
            if(v0 == 0) {
                this.n.setText(this.getString(v1));
            }
 
            return this.k;
        }
        catch(Exception ) {
            this.n.setText(this.getString(v1));
            return 0;
        }
    }
 
    protected void onCreate(Bundle arg2) {
        super.onCreate(arg2);
        this.setContentView(2131296284);
        this.b();
        this.n = this.findViewById(2131165242);
        this.findViewById(2131165273).setOnClickListener(new View$OnClickListener() {
            public void onClick(View arg3) {
                try {
                    CrackMe.a(this.a);
                }
                catch(Exception ) {
                    this.a.n.setText(this.a.getString(2131427370));
                }
            }
        });
    }
}

c函数检测判断前四位的年份是否在1984-2007之间,月份是否是01-12  日期是否在01-31 之间
d函数根据输入的年月日生成新的年月日
e函数根据新的年获取一个数 this.d[(this.g_year - 1900) % 60];
f函数返回月份对应的值
g函数返回日期对应的值
h函数判断月份 后8位之后的字符串,返回一个值

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

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

账号登录
验证码登录

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