當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。