result = strings_not_equal((_BYTE *)a1, "Public speaking is very easy."); if ( result ) explode_bomb(); return result; }
字符串比较,直接输入Public speaking is very easy.即可。
phase_2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
int __cdecl phase_2(char *s) { int i; // ebx int result; // eax int v3[6]; // [esp+10h] [ebp-18h] BYREF
read_six_numbers(s, (int)v3); if ( v3[0] != 1 ) explode_bomb(); for ( i = 1; i <= 5; ++i ) { result = v3[i - 1] * (i + 1); if ( v3[i] != result ) explode_bomb(); } return result; }
if ( num_input_strings == 6 ) { if ( sscanf(s, "%d %s", &v0, v1) == 2 && !strings_not_equal(v1, "austinpowers") ) { printf("Curses, you've found the secret phase!\n"); printf("But finding it and solving it are quite different...\n"); secret_phase(); } printf("Congratulations! You've defused the bomb!\n"); } }
int __cdecl phase_6(char *s) { int i; // edi int j; // ebx int k; // edi _DWORD *v4; // esi int l; // ebx int *v6; // esi int m; // edi int *v8; // eax int *v9; // esi int n; // edi int result; // eax int *v12; // [esp+24h] [ebp-34h] int v13[6]; // [esp+28h] [ebp-30h] int input[6]; // [esp+40h] [ebp-18h] BYREF
read_six_numbers(s, (int)input); for ( i = 0; i <= 5; ++i ) { if ( (unsignedint)(input[i] - 1) > 5 ) explode_bomb(); for ( j = i + 1; j <= 5; ++j ) { if ( input[i] == input[j] ) explode_bomb(); } } for ( k = 0; k <= 5; ++k ) { v4 = &node1; for ( l = 1; l < input[k]; ++l ) v4 = (_DWORD *)v4[2]; v13[k] = (int)v4; } v6 = (int *)v13[0]; v12 = (int *)v13[0]; for ( m = 1; m <= 5; ++m ) { v8 = (int *)v13[m]; v6[2] = (int)v8; v6 = v8; } v8[2] = 0; v9 = v12; for ( n = 0; n <= 4; ++n ) { result = *v9; if ( *v9 < *(_DWORD *)v9[2] ) explode_bomb(); v9 = (int *)v9[2]; } return result; }
Each bomb phase tests a different aspect of machine language programs: Phase 1:string comparison Phase 2:loops Phase 3:conditionals/switches Phase 4:recursive calls and the stack discipline Phase 5:pointers Phase 6:linked lists/pointers/structs