0x00000000004011bf +0>: push %rbx
0x00000000004011c0 <+1>: mov %rdi,%rbx
0x00000000004011c3 <+4>: callq 0x401414 <string_length>
0x00000000004011c8 <+9>: cmp $0x6,%eax //6 letter string!
0x00000000004011cb <+12>: je 0x4011d2 <phase_5+19> //if 6, jump over the explode
0x00000000004011cd <+14>: callq 0x401706 <explode_bomb>
0x00000000004011d2 <+19>: mov %rbx,%rax
0x00000000004011d5 <+22>: lea 0x6(%rbx),%rdi
0x00000000004011d9 <+26>: mov $0x0,%ecx
0x00000000004011de <+31>: movzbl (%rax),%edx
0x00000000004011e1 <+34>: and $0xf,%edx //”and” each letter
0x00000000004011e4 <+37>: add 0x402780(,%rdx,4),%ecx
0x00000000004011eb <+44>: add $0x1,%rax
0x00000000004011ef <+48>: cmp %rdi,%rax //compare, and then loop again.
0x00000000004011f2 <+51>: jne 0x4011de <phase_5+31> //loop!
0x00000000004011f4 <+53>: cmp $0x2c,%ecx //final compare, and then done! (0x2c = 44)
0x00000000004011f7 <+56>: je 0x4011fe <phase_5+63> //jump over explode, and finish!
0x00000000004011f9 <+58>: callq 0x401706 <explode_bomb>
0x00000000004011fe <+63>: pop %rbx
0x00000000004011ff <+64>: retq
문자 6개를 받아서 막막막 돌아서
a = string_length(param1);
if (a != 6) {
explode_bomb();
}
b = 0;
a = 0;
do {
a_1 = a;
c = *(unsigned char*)(param1 + a_1);
b += array.3417[(c & 0xf)];
a = a_1 + 1;
} while (a_1 + 1 != 6);
if (b != 44) {
explode_bomb();
}
return;
}
이런느낌으로
여기서 합이 44가 되야 하는거같은데
아스키 코드에서 하위4비트보는거 같아서
하위 4비트만 보면 a=1이라서
합 44가 되는 dfghij 했는데 아니더라고.. 어디서 잘못된걸까
여기 csapp 보는사람 없어 코톡가야돼
코톡이어디야?
구글로