Skip to content

Instantly share code, notes, and snippets.

@SiD3W4y
Last active April 3, 2017 08:54
Show Gist options
  • Save SiD3W4y/76377a1fdc41d11c4f24cc0efefa3b08 to your computer and use it in GitHub Desktop.
Save SiD3W4y/76377a1fdc41d11c4f24cc0efefa3b08 to your computer and use it in GitHub Desktop.
Code to compute the flag reversed from the challenge binary (alexctf)
# Flag used to build the final one
flag = "L3t_ME_T3ll_Y0u_S0m3th1ng_1mp0rtant_A_{FL4G}_W0nt_b3_3X4ctly_th4t_345y_t0_c4ptur3_H0wev3r_1T_w1ll_b3_C00l_1F_Y0u_g0t_1t"
# Code table made of indices (used with the first flag)
table = [36, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 54, 0, 0, 0, 101, 0, 0, 0, 7, 0, 0, 0, 39, 0, 0, 0, 38, 0, 0, 0, 45, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 86, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 101, 0, 0, 0, 3, 0, 0, 0, 45, 0, 0, 0, 22, 0, 0, 0, 2, 0, 0, 0, 21, 0, 0, 0, 3, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 1, 0, 0, 0, 68, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0]
"""
Using this code table (dumped from memory)
0x24 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x05 0x00 0x00 0x00 0x36 0x00 0x00 0x00
0x65 0x00 0x00 0x00 0x07 0x00 0x00 0x00
0x27 0x00 0x00 0x00 0x26 0x00 0x00 0x00
0x2d 0x00 0x00 0x00 0x01 0x00 0x00 0x00
0x03 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x0d 0x00 0x00 0x00 0x56 0x00 0x00 0x00
0x01 0x00 0x00 0x00 0x03 0x00 0x00 0x00
0x65 0x00 0x00 0x00 0x03 0x00 0x00 0x00
0x2d 0x00 0x00 0x00 0x16 0x00 0x00 0x00
0x02 0x00 0x00 0x00 0x15 0x00 0x00 0x00
0x03 0x00 0x00 0x00 0x65 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x29 0x00 0x00 0x00
0x44 0x00 0x00 0x00 0x44 0x00 0x00 0x00
0x01 0x00 0x00 0x00 0x44 0x00 0x00 0x00
0x2b 0x00 0x00 0x00
"""
buff = ""
for i in range(int(len(table)/4)-1):
buff += flag[table[i*4]]
print("Final flag : ",buff)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment