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
| int __cdecl main(int argc, const char **argv, const char **envp) { char v4; int v5; _BYTE s[30]; unsigned int v7; unsigned int j; int i;
memset(s, 0, sizeof(s)); if ( argc > 1 || strcmp(*argv, "./suninatas") ) <- only one arg and need to be suninatas return 0; for ( i = 0; envp[i]; ++i ) { for ( j = 0; j < strlen(envp[i]); ++j ) envp[i][j] = 0; } _printf("Authenticate : ", v4); _isoc99_scanf("%30s", s); <- what is the size memset(&input, 0, 0xCu); v5 = 0; v7 = Base64Decode(s, &v5); if ( v7 <= 0xC ) <- int 13 { memcpy(&input, v5, v7); if ( auth(v7) == 1 ) correct(); <- !!!! } return 0; }
_BOOL4 __cdecl auth(int a1) { _BYTE v2[8]; char *s2; int v4;
memcpy(&v4, &input, a1); s2 = (char *)calc_md5((int)v2, 12); <- 12 bytes _printf("hash : %s ", s2); return strcmp("f87cd601aa7fedca99018a8be88eda34", s2) == 0; }
void __noreturn correct() { if ( input == -559038737 ) <- cmp eax, 0DEADBEEFh IO_puts("Congratulation! you are good!"); exit(0); }
|