IDApython0


ea=idc.ScreenEA() #method1
print "current addr:0x%x %s"%(ea,ea)
ea=here()         #method2
print "current addr:0x%x %s"%(ea,ea)

print hex(MaxEA()) #get max addr of all the sections
print hex(MinEA()) #get min addr of all the sections

ea=here()             #熟悉指令,其实就是将已存在的在复原打印一遍
seg=idc.SegName(ea)   #获取segment  name    
mnem=idc.GetMnem(ea)  #助记符获取(操作符)
op0=idc.GetOpnd(ea,0) #第一个操作数获取
op1=idc.GetOpnd(ea,1) #第二个操作数获取
print "%s:%x  %s  %s,%s"%(seg,ea,mnem,op0,op1)


Python>idaapi.BADADDR
4294967295
Python>hex(idaapi.BADADDR)
0xffffffffL
if BADADDR!=ea:
    print "ERROR"
for seg in idautils.Segments():
    print "following is all segments info:"
    print idc.SegName(seg)
    print idc.SegStart(seg)
    print idc.SegEnd(seg)

for func in idautils.Functions():
    print "you can get a list of func:"
    print hex(func),idc.GetFunctionName(func)

posted @ 2020-09-27 15:40  zer0_1s  阅读(117)  评论(0编辑  收藏  举报