Immunity Debugger使用基础

标签:
immunitydebuggerpycommandsit |
分类: 测试之魂 |
最近在学习《灰冒python》,用到了Immunity
Debugger,刚开始用它,感觉不知如何下手,而且很多功能是基于python的,找了些资料,发现他很强大,在你调试,分析漏洞,编写漏洞代码时非常方便。
这是一篇不错的文章,虽然是E文。
http://www.h4ck.org.cn/2012/08/starting-to-write-immunity-debugger-pycommands-my-cheatsheet-『rw』/
下面是我整理的代码,可以再pycommands下使用。
from immlib import *
import re
imm = Debugger()
def usage():
imm.log(" ** No arguments specified ** ",focus=1,
highlight=1)
imm.log(" Usage : ",focus=1, highlight=1)
imm.log("
blah blah",focus=1, highlight=1)
def tohex(intAddress):
return "X" %
intAddress
def main(args):
if not
args:
usage()
#print
"Number of arguments : " + str(len(args))
imm.log("Number of arguments : %d " % len(args))
cnt=0
while (cnt
< len(args)):
imm.log(" Argument %d : %s" % (cnt+1,args[cnt]))
if (args[cnt] == "test"):
imm.log(" You said %s !" % (args[cnt]),focus=1,
highlight=1)
cnt=cnt+1
#create
table
table=imm.createTable('Argument table',['Number','Argument'])
imm.log("Number of arguments : %d " % len(args))
cnt=0
while (cnt
< len(args)):
table.add(0,["%d"%(cnt+1),"%s"%(args[cnt])])
cnt=cnt+1
#integer
address
myAddress=1234567 #this integer's address
imm.log("
Integer
: %d " % myAddress,address=myAddress)
imm.log("
Readable hex
: 0xX" % myAddress,address=myAddress)
hexAddress =
tohex(myAddress)
imm.log("
Readable string : 0x%s" % hexAddress,address=myAddress)
imm.log("
Back to integer : %d" %
int(hexAddress,16),address=int(hexAddress,16))
#assemble
and disassemble and searchjing memory
if
(args[0]=="assemble"):
if (len(args) < 2):
imm.log(" Usage : !plugin1 compare
instructions")
imm.log("
separate multiple instructions with #")
else:
cnt=1
cmdInput=""
while (cnt < len(args)):
cmdInput=cmdInput+args[cnt]+" "
这是一篇不错的文章,虽然是E文。
http://www.h4ck.org.cn/2012/08/starting-to-write-immunity-debugger-pycommands-my-cheatsheet-『rw』/
下面是我整理的代码,可以再pycommands下使用。
from immlib import *
import re
imm = Debugger()
def usage():
def tohex(intAddress):
def main(args):