BUUCTF Reverse [QCTF2018]Xman-babymips

拖进ida

本题逻辑比较简单,可以采用爆破的方式获取flag。

flag = "qctf{"
keys = [0x52, 0xFD, 0x16, 0xA4, 0x89, 0xBD, 0x92, 0x80,
0x13, 0x41, 0x54, 0xA0, 0x8D, 0x45, 0x18, 0x81,  0xDE, 0xFC, 0x95, 0xF0, 0x16, 0x79, 0x1A, 0x15,
0x5B, 0x75, 0x1F]
print len(keys)
for i in xrange(5,0x20):
    for c in xrange(0,0x100):
        fst = (c ^ ((0x20-i)))
        if (i % 2) == 0:
            res = ((fst << 2) % 0x100) | (fst >> 6)
        else:
            res = (fst >> 2) | ((fst << 6) % 0x100)
        if (res == keys[i-5]):
            flag += chr(c)

print flag

qctf{ReA11y_4_B@89_mlp5_4_XmAn_}

posted @ 2021-05-13 21:33  Sk2rw  阅读(325)  评论(0编辑  收藏  举报