picoCTF 2021 writeup (Reversing)

picoCTF 2021 の Rev 問題の Writeup.
難易度 medium のみ

crackme-py

decode_secret(bezos_cc_secret)
        

keygenme-py

sha_key = hashlib.sha256(bUsername_trial).hexdigest()
trial_key = key_part_static1_trial + sha_key[4] + sha_key[5] + sha_key[3] + sha_key[6] + sha_key[2] + sha_key[7] + sha_key[1] + sha_key[8] + "}"
        

Shop

from pwn import *

host = "mercury.picoctf.net"
port = 37799

sh = remote(host, port)

prompt = sh.recvuntil("option:")
print(prompt.decode())
sh.sendline("0".encode())
sh.sendline("-100".encode())

prompt = sh.recvuntil("option:")
print(prompt.decode())

sh.sendline("2".encode())
sh.sendline("-100".encode())

prompt = sh.recvuntil("is:")
print(prompt.decode())

flag_list = sh.recvline().decode().split()

flag = ""
for ch_hex in flag_list:
    flag += chr(int(ch_hex.lstrip("[").rstrip("]")))

print("flag:", flag)

sh.interactive()
        

speeds and feeds

picorev image

ARMssembly0

ARMssembly1

w0 = 7
w1 = 79
w1 = w1 << w0

w0 = 3
w1 = w1 // w0

print("flag:", hex(w1)[2::])