当前位置: 首页>>代码示例>>Python>>正文


Python idaapi.COLSTR属性代码示例

本文整理汇总了Python中idaapi.COLSTR属性的典型用法代码示例。如果您正苦于以下问题:Python idaapi.COLSTR属性的具体用法?Python idaapi.COLSTR怎么用?Python idaapi.COLSTR使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在idaapi的用法示例。


在下文中一共展示了idaapi.COLSTR属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_disasm

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import COLSTR [as 别名]
def get_disasm(self, ea):
        disasm = []
        insns = self.get_disasm_internal(ea)

        for i in insns:
            if i != None:
                ea,ins,line,isret,strm = i
                strm = to_hex_str(strm)
                if isret:
                    color = idaapi.SCOLOR_CREFTAIL
                else:
                    color = idaapi.SCOLOR_CODNAME
                asm = idaapi.COLSTR("%s\n" % line, color)
                data = idaapi.COLSTR("%s\n" % strm, color)
            else:
                asm = idaapi.COLSTR("; invalid instruction \n", idaapi.SCOLOR_HIDNAME)
                data = ""
            disasm.append((asm, data))
        if len(disasm) == self.get_max_insn():
            cont = idaapi.COLSTR("...", idaapi.SCOLOR_HIDNAME)
            disasm.append((cont, cont))
        return disasm 
开发者ID:patois,项目名称:DrGadget,代码行数:24,代码来源:payload.py

示例2: create_colored_line

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import COLSTR [as 别名]
def create_colored_line(self, n):
        # todo
        item = self.get_item(n)
        if item != None:
            typ = item.type

            width = self.payload.proc.get_pointer_size()
            cline = idaapi.COLSTR("%04X  " % (n * width), idaapi.SCOLOR_AUTOCMT)
            ea = item.ea
            fmt = self.payload.proc.get_data_fmt_string()
            elem = fmt % ea
            if typ == Item.TYPE_CODE:
                color = idaapi.SCOLOR_CODNAME if SegStart(ea) != BADADDR else idaapi.SCOLOR_ERROR
                elem = idaapi.COLSTR(elem, color)
            else:
                elem = idaapi.COLSTR(elem, idaapi.SCOLOR_DNUM)
            cline += elem

            comm = ""
            if len(item.comment):
                comm += " ; %s" % item.comment
            if len(comm):
                cline += idaapi.COLSTR(comm, idaapi.SCOLOR_AUTOCMT)
            return cline 
开发者ID:patois,项目名称:DrGadget,代码行数:26,代码来源:ropviewer.py

示例3: warning_line

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import COLSTR [as 别名]
def warning_line(self, txt):
        return idaapi.COLSTR(txt, idaapi.SCOLOR_ERROR) 
开发者ID:danigargu,项目名称:heap-viewer,代码行数:4,代码来源:bingraph.py

示例4: chunk_info

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import COLSTR [as 别名]
def chunk_info(self, chunk_addr, chunk):
        line =  idaapi.COLSTR("Chunk ", idaapi.SCOLOR_NUMBER)
        line += idaapi.COLSTR("0x%x\n\n" % (chunk_addr), idaapi.SCOLOR_INSN)
        line += idaapi.COLSTR("size: 0x%x\nfd: 0x%x - %s" % \
                (chunk.size, chunk.fd, idc.get_segm_name(chunk.fd)), SCOLOR_DEFAULT)
        return line 
开发者ID:danigargu,项目名称:heap-viewer,代码行数:8,代码来源:bingraph.py

示例5: tcache_info

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import COLSTR [as 别名]
def tcache_info(self, entry_addr, chunk_addr):        
        line =  idaapi.COLSTR("entry: ", idaapi.SCOLOR_NUMBER)
        line += idaapi.COLSTR("0x%x\n" % (entry_addr), idaapi.SCOLOR_INSN)
        line += idaapi.COLSTR("chunk: ", idaapi.SCOLOR_NUMBER)
        line += idaapi.COLSTR("0x%x" % (chunk_addr), idaapi.SCOLOR_INSN)
        return line 
开发者ID:danigargu,项目名称:heap-viewer,代码行数:8,代码来源:bingraph.py

