//a good crackme tool,usr ptrace to debug the need-crack file
//from tiocsti's solution to yanisto's tiny crackme,url:
//added some comments
#include #include #include #include #include #include #include #include int handle_ptrace_singlestep(pid_t pid, file *fp)
int handle_ptrace_syscall(pid_t pid, file *fp)
//檢測到read系統呼叫完成了
else if(regs.orig_eax == __nr_read && regs.ebx == 1 && regs.eax == 4)
//將映象檔案寫入完畢
//作者選擇在這個位置開始dump出映象檔案,如果不行就得選其他地方:)
fclose(outputfile);
//ptrace_syscall,在執行一條指令後停止
ptrace(ptrace_singlestep, pid, 0, 0);
return 1;
}//繼續執行一次ptrace_syscall
ptrace(ptrace_syscall, pid, 0, 0);
return 0;
}int main(int argc, char **ar**)
wait(null);
//通過傳送0檢查程序是否存在
if(kill(mypid, 0) == -1)
//ptrace_syscall,在每個系統呼叫進入/退出時停止
ptrace(ptrace_syscall, mypid, 0, 0);
while(1)
if(state == 0)
//首先,執行去除anti-ptrace的**
//然後,檢測到read syscall後生成dump檔案
state=handle_ptrace_syscall(mypid, fp);
else
//第三,才是開始跟蹤read呼叫後的每乙個指令
state=handle_ptrace_singlestep(mypid, fp);}}
}
乙個簡單的lua除錯工具
最近看起了lua的debug庫,想著可以簡單弄個跟gdb這樣的命令列除錯工具,於是花了幾天時間,搞了個相當簡單的除錯工具,實現了簡單的列印和斷點和下一步的功能 修改變數值的實現方式其實跟列印的操作並沒有很大區別,所以就懶得弄啦 雖然 很粗糙,使用和體驗上也相當奇葩,也勉強把,畢竟也達到了學學習,動動...
介紹乙個node除錯工具 nodemon
這個工具和node supervisor基本上是一致的,但是其功能比較強大,個人覺得在開發環境還是用 nodemon,因為配置比較方便,文件也很清晰。所以這裡先主要講 nodemon。nodemon 的安裝 npm install g nodemon安裝完 nodemon 後,就可以用 nodemo...
分享乙個「貧民版」除錯工具 PySnooper
一般情況下,在編寫 python 時,如果想弄清楚為什麼 python 沒有按照預期執行的原因,比如你想知道哪些是正在執行,哪些沒有執行,以及區域性變數的值是什麼.通常我們會使用包含斷點和觀察模式等功能成熟的偵錯程式,或者直接使用 print 語句列印出來。今天,猿妹和大家分享乙個 貧民版 除錯工具...