728x90
def mystery_peace(file_path):
try:
with open(file_path, 'rb') as file:
file.seek(-26, 2)
data = bytearray(file.read(26))
if len(data) != 26:
raise ValueError("Error: Not enough data found in the file")
for i in range(6, 14):
data[i] = (data[i] - 0x5) & 0xFF
data[14] = (data[14] + 0x3) & 0xFF
result = data.decode('utf-8')
return result
except FileNotFoundError:
print("Error: File not found")
return None
except ValueError as ve:
print(ve)
return None
except Exception as e:
print(f"An unexpected error occurred: {e}")
return None
mystery_file = 'mystery.png'
flag = mystery_peace(mystery_file)
if flag:
print("Extracted Flag:", flag)
728x90
'호그와트' 카테고리의 다른 글
모든 스도쿠의 신 (0) | 2024.06.02 |
---|---|
tryhackme anthem (0) | 2024.06.02 |
타비의 싹싹김치는 오늘도 참새를 부른다 (0) | 2024.05.30 |
국힙원탑 쿠모린~ (1) | 2024.05.30 |
have_you_ever_eaten_the_penguin's_meat? (0) | 2024.05.28 |