【转】immunity debugger Pycmmands添加模块--Python灰帽子

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


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值