示例6: bin_info

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import COLSTR [as 别名]
def bin_info(self, node_title, chunk_addr, chunk, with_size=True):
        line =  idaapi.COLSTR("%s " % node_title, idaapi.SCOLOR_NUMBER)
        line += idaapi.COLSTR("0x%x\n\n" % chunk_addr, idaapi.SCOLOR_INSN)

        chunk_info = ""
        if with_size:
            chunk_info += "size: 0x%x\n" % chunk.size

        chunk_info += "fd: 0x%x - %s\nbk: 0x%x - %s" % (chunk.fd, \
            idc.get_segm_name(chunk.fd), chunk.bk, idc.get_segm_name(chunk.bk))

        line += idaapi.COLSTR(chunk_info, idaapi.SCOLOR_DEFAULT)
        return line 
开发者ID:danigargu,项目名称:heap-viewer,代码行数:15,代码来源:bingraph.py

示例7: from_ExprInt

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import COLSTR [as 别名]
def from_ExprInt(self, expr):
        return idaapi.COLSTR(str(expr), idaapi.SCOLOR_NUMBER) 
开发者ID:cea-sec,项目名称:miasm,代码行数:4,代码来源:utils.py

示例8: from_ExprId

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import COLSTR [as 别名]
def from_ExprId(self, expr):
        out = idaapi.COLSTR(str(expr), idaapi.SCOLOR_REG)
        return out 
开发者ID:cea-sec,项目名称:miasm,代码行数:5,代码来源:utils.py

示例9: from_ExprLoc

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import COLSTR [as 别名]
def from_ExprLoc(self, expr):
        if self.loc_db is not None:
            out = self.loc_db.pretty_str(expr.loc_key)
        else:
            out = str(expr)
        out = idaapi.COLSTR(out, idaapi.SCOLOR_REG)
        return out 
开发者ID:cea-sec,项目名称:miasm,代码行数:9,代码来源:utils.py

示例10: from_ExprMem

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import COLSTR [as 别名]
def from_ExprMem(self, expr):
        ptr = self.from_expr(expr.ptr)
        size = idaapi.COLSTR('@' + str(expr.size), idaapi.SCOLOR_RPTCMT)
        out = '%s[%s]' % (size, ptr)
        return out 
开发者ID:cea-sec,项目名称:miasm,代码行数:7,代码来源:utils.py

示例11: from_ExprSlice

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import COLSTR [as 别名]
def from_ExprSlice(self, expr):
        base = self.from_expr(expr.arg)
        start = idaapi.COLSTR(str(expr.start), idaapi.SCOLOR_RPTCMT)
        stop = idaapi.COLSTR(str(expr.stop), idaapi.SCOLOR_RPTCMT)
        out = "(%s)[%s:%s]" % (base, start, stop)
        return out 
开发者ID:cea-sec,项目名称:miasm,代码行数:8,代码来源:utils.py

示例12: color_irblock

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import COLSTR [as 别名]
def color_irblock(irblock, ir_arch):
    out = []
    lbl = idaapi.COLSTR("%s:" % ir_arch.loc_db.pretty_str(irblock.loc_key), idaapi.SCOLOR_INSN)
    out.append(lbl)
    for assignblk in irblock:
        for dst, src in sorted(viewitems(assignblk)):
            dst_f = expr2colorstr(dst, loc_db=ir_arch.loc_db)
            src_f = expr2colorstr(src, loc_db=ir_arch.loc_db)
            line = idaapi.COLSTR("%s = %s" % (dst_f, src_f), idaapi.SCOLOR_INSN)
            out.append('    %s' % line)
        out.append("")
    out.pop()
    return "\n".join(out) 
开发者ID:cea-sec,项目名称:miasm,代码行数:15,代码来源:graph_ir.py

示例13: as_changed

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import COLSTR [as 别名]
def as_changed(self, s):
        return idaapi.COLSTR(s, idaapi.SCOLOR_CREFTAIL) 
开发者ID:danigargu,项目名称:deREferencing,代码行数:4,代码来源:registers.py

示例14: as_stack

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import COLSTR [as 别名]
def as_stack(self, s):
        return idaapi.COLSTR(s, idaapi.SCOLOR_SEGNAME) 
开发者ID:danigargu,项目名称:deREferencing,代码行数:4,代码来源:colorizer.py

示例15: as_heap

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import COLSTR [as 别名]
def as_heap(self, s):
        return idaapi.COLSTR(s, idaapi.SCOLOR_VOIDOP) 
开发者ID:danigargu,项目名称:deREferencing,代码行数:4,代码来源:colorizer.py


注:本文中的idaapi.COLSTR属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。