-
-
[原创]看雪CTF.TSRC 2018 团队赛第五题 交响曲 WP
-
发表于: 2018-12-19 14:57 1958
-
看雪CTF.TSRC 2018 团队赛第五题 交响曲 直接扔jeb里反编译一下,基本就和源码差不多了,就直接贴解题代码了: typedef struct _APK05 { int j; //year; int i; //month; int h; //day; int t; int e; int f; int g; } APK05, *PAPK05; APK05 _this; void apk05_d() { 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; } int tab_d[] = {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}; int tab_c[] = {6, 7, 18, 9, 5, 16, 9, 15, 18, 8, 9, 5}; int tab_b[] = {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}; int tab_a[] = {16, 6, 7, 10, 9, 16, 10, 8, 8, 9, 6, 6}; char *tab_m[] = {"23to01", "01to03", "03to05", "05to07", "07to09", "09to11", "11to13", "13to15", "15to17", "17to19", "19to21", "21to23"}; int h() { int rv = 0; if ((_this.f == 2) && (_this.t == 6)) { rv = 63; } else { rv = tab_a[_this.t]; } return rv; } int test05() { int rv = 0; apk05_d(); rv += tab_d[(_this.g - 1900) % 60]; rv += tab_c[_this.f - 1]; rv += tab_b[_this.e - 1]; rv += h(); return rv; } int main(int argc, char* argv[]) { int i,j,k,n; for (j=1983;j<2008;j++) { for (i=0;i<12;i++) { for (k=0;k<31;k++) { for (n=0;n<12;n++) { _this.j = j; _this.i = i+1; _this.h = k+1; _this.t = n; if (test05() == 34) { printf("%04d%02d%02d%s\n",j,i+1,k+1,tab_m[n]); } } } } } return 1; } 最后得到结果: 1995020305to07
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课
赞赏
他的文章
看原图
赞赏
雪币:
留言: