diff --git a/reverse-engineering/cimg-animate/DESCRIPTION.md b/reverse-engineering/cimg-animate/DESCRIPTION.md index e69de29..70519a2 100644 --- a/reverse-engineering/cimg-animate/DESCRIPTION.md +++ b/reverse-engineering/cimg-animate/DESCRIPTION.md @@ -0,0 +1,3 @@ +Okay, the previous level was embarrassing, but those sorts of bugs happen all the time! +We fixed that issue in this level and, because we feel somewhat contrite about the bug, we're giving you the flag again... in an animated cIMG! +Good luck. diff --git a/reverse-engineering/cimg-animate/_0/generate_flag_cimg.py b/reverse-engineering/cimg-animate/_0/generate_flag_cimg.py new file mode 100755 index 0000000..40a288c --- /dev/null +++ b/reverse-engineering/cimg-animate/_0/generate_flag_cimg.py @@ -0,0 +1,26 @@ +#!/opt/pwn.college/python + +import subprocess +import random +import struct +import os + +raw_flag_lines = subprocess.check_output("/usr/bin/figlet < /flag", shell=True).split(b"\n") +max_line_length = max(len(line) for line in raw_flag_lines) +flag_lines = [ line.ljust(max_line_length) for line in raw_flag_lines ] + +flag_pixels = [ ] +for y,line in enumerate(flag_lines): + for x,c in enumerate(line): + flag_pixels += [ (x, y, c) ] +random.shuffle(flag_pixels) + +operations = [ ] +for p in flag_pixels: + operations += [ struct.pack("