http://www.csdn123.com/html/itweb/20131016/171124.htm
还是不成功,先mark。
Python灰帽子第五章对immunity debugger进行了简要的介绍和使用,这款软件同Ollydbg类似,在使用风格上也相当接近,不同之处在于对Python脚本的支持比较强大,
说一下初次使用Pycommands遇到的一点事:
按照书上的步骤,在第5.3节有一个搜寻指令的实例findinstruction.py
1 from immlibimport *
2 import immlib 3 4 def main(args): 5 6 imm = immlib.Debugger() 7 search_code = " ".join(args) 8 9 search_bytes = imm.assemble( search_code ) 10 search_results = imm.search( search_bytes ) 11 12 for hit in search_results: 13 14 # Retrieve the memory page where this hit exists 15 # and make sure it's executable 16 code_page = imm.getMemoryPageByAddress( hit ) 17 access = code_page.getAccess( human = True ) 18 19 if "execute" in access.lower(): 20 imm.log("[*] Found: %s (0x%08x)" % ( search_code, hit ), address = hit ) 21 22 23 return "[*] Finished searching for instructions, check the Log window."
这段代码是根据书上给的加上调试时最终修正的,书上的代码写于好几年以前,immunity版本更新后一些API就发生了变化,给出书上不同的代码做个对比:
search_bytes = imm.Assemble( search_code ) search_results = imm.Search( search_bytes ) code_page = imm.getMemoryPagebyAddress( hit )
可以看到,API虽然发生了变化,但是函数名(对象属性名称)没有变化,但是在大小写方面稍作了调整,而对于没有经验的人来说,当在下端的命令行输入:
!findinstruction jmp esp时,弹出的AttributrError:'Debugger' object has no attribute 'Assemble'却不知道怎么解决是很揪心的
最终hi百度上找到了一点点蛛丝马迹,尽管Python API仍没有找到:
Current v1.73 newer versions .Log .log .Assemble .assemble .Disassemble .disassemble .Search .search .getMemoryPagebyAddress .getMemoryPageByAddress
得知常见属性都相应做出了改变,要想自己编写脚本当然还得找到更多的API