[2019红帽杯]easyRE
一、查壳
无壳,64位
二、IDA分析
在函数表中些搜索不到main,就shife+f12字符串搜索。
终于看见有用的了,点进去。
发现是sub_4009C6函数中引用了,再点进去。
很好,菜狗我不会了,看看网上大佬的wp吧(手动流泪)
我的天哪,不看不知道一看吓一跳!!
这个题竟然还有坑!!!
由于有网上大佬们的帮助,我在这里直接跳过坑(开心开心)
这还是sub_4009C6里面的内容
#v1的值是上面的绿色字符转化而来v1[1] = 111v1[2] = 100v1[3] = 108v1[4] = 62v1[5] = 81v1[6] = 110v1[7] = 98v1[8] = 40v1[9] = 111v1[10] = 99v1[11] = 121v1[12] = 127v1[13] = 121v1[14] = 46v1[15] = 105v1[16] = 127v1[17] = 100v1[18] = 96v1[19] = 51v1[20] = 119v1[21] = 125v1[22] = 119v1[23] = 101v1[24] = 107v1[25] = 57v1[26] = 123v1[27] = 105v1[28] = 121v1[29] = 61v1[30] = 126v1[31] = 121v1[32] = 76v1[33] = 64v1[34] = 69v1[35] = 67flag=""for i in range(36):flag+=chr(v1[i]^i)print(flag)-------------------------Info:The first four chars are `flag`
sub_4009C6里面的内容往下看
这一部分就是base64加密的坑,解开也没有用
好,再往下看
点off_6CC090
发现他下面还有byte_6CC0A0(shife+e提取数据)的引用函数sub_400D35函数
所以写脚本
enc = [0x40,0x35,0x20,0x56,0x5D,0x18,0x22,0x45,0x17,0x2F,0x24,0x6E,0x62,0x3C,0x27,0x54,0x48,0x6C,0x24,0x6E,0x72,0x3C,0x32,0x45,0x5B]key = ""flag = ""en = "flag"for i in range(4):key+=chr(enc[i]^ord(en[i]))print(key)for j in range(len(enc)):flag+=chr(enc[j]^ord(key[j%4]))print(flag)-----------------------flag{Act1ve_Defen5e_Test}
最后我借鉴得大佬的文章:
BUUCTF-[2019红帽杯]easyRE(Reverse逆向)-----是乙太呀