南邮CTF——逆向
第一題:Hello,RE!
所以:這道題的flag是flag{Welcome_To_RE_World!}
?
?第二題:ReadAsm2
一篇寫的很好的博客:https://blog.csdn.net/xiangshangbashaonian/article/details/78881498
?
第三題:Py交易
使用pyc反編譯工具:https://tool.lu/pyc/?得到py源碼。
在notepad++上編寫py逆向代碼
import base64
correct = 'XlNkVmtUI1MgXWBZXCFeKY+AaXNt'
s=base64.b64decode(correct) ? ? ? ? ? ? ? ? #Base64解密
print(s)
b=''
for i in range(len(s)): ? ? ? ? ? ? ? ? ? ? ?
? ?x=(ord(s[i])-16)^32 ? ? ? ? ? ? ? ? ? ? ?#將代碼倒過來寫
? ?b+=chr(x)
print(b)
運行得:nctf{d3c0mpil1n9_PyC}
?只有Python3的好像運行不了。
?
第四題:WxyVM
用IDA打開 ,main()函數(shù),sub_4005B6() 改變了輸入的flag
進(jìn)入sub_4005B6()
(回到Main()函數(shù))之后,改變了的604B80(flag),又與601060處的比較,如果相等則為正確。
所以,入手點就是 601060處的數(shù)據(jù) 和 6010C0處的數(shù)據(jù) 。
解題思路:把 sub_4005B6()?逆向編程,代入 601060 和 6010C0 處數(shù)據(jù) 編譯后 輸出。。。
分析程序,發(fā)現(xiàn)需要14997Byte的數(shù)據(jù)(只玩過幾行程序的我 驚訝。。。),于是博客一波,Get到 IDC編程 (IDA里的內(nèi)置腳本語言),可以直接訪問地址。
IDC編程推薦博客 ——?http://www.cnblogs.com/gwind/p/8250842.html
Shift+F2 打開IDC腳本編譯框。?
附:ZSky-T? 這位的源碼 和 flag:nctf{Embr4ce_Vm_j0in_R3}
#include <idc.idc> static main() {auto v0,result,i,v3;auto addr_fuzhu = 0X6010C0;for(i = 14997; i >= 0 ; i -= 3){v0 = Byte(addr_fuzhu + i);v3 = Byte(addr_fuzhu + i + 2);result = v0;if(v0 == 1){result = Byte(addr_fuzhu + i +1);PatchByte(0X601060 + result*4 ,(Byte(0X601060 + result*4) - v3));}if(v0 == 2){result = Byte(addr_fuzhu + i + 1);PatchByte(0X601060 + result*4 , (Byte(0X601060 + result*4) + v3));}if(v0 == 3){result = Byte(addr_fuzhu + i + 1);PatchByte(0X601060 + result*4, (Byte(0X601060 + result*4) ^ v3));}if(v0 == 4){result = Byte(addr_fuzhu + i + 1);PatchByte(0X601060 + result*4, (Byte(0X601060 + result*4) / v3));}if(v0 == 5){result = Byte(addr_fuzhu + i + 1);PatchByte(0X601060 + result*4, (Byte(0X601060 + result*4) ^ Byte(0X601060 + 4*v3)));}}for(i=0 ; i<24 ; i++){Message("%c",Byte(0X601060 + i * 4));} }另一種解法:https://blog.csdn.net/tu_siji/article/details/80220307? 把數(shù)據(jù)提取出來存放在文件里,再寫代碼
?
第五題:maze
?
?
第六題:WxyVM2
?
總結(jié)
- 上一篇: 计算机的数制
- 下一篇: Java 内存溢出(一)原因、复现、排查