Example #1
0
def lookupswitch(loc, code):
    """
    https://cs.au.dk/~mis/dOvs/jvmspec/ref--41.html
    :return:
    """
    loc_offset = loc + 1
    operands = []
    while loc_offset % 4 != 0:
        loc_offset += 1

    default_offset = unpack_int(code[loc_offset: loc_offset + 4])
    loc_offset += 4
    operands.append(default_offset)

    n = unpack_int(code[loc_offset: loc_offset + 4])
    loc_offset += 4
    operands.append(n)

    for i in range(n):
        key = unpack_int(code[loc_offset: loc_offset + 4])
        loc_offset += 4
        operands.append(key)
        offset = unpack_int(code[loc_offset: loc_offset + 4])
        loc_offset += 4
        operands.append(offset)
        
    return (loc_offset - loc, Bytecode(loc, 0xab, operands))
Example #2
0
def goto_w(loc, code):
    """
    :return (size, Bytecode)
    """
    division_arr = [4]
    operands = []
    offset = 1
    for op in division_arr:
        cur_op_slice = code[loc + offset : loc + offset + op]
        if op == 1:
            operands.append(unpack_byte(cur_op_slice))
        elif op == 2:
            operands.append(unpack_short(cur_op_slice))
        elif op == 4:
            operands.append(unpack_int(cur_op_slice))
        offset += op
    
    return (1 + 4, Bytecode(loc, 0xc8, operands)) 
Example #3
0
def lstore_3(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x42, []))
Example #4
0
def swap(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x5f, []))
    
Example #5
0
def l2i(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x88, []))
Example #6
0
def pop2(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x58, []))
Example #7
0
def saload(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x35, []))
Example #8
0
def lxor(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x83, []))
Example #9
0
def monitorexit(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0xc3, []))
Example #10
0
def ldiv(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x6d, []))
Example #11
0
def lload_1(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x1f, []))
Example #12
0
def lcmp(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x94, []))
Example #13
0
def lconst_1(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x0a, []))
Example #14
0
def land(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x7f, []))
Example #15
0
def laload(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x2f, []))
Example #16
0
def ladd(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x61, []))
Example #17
0
def lsub(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x65, []))
Example #18
0
def lload_3(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x21, []))
Example #19
0
def lushr(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x7d, []))
Example #20
0
def lmul(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x69, []))
Example #21
0
def monitorenter(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0xc2, []))
Example #22
0
def lneg(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x75, []))
Example #23
0
def nop(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x0, []))
Example #24
0
def lreturn(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0xad, []))
Example #25
0
def return_(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0xb1, []))
Example #26
0
def ishr(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x7a, []))
Example #27
0
def sastore(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x56, []))
Example #28
0
def lstore_0(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x3f, []))
Example #29
0
def lshl(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x79, []))
Example #30
0
def istore_3(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x3e, []))