Skip to content

Instantly share code, notes, and snippets.

@ky28059
Created February 17, 2024 08:07
Show Gist options
  • Save ky28059/11bd9429d863a3f0e1e9f86579cfdc28 to your computer and use it in GitHub Desktop.
Save ky28059/11bd9429d863a3f0e1e9f86579cfdc28 to your computer and use it in GitHub Desktop.

LA CTF 2024 — gacha

All my friends have been getting into genshin and honkai recently and keep sending me pictures. However, they keep hiding their favorite characters, demanding for more money for their gacha pulls.

Can you free zhongli my waifu???

We're given three PNG files:

owo owo.png

uwu uwu.png

fiscl fiscl.png

The last one seems unrelated, but the first two are reminiscent of IslandParty. Writing a script to diff them and view the channels,

import cv2

owo = cv2.imread('owo.png')
uwu = cv2.imread('uwu.png')

res = owo - uwu

cv2.namedWindow('image', cv2.WINDOW_NORMAL)
cv2.imshow('image', res)
cv2.waitKey()

gacha2

(see any letters in the middle row?)

Amplifying the contrast a bit, we can make out a few more letters and...

image

...is that a x0r at the end of the flag?

XOR'ing the images together, we get the flag:

import cv2

owo = cv2.imread('owo.png')
uwu = cv2.imread('uwu.png')

res = owo ^ uwu

cv2.namedWindow('image', cv2.WINDOW_NORMAL)
cv2.imshow('image', res)
cv2.waitKey()

gacha

lactf{zh0ng_l7_x_ch7ld3_b4t_w7th_x0r}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment