-
-
[原创]看雪CTF.TSRC 2018 团队赛 第五题 交响曲 wp
-
发表于: 2018-12-9 15:40 2733
-
JEB 撸出源码:
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[]{16, 6, 7, 10, 9, 16, 10, 8, 8, 9, 6, 6}; this.b = new int[]{5, 10, 8, 15, 16, 15, 8, 16, 8, 16, 9, 17, 8, 17, 10, 8, 9, 18, 5, 15, 10, 9, 8, 9, 15, 18, 7, 8, 16, 6}; this.c = new int[]{6, 7, 18, 9, 5, 16, 9, 15, 18, 8, 9, 5}; this.d = new int[]{7, 7, 9, 12, 8, 7, 13, 5, 14, 5, 9, 17, 5, 7, 12, 8, 8, 6, 19, 6, 8, 16, 10, 6, 12, 9, 6, 7, 12, 5, 9, 8, 7, 8, 15, 9, 16, 8, 8, 19, 12, 6, 8, 7, 5, 15, 6, 16, 15, 7, 9, 12, 10, 7, 15, 6, 5, 14, 14, 9}; 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)); } } }); } }
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[]{16, 6, 7, 10, 9, 16, 10, 8, 8, 9, 6, 6}; this.b = new int[]{5, 10, 8, 15, 16, 15, 8, 16, 8, 16, 9, 17, 8, 17, 10, 8, 9, 18, 5, 15, 10, 9, 8, 9, 15, 18, 7, 8, 16, 6}; this.c = new int[]{6, 7, 18, 9, 5, 16, 9, 15, 18, 8, 9, 5}; this.d = new int[]{7, 7, 9, 12, 8, 7, 13, 5, 14, 5, 9, 17, 5, 7, 12, 8, 8, 6, 19, 6, 8, 16, 10, 6, 12, 9, 6, 7, 12, 5, 9, 8, 7, 8, 15, 9, 16, 8, 8, 19, 12, 6, 8, 7, 5, 15, 6, 16, 15, 7, 9, 12, 10, 7, 15, 6, 5, 14, 14, 9}; 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位之后的字符串,返回一个值
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)
赞赏
他的文章
看原图
赞赏
雪币:
留言: