model.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:IMF 作者: SoftSec-KAIST 项目源码 文件源码
def mut(value, ty):
    nty = ''
    if ty in ['io_string_t', 'io_name_t']:
        ret = '{'
        for x in value[1:-1].split(','):
            ret += 'mut_byte(%s),'%x
        ret = ret[:-1]+'}'
        return ret
    elif '*' in ty or ty in const.TYPE_PTR:
        nty = 'ptr'
    elif ty in const.TYPE_SIZE:
        size = const.TYPE_SIZE[ty]
        if size == 1:
            nty = 'byte'
        elif size == 2:
            nty = 'short'
        elif size == 4:
            nty = 'int'
        elif size == 8:
            nty = 'long'
    if nty == '':
        utils.error('mut error : %s'%ty)

    return '(%s) mut_%s(%s)'%(ty, nty, str(value))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号