示例#1
0
文件: sem.py 项目: vardyh/miasm
def bc1t(ir, instr, a, b):
    e = []
    n = ExprId(ir.get_next_break_label(instr))
    dst_o = ExprCond(a, b, n)
    e = [ExprAff(PC, dst_o)]
    e.append(ExprAff(ir.IRDst, dst_o))
    return e, []
示例#2
0
文件: sem.py 项目: vardyh/miasm
def bgtz(ir, instr, a, b):
    e = []
    n = ExprId(ir.get_next_break_label(instr))
    cond = ExprCond(a, ExprInt1(1), ExprInt1(0)) | a.msb()
    dst_o = ExprCond(cond, n, b)
    e = [ExprAff(PC, dst_o), ExprAff(ir.IRDst, dst_o)]
    return e, []
示例#3
0
文件: sem.py 项目: vardyh/miasm
def jalr(ir, instr, a, b):
    e = []
    n = ExprId(ir.get_next_break_label(instr))
    e.append(ExprAff(PC, a))
    e.append(ExprAff(ir.IRDst, a))
    e.append(ExprAff(b, n))
    return e, []
示例#4
0
文件: sem.py 项目: 13572293130/miasm
def jalr(ir, instr, a, b):
    e = []
    n = ExprId(ir.get_next_break_label(instr))
    e.append(ExprAff(PC, a))
    e.append(ExprAff(ir.IRDst, a))
    e.append(ExprAff(b, n))
    return e, []
示例#5
0
文件: sem.py 项目: pmarkowsky/miasm
def bc1f(ir, instr, a, b):
    e = []
    n = m2_expr.ExprId(ir.get_next_break_label(instr))
    dst_o = m2_expr.ExprCond(a, n, b)
    e = [m2_expr.ExprAff(PC, dst_o)]
    e.append(m2_expr.ExprAff(ir.IRDst, dst_o))
    return e, []
示例#6
0
文件: sem.py 项目: 13572293130/miasm
def bc1t(ir, instr, a, b):
    e = []
    n = ExprId(ir.get_next_break_label(instr))
    dst_o = ExprCond(a, b, n)
    e = [ExprAff(PC, dst_o)]
    e.append(ExprAff(ir.IRDst, dst_o))
    return e, []
示例#7
0
文件: sem.py 项目: pmarkowsky/miasm
def bal(ir, instr, a):
    e = []
    n = m2_expr.ExprId(ir.get_next_break_label(instr))
    e.append(m2_expr.ExprAff(PC, a))
    e.append(m2_expr.ExprAff(ir.IRDst, a))
    e.append(m2_expr.ExprAff(RA, n))
    return e, []
示例#8
0
文件: sem.py 项目: 13572293130/miasm
def bgez(ir, instr, a, b):
    e = []
    n = ExprId(ir.get_next_break_label(instr))
    dst_o = ExprCond(a.msb(), n, b)
    e = [ExprAff(PC, dst_o),
         ExprAff(ir.IRDst, dst_o)
     ]
    return e, []
示例#9
0
文件: sem.py 项目: 13572293130/miasm
def bne(ir, instr, a, b, c):
    e = []
    n = ExprId(ir.get_next_break_label(instr))
    dst_o = ExprCond(a-b, c, n)
    e = [ExprAff(PC, dst_o),
         ExprAff(ir.IRDst, dst_o)
    ]
    return e, []
示例#10
0
文件: sem.py 项目: pmarkowsky/miasm
def jal(ir, instr, a):
    "Jumps to the calculated address @a and stores the return address in $RA"
    e = []
    n = m2_expr.ExprId(ir.get_next_break_label(instr))
    e.append(m2_expr.ExprAff(PC, a))
    e.append(m2_expr.ExprAff(ir.IRDst, a))
    e.append(m2_expr.ExprAff(RA, n))
    return e, []
示例#11
0
文件: sem.py 项目: 13572293130/miasm
def bgtz(ir, instr, a, b):
    e = []
    n = ExprId(ir.get_next_break_label(instr))
    cond = ExprCond(a, ExprInt1(1), ExprInt1(0)) | a.msb()
    dst_o = ExprCond(cond, n, b)
    e = [ExprAff(PC, dst_o),
         ExprAff(ir.IRDst, dst_o)
     ]
    return e, []
示例#12
0
文件: sem.py 项目: pmarkowsky/miasm
def bltz(ir, instr, a, b):
    """Branches on @b if the register @a is less than zero"""
    e = []
    n = m2_expr.ExprId(ir.get_next_break_label(instr))
    dst_o = m2_expr.ExprCond(a.msb(), b, n)
    e = [m2_expr.ExprAff(PC, dst_o),
         m2_expr.ExprAff(ir.IRDst, dst_o)
    ]
    return e, []
