2진수를 문자열로 변환하는 문제이다.
간단히 함수로 만들었다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | import os # n-ary mode: (key, value) combination: (mode name, [step, n]) MODE = { "bin" : [8, 2], "hex" : [2, 16] } def nary2str(target, mode): result = "" for idx in range(0, len(target), MODE[mode][0]): result += chr(int(target[idx:idx+MODE[mode][0]], MODE[mode][1])) return result def main(): os.system("cls") print("\nAnswer: " + nary2str("01100100011001010110110000100000011100100110010101110110001000000110010101010011", "bin")) if __name__ == '__main__': main() | cs |
정답은 이렇게 나오고
붙여넣으면
Clear~
'[Wargame Write-up] > Yoire' 카테고리의 다른 글
[Yoire] [hexadecimal] conversion/1_chall_easy.php (0) | 2017.03.07 |
---|---|
[Yoire] [hexadecimal] conversion/0_chall_very_easy.php (0) | 2017.03.06 |
[Yoire] [reversing] pe.stage2/01_crackme_very_easy.php (0) | 2017.03.06 |
[Yoire] [reversing] pe/05_crackme_very_hard.php (0) | 2017.03.05 |
[Yoire] [reversing] pe/04_crackme_hard.php (0) | 2017.03.05 |