Ejemplo n.º 1
0
        def fn_read(cls, address, key=None, repeatable=1):
            address = idc.GetFunctionAttr(address, idc.FUNCATTR_START)
            if address == idc.BADADDR:
                raise ValueError("Address %x not in function"% address)

            result = comment.toDict(idc.GetFunctionCmt(int(address), repeatable))
            if '__name__' not in result:
                result['__name__'] = idc.GetFunctionName(address)

            if '__address__' not in result:
                result['__address__'] = address

            if key is not None:
                return result[key]
            return result
Ejemplo n.º 2
0
        def db_read(cls, address, key=None, repeatable=0):
            result = comment.toDict( idc.GetCommentEx(address, repeatable) )

            name = idc.NameEx(address, address)
            if name:
                result['__name__'] = name

            # defaults
            if '__color__' not in result:
                c = cls.color(address)
                if c is not None:
                    result['__color__'] = c
            if '__address__' not in result:
                result['__address__'] = address

            if '__context__' not in result:
                result['__context__'] = idc.GetFunctionAttr(address, idc.FUNCATTR_START)
            if '__sp__' not in result:
                result['__sp__'] = idc.GetSpd(address)

            if key is not None:
                return result[key]
            return result