본문 바로가기

[Wargame Write-up]/Yoire

[Yoire] [binary] conversion/0_chall_very_easy.php

2진수 변환문제이다.




8자씩 끊어서 한 글자씩 변환하는 식으로 코딩하면 되겠다.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#-*- encoding: utf-8 -*-
def main():
    encoded = ''.join("""0110110001100001001000000111001101
        101111011011000111010101100011011010011100001
        110110011011011100010000001100101011100110011
        101000100000011000010110010001100101011011000
        110000101101110011101000110010100100001
    """.split())
    result = ""
 
    for idx in range(0len(encoded), 8):
        result += chr(int(encoded[idx:idx+8], 2))
 
    print "[*] Decoded: " + result
 
if __name__ == '__main__':
    main()
cs



답은 이렇게 나오고




붙여넣으면




Clear~