示例#13
0
文件: sem.py 项目: pmarkowsky/miasm
def jalr(ir, instr, a, b):
    """Jump to an address stored in a register @a, and store the return address
    in another register @b"""
    e = []
    n = m2_expr.ExprId(ir.get_next_break_label(instr))
    e.append(m2_expr.ExprAff(PC, a))
    e.append(m2_expr.ExprAff(ir.IRDst, a))
    e.append(m2_expr.ExprAff(b, n))
    return e, []
示例#14
0
文件: sem.py 项目: pmarkowsky/miasm
def beq(ir, instr, a, b, c):
    "Branches on @c if the quantities of two registers @a, @b are equal"
    e = []
    n = m2_expr.ExprId(ir.get_next_break_label(instr))
    dst_o = m2_expr.ExprCond(a-b, n, c)
    e = [m2_expr.ExprAff(PC, dst_o),
         m2_expr.ExprAff(ir.IRDst, dst_o)
     ]
    return e, []
示例#15
0
文件: sem.py 项目: pmarkowsky/miasm
def bgez(ir, instr, a, b):
    """Branches on @b if the quantities of register @a is greater than or equal
    to zero"""
    e = []
    n = m2_expr.ExprId(ir.get_next_break_label(instr))
    dst_o = m2_expr.ExprCond(a.msb(), n, b)
    e = [m2_expr.ExprAff(PC, dst_o),
         m2_expr.ExprAff(ir.IRDst, dst_o)
     ]
    return e, []
示例#16
0
文件: sem.py 项目: pmarkowsky/miasm
def bgtz(ir, instr, a, b):
    """Branches on @b if the register @a is greater than zero"""
    e = []
    n = m2_expr.ExprId(ir.get_next_break_label(instr))
    cond = m2_expr.ExprCond(a, m2_expr.ExprInt1(1),
                            m2_expr.ExprInt1(0)) | a.msb()
    dst_o = m2_expr.ExprCond(cond, n, b)
    e = [m2_expr.ExprAff(PC, dst_o),
         m2_expr.ExprAff(ir.IRDst, dst_o)
     ]
    return e, []
示例#17
0
文件: sem.py 项目: 0xf1sh/miasm
def beq(arg1, arg2, arg3):
    "Branches on @arg3 if the quantities of two registers @arg1, @arg2 are eq"
    dst = ExprId(ir.get_next_break_label(instr)) if arg1 - arg2 else arg3
    PC = dst
    ir.IRDst = dst
示例#18
0
文件: sem.py 项目: 0xf1sh/miasm
def bgez(arg1, arg2):
    """Branches on @arg2 if the quantities of register @arg1 is greater than or
    equal to zero"""
    dst = ExprId(ir.get_next_break_label(instr)) if arg1.msb() else arg2
    PC = dst
    ir.IRDst = dst
示例#19
0
文件: sem.py 项目: 0xf1sh/miasm
def bne(arg1, arg2, arg3):
    """Branches on @arg3 if the quantities of two registers @arg1, @arg2 are NOT
    equal"""
    dst = arg3 if arg1 - arg2 else ExprId(ir.get_next_break_label(instr))
    PC = dst
    ir.IRDst = dst
示例#20
0
def bltz(arg1, arg2):
    """Branches on @arg2 if the register @arg1 is less than zero"""
    dst_o = arg2 if arg1.msb() else ExprId(ir.get_next_break_label(instr))
    PC = dst_o
    ir.IRDst = dst_o
示例#21
0
文件: sem.py 项目: 0xf1sh/miasm
def bgtz(arg1, arg2):
    """Branches on @arg2 if the register @arg1 is greater than zero"""
    cond = (i1(1) if arg1 else i1(0)) | arg1.msb()
    dst_o = ExprId(ir.get_next_break_label(instr)) if cond else arg2
    PC = dst_o
    ir.IRDst = dst_o
示例#22
0
def bc1f(arg1, arg2):
    dst_o = ExprId(ir.get_next_break_label(instr)) if arg1 else arg2
    PC = dst_o
    ir.IRDst = dst_o
示例#23
0
文件: sem.py 项目: 0xf1sh/miasm
def bc1f(arg1, arg2):
    dst_o = ExprId(ir.get_next_break_label(instr)) if arg1 else arg2
    PC = dst_o
    ir.IRDst = dst_o
示例#24
0
文件: sem.py 项目: 0xf1sh/miasm
def blez(arg1, arg2):
    """Branches on @arg2 if the register @arg1 is less than or equal to zero"""
    cond = (i1(1) if arg1 else i1(0)) | arg1.msb()
    dst_o = arg2 if cond else ExprId(ir.get_next_break_label(instr))
    PC = dst_o
    ir.IRDst = dst_o
