prepare the tools (176 pts)



Last updated



Last updated
content = open("message.txt", "r").read()
msg = ""
# using the format flag[xxxx]y
# look for xxxx, add the y to msg
for i in range(10000):
search_string = f"flag[{i:04}]"
print(search_string)
index = content.find(search_string)
if index != -1 and ((index + len(search_string)) < len(content)):
msg += content[index+len(search_string)]
else:
print("searching is completed")
break
result = open("result.txt", "w")
result.write(msg)