Popular Posts
Most visited articles this period
Latest Posts
Fresh thoughts and recent updates from the blog
tistory view
728x90
반응형

file.txt 파일을 열면 그냥 아래와 같이 19836 줄의 괄호로 둘러쌓인 무언가가 나옵니다.
(0,0,195,195,195)
(0,1,195,195,195)
(0,2,195,195,195)
(0,3,195,195,195)
(0,4,195,195,195)
(0,5,195,195,195)
(0,6,195,195,195)
(0,7,195,195,195)
...중략...
(37,521,195,195,195)
딱 보아도 x, y, r, g b 값일 것 같았습니다. 그래서 도박하는 생각으로 그냥 코드로 해당 x와 y 지점에 주어진 RGB 값을 입력하게 해보았습니다.
결과 코드는 다음과 같습니다.
import cv2 as cv
img = cv.imread('blank.png')
file =open('file.txt','r')
line = file.read().split('\n')
i = 0
for x in range(38):
for y in range(522):
rgb = line[i].split("(")[1].split(")")[0]
try:
img[x,y][0] = rgb.split(",")[4]
img[x,y][1] = rgb.split(",")[3]
img[x,y][2] = rgb.split(",")[2]
except:
pass
i +=1
cv.imshow('flag',img)
cv.waitKey(0)

혹시나 No module named 'cv2' 오류가 나신다면 opencv 라이브러리가 python에 설치되어 있지 않은 것인지 확인 해보시고 설치가 되어 있지 않다면 설치 해줘야합니다. 설치 명령어는 다음과 같습니다. cv2 가 아니라 opencv-python 으로 해줘야 합니다.
C:\Users\domdomi>pip install opencv-python
Requirement already satisfied: opencv-python in c:\python39\lib\site-packages (4.5.3.56)
Requirement already satisfied: numpy>=1.19.3 in c:\python39\lib\site-packages (from opencv-python) (1.21.2)
WARNING: You are using pip version 21.1.3; however, version 21.2.4 is available.
You should consider upgrading via the 'c:\python39\python.exe -m pip install --upgrade pip' command.
728x90
반응형
'Security > CTF' 카테고리의 다른 글
| [Web] Recovery - 2021 Tamil CTF Writeup (0) | 2021.09.30 |
|---|---|
| [Web] GS25 - 2021 CCE Quals CTF Writeup (0) | 2021.09.29 |
| [Forensics] 코로나바이러스 대응 긴급조회 - 2021 INCOGNITO CTF Writeup (0) | 2021.08.31 |
| [Forensics] data_collector - 2021 INCOGNITO CTF Writeup (0) | 2021.08.31 |
| [Reversing] Leap - 2021 INCOGNITO CTF Writeup (0) | 2021.08.31 |
Comments
Visitor Trends
Daily blog stats and creator awards
✿ DASHBOARD
Today
Yesterday
Total
Posts
0
2023
IT Creator
2024
Food Creator
2025
News Creator
2026
News Creator