示例#25
0
def bc1t(arg1, arg2):
    dst_o = arg2 if arg1 else ExprId(ir.get_next_break_label(instr))
    PC = dst_o
    ir.IRDst = dst_o
示例#26
0
文件: sem.py 项目: vardyh/miasm
def bgez(ir, instr, a, b):
    e = []
    n = ExprId(ir.get_next_break_label(instr))
    dst_o = ExprCond(a.msb(), n, b)
    e = [ExprAff(PC, dst_o), ExprAff(ir.IRDst, dst_o)]
    return e, []
示例#27
0
def bgtz(arg1, arg2):
    """Branches on @arg2 if the register @arg1 is greater than zero"""
    cond = (i1(1) if arg1 else i1(0)) | arg1.msb()
    dst_o = ExprId(ir.get_next_break_label(instr)) if cond else arg2
    PC = dst_o
    ir.IRDst = dst_o
示例#28
0
def blez(arg1, arg2):
    """Branches on @arg2 if the register @arg1 is less than or equal to zero"""
    cond = (i1(1) if arg1 else i1(0)) | arg1.msb()
    dst_o = arg2 if cond else ExprId(ir.get_next_break_label(instr))
    PC = dst_o
    ir.IRDst = dst_o
示例#29
0
文件: sem.py 项目: 0xf1sh/miasm
def bal(arg1):
    PC = arg1
    ir.IRDst = arg1
    RA = ExprId(ir.get_next_break_label(instr))
示例#30
0
def bal(arg1):
    PC = arg1
    ir.IRDst = arg1
    RA = ExprId(ir.get_next_break_label(instr))
示例#31
0
文件: sem.py 项目: 0xf1sh/miasm
def jalr(arg1, arg2):
    """Jump to an address stored in a register @arg1, and store the return
    address in another register @arg2"""
    PC = arg1
    ir.IRDst = arg1
    arg2 = ExprId(ir.get_next_break_label(instr))
示例#32
0
def beq(arg1, arg2, arg3):
    "Branches on @arg3 if the quantities of two registers @arg1, @arg2 are eq"
    dst = ExprId(ir.get_next_break_label(instr)) if arg1 - arg2 else arg3
    PC = dst
    ir.IRDst = dst
示例#33
0
文件: sem.py 项目: 0xf1sh/miasm
def bc1t(arg1, arg2):
    dst_o = arg2 if arg1 else ExprId(ir.get_next_break_label(instr))
    PC = dst_o
    ir.IRDst = dst_o
示例#34
0
def bgez(arg1, arg2):
    """Branches on @arg2 if the quantities of register @arg1 is greater than or
    equal to zero"""
    dst = ExprId(ir.get_next_break_label(instr)) if arg1.msb() else arg2
    PC = dst
    ir.IRDst = dst
示例#35
0
文件: sem.py 项目: 0xf1sh/miasm
def jal(arg1):
    "Jumps to the calculated address @arg1 and stores the return address in $RA"
    PC = arg1
    ir.IRDst = arg1
    RA = ExprId(ir.get_next_break_label(instr))
示例#36
0
def bne(arg1, arg2, arg3):
    """Branches on @arg3 if the quantities of two registers @arg1, @arg2 are NOT
    equal"""
    dst = arg3 if arg1 - arg2 else ExprId(ir.get_next_break_label(instr))
    PC = dst
    ir.IRDst = dst
示例#37
0
def jal(arg1):
    "Jumps to the calculated address @arg1 and stores the return address in $RA"
    PC = arg1
    ir.IRDst = arg1
    RA = ExprId(ir.get_next_break_label(instr))
示例#38
0
文件: sem.py 项目: vardyh/miasm
def bne(ir, instr, a, b, c):
    e = []
    n = ExprId(ir.get_next_break_label(instr))
    dst_o = ExprCond(a - b, c, n)
    e = [ExprAff(PC, dst_o), ExprAff(ir.IRDst, dst_o)]
    return e, []
示例#39
0
def jalr(arg1, arg2):
    """Jump to an address stored in a register @arg1, and store the return
    address in another register @arg2"""
    PC = arg1
    ir.IRDst = arg1
    arg2 = ExprId(ir.get_next_break_label(instr))
示例#40
0
文件: sem.py 项目: 0xf1sh/miasm
def bltz(arg1, arg2):
    """Branches on @arg2 if the register @arg1 is less than zero"""
    dst_o = arg2 if arg1.msb() else ExprId(ir.get_next_break_label(instr))
    PC = dst_o
    ir.IRDst = dst_o